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

Re: Breaking a script into smaller files

by growlf (Pilgrim)
on Nov 12, 2001 at 15:53 UTC ( [id://124804]=note: print w/replies, xml ) Need Help??


in reply to Breaking a script into smaller files

Well,
$0 =~ m,(.*?)[^/\\]+$, and unshift @INC, $1;
works pretty well.

*G*

Replies are listed 'Best First'.
Re: Re: Breaking a script into smaller files
by John M. Dlugosz (Monsignor) on Nov 13, 2001 at 00:39 UTC
    Do all OS's hide the real path syntax and use a / or \ for the contents of $0? If so, what would it do with the directory :arrivals:11/01:foo.pl on a Macintosh?

    I want to always use a core module to manipulate file names, so I don't have to worry about such things.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found