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

Re: Is there any INCLUDE equivalent in Perl ?

by danger (Priest)
on Feb 28, 2001 at 02:42 UTC ( [id://61207]=note: print w/replies, xml ) Need Help??


in reply to Is there any INCLUDE equivalent in Perl ?

As others have said, check out the do, require, and use documentation. I sometimes just make the config file a simple anonymous hash and then grab it via require()'s return value:

# example program: #!/usr/bin/perl -w use strict; my $config = require("config.txt"); print "$config->{var1} $config->{var2}\n"; __END__ # and here's config.txt: { var1 => 'Hello', var2 => 'World', }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-29 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found