convenientstore has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; my ($newyork,$miami); while (<DATA>) { if ( $_ =~ /^NEW YORK:\s+(\S+)/ ) { $newyork = $1; $newyork = $newyork || 'NA'; next; } if ( $_ =~ /^MIAMI:\s+(\S+)/ ) { $miami = $1; $miami = $miami || 'NA'; next; } } __END__ NEW YORK: knicks CHICAGO: bulls MIAMI: heat LA: lakers
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Please fix my writing style
by dragonchild (Archbishop) on Nov 22, 2008 at 04:53 UTC | |
Re: Please fix my writing style
by jwkrahn (Abbot) on Nov 22, 2008 at 02:10 UTC | |
Re: Please fix my writing style
by hydo (Monk) on Nov 22, 2008 at 03:10 UTC | |
by blazar (Canon) on Nov 23, 2008 at 23:24 UTC | |
Re: Please fix my writing style
by juster (Friar) on Nov 22, 2008 at 07:38 UTC | |
by convenientstore (Pilgrim) on Nov 22, 2008 at 16:43 UTC | |
by juster (Friar) on Nov 22, 2008 at 19:48 UTC | |
by convenientstore (Pilgrim) on Nov 23, 2008 at 03:53 UTC | |
by convenientstore (Pilgrim) on Nov 22, 2008 at 16:40 UTC |