iaw4 has asked for the wisdom of the Perl Monks concerning the following question:
for commoners, like myself. my problem is easier to show than to explain (perl 5.8.8):
can someone please explain to me how to avoid this (and not just suppress the error)?#!/usr/bin/perl -w use strict; use Regexp::Common; my $teststring= "teststring: start hello {ab}{cd} end\n"; my $balancedparens= qr/\s*$RE{balanced}{-parens=>'{ }'}/; my $pattern1= $balancedparens . $balancedparens; my $pattern2= qr/hello/; my $pattern3= $pattern2.$pattern1; print "no error yet\n"; $teststring=~ s/$pattern3/hi$1/g; ## ERROR, WHY??? print $teststring;
Back to
Seekers of Perl Wisdom