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