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 $_; }
In reply to Re^2: Working with text files, thinking my issue is with variables inside if loops
by holli
in thread Working with text files, thinking my issue is with variables inside if loops
by Steffi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |