Perl Style: Configuration Files

  • If you need a config file, load it with do.

  • This gives you full Perl power.

        # from PCB 8.16
        $APPDFLT = "/usr/local/share/myprog";
        do "$APPDFLT/sysconfig.pl";
        do "$ENV{HOME}/.myprogrc";
    
        #in config file
        $NETMASK = '255.255.255.0';
        $MTU     = 0x128;
        $DEVICE  = 'cua1';
        $RATE    = 115_200;
    

Forward to Functions as Data
Back to Data-Oriented Programming
Up to index

Copyright © 1998, Tom Christiansen All rights reserved.

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub

TPRF Gold Sponsor
TPRF Silver Sponsor
TPRF Bronze Sponsor