Re: [Perl-unix-users] manipulating/parsing string data

2006-05-31 Thread listmail
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

Re: [Perl-unix-users] manipulating/parsing string data

2006-05-30 Thread Joi Ellis
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

[Perl-unix-users] manipulating/parsing string data

2006-05-30 Thread listmail
#!/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