------------------- #!/usr/bin/perl -w
use strict;
sub1("There are 100 words.");
sub sub1 {
my $s = shift;
$s =~ /There are (\d+) words./;
print "sub1 (before call): \$1=$1\n";
sub2($s);
print "sub1 (after call): \$1=$1\n";
}sub sub2 {
my $s = shift;
# local $1 = undef; <--- Adding this has no apparent effect.
print "sub2 (before match): \$1=$1\n";
$s =~ /There are ([a-z]+) words./;
print "sub2 (after match): \$1=$1\n";
}
------------------ The output:
sub1 (before call): $1=100 sub2 (before match): $1=100 sub2 (after match): $1=100 sub1 (after call): $1=100
_______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

