Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

RE: Re: Getting a List of Files Via Glob

by Zoogie (Curate)
on May 30, 2000 at 21:14 UTC ( #15448=note: print w/replies, xml ) Need Help??

in reply to Re: Getting a List of Files Via Glob
in thread Getting a List of Files Via Glob

I considered this, but I'd have to return the original working directory at the sub, since other subs assume that the working dir hasn't changed.

I suppose I could save the original working dir with
$prevdir = `pwd`;
But executing the shell command doesn't seem like it would be much more efficient than mapping the directory name on to each glob and then chopping it off...

Replies are listed 'Best First'.
RE: RE: Re: Getting a List of Files Via Glob
by chromatic (Archbishop) on Jun 25, 2000 at 05:41 UTC
    Use Cwd. It's a standard module.
    use Cwd; my $dir = cwd(); chdir $otherdir; # do something chdir $dir;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://15448]
[ravi45722]: can i get current date using Joda time format
[ravi45722]: Ex: EEE MMM dd HH:mm:ss.SSS yyyy
[ravi45722]: Fri Mar 24 11:54:55.234 2017

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-03-24 06:26 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (296 votes). Check out past polls.