Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Windows - dirname(__FILE__)

by demichi (Acolyte)
on Apr 11, 2014 at 11:51 UTC ( #1081952=note: print w/ replies, xml ) Need Help??


in reply to Windows - dirname(__FILE__)

Might that be an idea?

use strict; use warnings; use Cwd 'abs_path'; use File::Basename; my $script_dirname = dirname(abs_path($0)); print "dirname: $script_dirname\n";

Output

C:\Data\scripting\misc>path_test.pl dirname: C:/Data/scripting/misc C:\Data\scripting\misc>perl path_test.pl dirname: C:\Data\scripting\misc C:\Data\scripting\misc>

Just a bit strange for me that it change / to \ when using the interpreter ...


Comment on Re: Windows - dirname(__FILE__)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-05-30 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (601 votes), past polls