Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-11-20 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (224 votes). Check out past polls.

    Notices?