[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] getting filenames



On Fri, 26 Apr 1996, kevin mason wrote:

> is it possible to get the "regular" filenames from @ARGV instead of the
> full pathnames which include every folder and volume down to the hard
> drive, separated by colons? for example, if i drop files called "file 1",
> "file 2", and "file 3" onto a droplet, i want to somehow get @somelist =
> ("file 1", "file 2", "file 3"). if not, i guess i'll have to massage an
> @ARGV copy with substitution?

    foreach(@ARGV) { s/^.*:// } # strip leading path from file names

Note that such pathless names won't do you much good if you actually need
to use the files in question.

> thanks.

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)