in reply to Re^2: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
in thread Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
yep I just deciphered it from the error msg.
> do you know why is this happening?
the initialization of @aminos is never executed.
using strict and warnings might have shown you.
either put the initialization into the sub or declare a constant (string please!).
darn, constants are not interpolated in strings or regexes.
you have to define a constant regex:
DB<131> use constant REGEX=>qr/[^ABCD]/ DB<132> 'C' =~ REGEX DB<133> 'Z' =~ REGEX => 1
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/ (updated)
by RonW (Parson) on Apr 29, 2014 at 16:41 UTC | |
by LanX (Saint) on Apr 29, 2014 at 17:01 UTC | |
by AnomalousMonk (Archbishop) on Apr 30, 2014 at 11:07 UTC |