http://qs321.pair.com?node_id=180602

amoura has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: capturing from path
by Fastolfe (Vicar) on Jul 09, 2002 at 21:19 UTC
    You may also be interested in reading the responses to these nodes below, as a very similar question was also asked today by one of your classmates:
Re: capturing from path
by Aristotle (Chancellor) on Jul 09, 2002 at 20:50 UTC

    Hiya.

    Your question is rather unclear - do you want to store the files' contents' in the variables or just the filenames?

    In either case you will need readdir. In case you want to read the files, you will also need open and close as well as the <FILEHANDLE> operator.

    Once you explain yourself more clearly, we can provide more specific answers as well.

    Makeshifts last the longest.

Re: capturing from path
by Fastolfe (Vicar) on Jul 09, 2002 at 20:57 UTC
    To break a path up into directory and file components, you can either split on the / character, or for a more portable solution, use File::Spec's splitpath and splitdir functions.