in reply to Using constants inside regex

<ShamelessSelfPromotion>
You could also use the Filter::Interpolate module I put into Code Catacombs:
use Filter::Interpolate; use constant TEST => 3; my $string="123456"; $string =~ s/\Q$(TEST)\E/9/; print $string, "\n"; $string =~ s/2/$(TEST)/; print $string, "\n";
</ShamelessSelfPromotion>

It should also be pointed out that the @{[THING]} hack will work with subroutines too. It will also work in double-quoted strings and anywhere else interpolation happens.

=cut
--Brent Dax

@HPAJ=split("", "rekcaH lreP rentonA tsuJ"); print reverse @HPAJ; #sucky but who cares?