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([EMAIL PROTECTED]);
}
1;
__END__

--

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

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to