Thanks so much, but I am still confused on one point. I have:
next if $line =~ (/^\*+/)|(/^\s*$/);
and it seems to work, but you say: next if $line =~ /^(\*|\s*$)/; wouldn't
this only find one * that the line starts with.
i.e.
* foo
foo
would both be skipped, what
On Jan 3, Booher Timothy B 1stLt AFRL/MNAC said:
next if $line =~ (/^\*+/)|(/^\s*$/);
Wow. The reason that appears to work is a bizarre one indeed.
while (FOO) {
$line = $_;
next if $line =~ (/foo/) | (/bar/);
# ...
}
That code is the as
while (FOO) {
$line = $_;
Hey Jeff,
Off the of your head, do you have any idea how much '$line=$_' slows the script down
since you are
now performing 2 separate regex's? Or does it in fact speed it up?
Shawn
while (FOO) {
$line = $_;
next if $line =~ (/foo/) | (/bar/);
# ...
}
--
To
On Jan 3, Shawn said:
Off the of your head, do you have any idea how much '$line=$_' slows
the script down since you are now performing 2 separate regex's? Or
does it in fact speed it up?
You should probably be using two regexes, since that's the most
clear. The fact that you have two