The responses are great. $Bill showed an example that I didn't even
consider which was to simply shift the array *after* the assignment.
Whats good though is that I can use all these ideas as needed and where
appropriate. I appreciate everyone's feedback.
Joi Ellis wrote:
On Tue, 30 May 200
On Tue, 30 May 2006, listmail wrote:
Untested, off-the-cuff suggestion...
This looks suspiciously like a homework assignment. ;)
> #!/usr/local/bin/perl -w
> use strict;
>
> my @data = ('NUMBERS: ONE TWO THREE',
> 'WORDS: CAT MOUSE DOG');
> my (@numlist, @wordlist);
>
> foreach my
#!/usr/local/bin/perl -w
use strict;
my @data = ('NUMBERS: ONE TWO THREE',
'WORDS: CAT MOUSE DOG');
my (@numlist, @wordlist);
foreach my $line (@data) {
print "$line\n";
if ($line =~ /^NUMBERS:/) {
#
#Need to shift $line so $line becomes onl