Re: why warn on undefined $1?
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 01:33:12 +0200
ihok@xxxxxxxxxxx wrote:
how can I store the s/// regexp in a variable? I want
something like qr//, but for s///. In other words, I want this to
work, but it doesn't.
my $re = s/or(ed|ing|s)?$/our$1/;
my $re = 's/or(ed|ing|s)?$/our$1/';
my $s = 'colored';
$s =~ $re;
eval "\$s =~ $re";
print $s;
# coloured
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: why warn on undefined $1?
- From: ihok@xxxxxxxxxxx
- Re: why warn on undefined $1?
- References:
- why warn on undefined $1?
- From: ihok@xxxxxxxxxxx
- Re: why warn on undefined $1?
- From: xhoster
- Re: why warn on undefined $1?
- From: Ben Morrow
- Re: why warn on undefined $1?
- From: ihok@xxxxxxxxxxx
- why warn on undefined $1?
- Prev by Date: REINSTALL PERL
- Next by Date: Re: why warn on undefined $1?
- Previous by thread: Re: why warn on undefined $1?
- Next by thread: Re: why warn on undefined $1?
- Index(es):