in reply to use strict and -w
while (<FILE>) { # no need for chomp, because you strip whitespace below if (my($quote, $person) = /(.*?)--(.*?)/s) { s/^\s+//, s/\s+$/ for $quote, $person; print "$quote\t$person\n"; } else { # no --, so just show the cleaned up quote: s/^\s+//, s/\s+$/; print "$_\t(Unknown)\n"; } }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use strict and -w
by danger (Priest) on Mar 15, 2001 at 20:44 UTC |