Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Better way to read "configuration" files

by Cabrion (Friar)
on Mar 03, 2003 at 23:54 UTC ( [id://240195]=note: print w/replies, xml ) Need Help??


in reply to Better way to read "configuration" files

I try to allow for whitespace with something like . . .
my $userid; my $password; while(<DATA>) { next if /^ *#/; ($userid, $password) = split / *= */; $userid =~ s/^ +//; $userid =~ s/ +$//; } print "$userid:$password\n"; __DATA__ #user=passwd test = prrft5142
The other monks will probably encourage you to use various modules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found