Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

capturing from path

by amoura (Initiate)
on Jul 09, 2002 at 20:43 UTC ( #180602=perlquestion: print w/replies, xml ) Need Help??

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

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


    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://180602]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2021-02-25 16:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found