Hi -
This sample looks funny ( please don't say 'why would
you ever want to do that?' ) but it is part of a much
larger project. This script:
#!/usr/bin/perl
use strict;
use warnings;
_main();
sub _main
{
my $arg1 = shift @ARGV;
my $arg2 = shift @ARGV;
show_results();
sub show_results
{
print "$arg1 and $arg2\n"; # <- line 17
}
}
gives the following warnings:
[EMAIL PROTECTED]:~/src/bempl/junk$ perl ev2.pl mary jane
Variable "$arg1" will not stay shared at ev2.pl line 17.
Variable "$arg2" will not stay shared at ev2.pl line 17.
mary and jane
Can you nest subroutines? What do the warnings mean?
Aloha => Beau;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>