Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Reading and Writing Perl Config Files

by jdhedden (Deacon)
on Jun 07, 2005 at 15:55 UTC ( [id://464358]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %CFG = (
        'servers' => {
    ...
        },
        'temp' => 'remove me'
    );
    
  2. or download this
    # Read a configuration file
    #   The arg can be a relative or full path, or
    ...
        print(STDERR $err, "\n");
        exit(1);
    }
    
  3. or download this
    # Add last access time
    $CFG::CFG{'servers'}{'SRV1'}{'last_access'} = time();
    ...
        print(STDERR "ERROR: Failure opening log file: $!\n");
        exit(1);
    }
    
  4. or download this
    use Data::Dumper;
    
    ...
        print(STDERR $err, "\n");
        exit(1);
    }
    
  5. or download this
    perl -c my_cfg.cfg
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://464358]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found