|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: "How did I live without this?"
|
> I think I've gone overkill on modifying this, but
> in case you want, say, field 1 and 2 and the last field,
> you can say:
I was thinking something similar, but ended up with:
my $field = shift or die "$0: <fieldnumer>\n";
$field =~ s/(-?\d+)/$1 > 0 ? $1-1 : $1/ge;
$, = " ";
while (<>) {
chomp;
my @f = split;
print @f[eval $field], "\n";
}
Which supports a slightly different syntax.
-mct
-
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|