Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Windows - dirname(__FILE__)

by aitap (Curate)
on Apr 11, 2014 at 17:53 UTC ( [id://1082005]=note: print w/replies, xml ) Need Help??


in reply to Re: Windows - dirname(__FILE__)
in thread Windows - dirname(__FILE__)

Sadly, this won't work when script is called from another directory by full path:

$ pwd /home/aitap $ cat /tmp/1.pl #!/usr/bin/perl use strict; use warnings; use Cwd; my $script_dirname = cwd; print "dirname: $script_dirname\n"; use Cwd 'abs_path'; use File::Basename; $script_dirname = dirname(abs_path($0)); print "script dirname: $script_dirname\n"; $ perl /tmp/1.pl dirname: /home/aitap script dirname: /tmp

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1082005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found