LameNerd has asked for the wisdom of the Perl Monks concerning the following question:
I am so bored writting while(<>) loops
to read in files that contain information for my scripts.
Here's an example of what I do when I need to do this:
sort of thing?
to read in files that contain information for my scripts.
Here's an example of what I do when I need to do this:
Does some monk out there have a better way of doing thismy $userid; my $password; while(<DATA>) { next if /^#/; ($userid, $password) = split /=/; } print "$userid:$password\n"; __DATA__ #user=passwd test=prrft5142
sort of thing?
|
---|
Back to
Seekers of Perl Wisdom