Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 chanting in the Monastery: (4)
As of 2018-09-23 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (191 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!