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


in reply to Not sure how to handle this scope

Something like this? (simplified...)

#!/usr/bin/perl use strict; use warnings; my $self = 'cat'; print "outside $self\n"; { my $self = $self; print " inside $self\n"; $self = 'dog' if not defined $ARGV[0]; print " inside $self\n"; } print "outside $self\n";

Outputs:

outside cat inside cat inside dog outside cat