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/";
        do "$ENV{HOME}/.myprogrc";
        #in config file
        $NETMASK = '';
        $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.



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