Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
P is for Practical
 
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 romping around the Monastery: (4)
As of 2014-04-20 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (487 votes), past polls