in reply to Tossing unwanted values from returned list
#!/usr/bin/perl use warnings; use strict; my $list = 'foo #comment bar <tag> baz'; my ($first, $second, $third) = grep(/^\w+$/, split(' ',$list)); print<<_; 1. $first 2. $second 3. $third _ ; C:\>perl test.pl 1. foo 2. bar 3. baz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Tossing unwanted values from returned list
by Sprad (Hermit) on Nov 18, 2003 at 16:17 UTC |