Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: system pwd

by jkahn (Friar)
on May 22, 2003 at 00:08 UTC ( #259945=note: print w/replies, xml ) Need Help??


in reply to system pwd

The other comments (regarding the difference between system and backticks) are entirely correct.

I have a separate comment, however -- if you want to identify the current working directory, you should use Perl's core module Cwd instead of invoking system tools. (try perldoc Cwd).

use Cwd; print getcwd();

The biggest advantage is that using Cwd does not have portability issues -- your tool will continue to work correctly on whatever OS you need to use Perl on.

If you already know this, great. Just my $0.02 US.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259945]
help
Chatterbox?
[Corion]: Ah, how I missed it. After some years, I revisit slashdot on a click-bait link, and it provides the usual humor instantly: "I didn't know Drupal had rules for sex. It must be a plug-in"
[Corion]: erix: This is not for sybase, but for the input data files, resp. their contents.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-03-28 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (328 votes). Check out past polls.