http://qs321.pair.com?node_id=1200062


in reply to If statement seems to ignore elsif and skips to else

Stop at each elsif? Only if you've set breakpoints at each one, I think... but

I suspect your first or (at Ln 7) is NOT doing what you expect. You have two alternatives at Ln 8 & 9 (where you start another or clause. Suggest you group your alternatives.

UPDATE: Miscounted paren pairs. My bad.

Warning: these observations arise from a top of head scan of your submission... but can't be taken too seriously, since we have no sample of input ... and can't (from what you've shown) be sure we know what $ThisLine may contain.

Lastly, point of personal preference (only? perhaps?): rather than constucting regexen with fixed dots (for any byte), it may make the code clearer to use quantifiers... and precompiled regexen:

my $re_start = qr/../; #match string begining with two of anything (0 +or more times each!) # but still a potential problem: would match a +null string) # so, perhaps, qr/.{1).(1)/ which will not allow + a string # (preceding the comma in your initial set of rege +xen) # with anything other than two instances of somethin +g # or another

untested, but HTH.

UPDATE: demonstrates the need to test before posting...and the consequences of failing to do so. My bad again


Spirit of the Monastery but ++$anecdote ne $data