Berkeley CSUA MOTD:Entry 20411
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/12/25 [General] UID:1000 Activity:popular
12/25   

2001/1/24 [Computer/SW/Languages/Perl] UID:20411 Activity:kinda low
1/22    In perl, how do I read a set of vars from a .*rc file?  In bash,
        I'd just say ". $HOME/.foorc" and all the varname=value pairs come
        into scope.  What's the perl equivalent?
        \_ perldoc -f require
           perldoc -f use
           \_ Both of these require the use of perl's package syntax in
              the .rc file.  I'm looking for something simpler.
              \_ They don't -- just write your rc file with lines like
                 $variable = "value";
        \_ require 'filename.pl';
           ... use the variables you set in that file...
           The only trick is that filename.pl has to end with a positive
           value... just make the last line of the file:
           1;           ##dbushong
                1;
                \_ Ladies and gentlemen, we have a winner!