RE: remove spaces before and after (thanks)

2002-01-03 Thread Booher Timothy B 1stLt AFRL/MNAC
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

RE: remove spaces before and after (thanks)

2002-01-03 Thread Jeff 'japhy' Pinyan
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 = $_;

Re: remove spaces before and after (thanks)

2002-01-03 Thread Shawn
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

Re: remove spaces before and after (thanks)

2002-01-03 Thread Jeff 'japhy' Pinyan
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