in reply to Declaring Variables

put the my $this-variable statement somewhere outside the loop or subroutine where you want other parts to get info from it.
my $myvariable; my $this-variable; $this-variable = 1 if $myvariable =~ /blah/;
then later on in the code you can do this
print "HEY!\n" if $this-variable; print "NO!\n" if !$this-variable;