http://qs1969.pair.com?node_id=545596


in reply to Re^2: delayed variable interpolation in a regular expression
in thread delayed variable interpolation in a regular expression

David, you were correct the first time and your second example is fine. ] can be the first character in a class without being escaped.

H:\>perl -e "$_='a';/[]a]/?print 'Y':print 'N'" Y H:\>
On an XP box (which is why you see the reversed quote notation). I also believe you're absolutely correct about the hyphen being acceptable as the last character (it's not "underscore to nothing").


-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;