Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Working with text files, thinking my issue is with variables inside if loops

by holli (Monsignor)
on May 24, 2011 at 07:56 UTC ( #906442=note: print w/ replies, xml ) Need Help??


in reply to Re: Working with text files, thinking my issue is with variables inside if loops
in thread Working with text files, thinking my issue is with variables inside if loops

Suboptimal.
while (<FILE>) { next unless /\S/; # Skip whitespace lines if (/^ \s* Daniel \s+ Lastname \s* $/x) { $current_handle = daniels_handle; next; } elsif (/^ \s* Steffi \s+ Lastname \s* $/x) { $current_handle = steffis_handle; next; } print $current_handle $_; }


holli

You can lead your users to water, but alas, you cannot drown them.


Comment on Re^2: Working with text files, thinking my issue is with variables inside if loops
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2015-05-22 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (464 votes), past polls