Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

How to determine absolute path of current Perl file?

by hakonhagland (Scribe)
on Feb 29, 2016 at 09:00 UTC ( [id://1156424]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use My::Module;
    My::Module::print_file_name();
    
  2. or download this
    package My::Module;
    use feature qw(say);
    ...
        say __FILE__;
    }
    1;
    
  3. or download this
    if ( !File::Spec->file_name_is_absolute( $filename ) ) {
       $filename = File::Spec->rel2abs( $filename, $FindBin::Bin );
    }
    
  4. or download this
    package Cwd::Initial;
    use strict;
    ...
    
    1;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1156424]
Front-paged by Discipulus
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: (7)
As of 2024-04-18 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found