I must say that strict is a good thing, no doubt. You need to look at the
my function.
my will let you define a
scope for your variables. This means that the varaible will not be visable to the code outside the current block (beit a sub, main::, etc ...) Something like :
sub values{
my @X = ("something","something");
return(@X);
}
Then, instead of treating
@X as a global, it is returned by
&values(). Think of it this way, if someone saw the code, and not the subroutines, could they figure out where
@X came from ? If the answer is no, then you probably have a global. So, using the values sub above, you could say :
my @vals = &values();
&guest(@vals); ## i assume it uses this ? maybe not
&giest2( @vals, 'test');
Hope that gets you started on the right path ...
$ perl -e 'do() || ! do() ;'
Undefined subroutine &main::try