Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: Reading Variables from a File

by msemtd (Scribe)
on May 30, 2003 at 18:48 UTC ( #261917=categorized answer: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    my $cake = 'chocolate';
    my $pie = 'apple';
    eval slurp("config.pl");
    
  2. or download this
    ## slurp - read a file into a scalar or list
    sub slurp {
    ...
        close F;
        return @a;
    }
    
  3. or download this
    $pie = 'pecan';
    cake = 'fairy';
    
  4. or download this
    if($@){
        print "Some errors happened...\n\n";
        print $@."\n\n";
        print "Oh well...\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2018-07-22 01:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (451 votes). Check out past polls.

    Notices?