Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Strange Behaviour of Two Hashes

by buckaduck (Chaplain)
on May 17, 2005 at 23:03 UTC ( [id://458032]=note: print w/replies, xml ) Need Help??


in reply to Strange Behaviour of Two Hashes

The error is on line 109: if ((my @gaps) = ($asstr =~ m/$regex/o)) The /o in your regex is telling Perl to compile the regular expression only once because the string $regex is never going to change. But it does change, because you call the subroutine more than once. Therefore, the regex gets compiled differently, depending on which call to the align() subroutine occurs first.

The way to fix it is to remove the /o from the regex: if ((my @gaps) = ($asstr =~ m/$regex/))

buckaduck

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458032]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-25 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found