You dont need the map, a simple array assignment will do.
my @strings = ($genome1, $genome2);
Update. That said, if you don't have your strings in an array, and its difficult to put them into one to start with, a small modification to the routine will prevent needless duplication.
#! perl -sw use strict; # ... your existing code.... my @strings = \($genome1, $genome2); my ($total, $p) = (0, 0); do { $total = 0; #NOTE: Extra $'s v ........................................v print substr( $$strings[$_]}, $p, 60 ) . "\n" for 0 .. $#$strings; print "\n"; $p+=60; $total += length($_) - $p for @$strings; # And here! } while( $total > 0 ); __END__
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
In reply to Re: Re: Re: trivial wrapping
by BrowserUk
in thread trivial wrapping
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |