strict behavior with .pm



Given the below code, is there something that will warn/prevent me from declaring $variable when i really meant @variable ?

I usually use perl -wTc scriptname to check for silliness, but i've realized code in the below fashion won't be reported. This got me very confused under mod_perl, because @variable contained things seemingly unrelated to what i expected.

__BEGIN__
#!/usr/local/bin/perl
use strict;
use My::Example;
my $example = My::Example->new();
my $ref = $example->go();
__END__


__BEGIN__
package My::Example;
sub new {
return bless({}, shift);
}
sub go {
my $variable;
push @variable, 1;
return(\@int);
}
1;
__END__

--

Jeremy Kister
http://jeremy.kister.net./
.



Relevant Pages

  • Requiring Lexical $_ / Obliterating Global $_?
    ... at the start of each sub, but it's an annoyance and it's not ... Just found out about Perl 5.10. ... The default variable $_ can now be lexicalized, by declaring it ... foreach my $_ ...
    (comp.lang.perl.misc)
  • [tip:perf/scripting] perf trace: Add perf trace scripting support modules for Perl
    ... Add Perf-Trace-Util Perl module and some scripts that use it. ... new file mode 100644 ... +GNU General Public License version 2 as published by the Free ... +sub define_flag_field ...
    (Linux-Kernel)
  • RE: returning hashes, and arrays
    ... :> subroutine named link(). ... :> array interchangeably here. ... : 'Learning Perl'; ... : sub ParseLineForHomeAndVisitors; ...
    (perl.beginners)
  • Re: Shifting Away
    ... are there two armed camps of Perl monks throwing gazillion megawatt ... daily at shift change and shout "When should I use an en dash?" ... become a bit less paranoid now but it's hard to let go of formal params. ... in the argument list and the sub could still change that. ...
    (comp.lang.perl.misc)
  • [RFC][PATCH 4/7] perf trace: Add perf trace scripting support modules for Perl
    ... Add Perf-Trace-Util Perl module and some scripts that use it. ... new file mode 100644 ... +GNU General Public License version 2 as published by the Free ... +sub define_flag_field ...
    (Linux-Kernel)