in reply to Most Efficient Way to match this
Or, shorter:my @fields = split /:/, $line; my $linefraq = $fields[0];
You could also use a regular expression:my $linefraq = (split /:/, $line)[0];
$linefraq = $1 if $line =~ /^(\w+?):/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Most Efficient Way to match this
by kroach (Pilgrim) on Mar 30, 2015 at 22:02 UTC |