> I'm writing and testing a module that can be executed as a standalone script
> for debugging purposes.
> It's part of a very large system of regression testing. Messages are lost
> along the way.
> So with the caller() function I transform a module into an executable.
> With example #1 my $x seems to have lost it's scope.
> What I'm worried about, is what is goinf to happen when in the big system it
> does a :
> use foo;
> or
> require "foo.pm";
> example #1
> #!/usr/local/bin/perl
> use strict;
> use warnings;
> if ( !defined caller ) { foo::bar();}
> package foo;
> my $x = 'foo.bar';
> sub bar { print "$x\n"; } <<<<------ line 13 blank lines removed
> 1;
> executing gives this :
> Use of uninitialized value in concatenation (.) or string at z line 13.
> [...]
Move the line that tests caller() and calls foo::bar() down below the