Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: lib

by alfie (Pilgrim)
on Apr 11, 2001 at 17:38 UTC ( [id://71651]=note: print w/replies, xml ) Need Help??


in reply to lib

Maybe the -P switch is what you want. You can use then the following construct:
#!/usr/bin/perl -P #define MYPATH "/WEBDEVELOPMENT/cgi-bin/postcode.txt" read_in_file(); sub read_in_file { open(INPUTFILE, "<".MYPATH."postcode.txt"); }
That way you can define things at the top of your file and use the defined values through your code. See perlman:perlrun for more information about that switch.
--
Alfie

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-20 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found