strict behavior with .pm
- From: perl-04@xxxxxxxxxxxxxxxx (Jeremy Kister)
- Date: Fri, 28 Sep 2007 17:18:57 -0400
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./
.
- Follow-Ups:
- Re: strict behavior with .pm
- From: Paul Lalli
- Re: strict behavior with .pm
- From: Chas. Owens
- Re: strict behavior with .pm
- Prev by Date: Re: cpan command line
- Next by Date: Re: strict behavior with .pm
- Previous by thread: cpan command line
- Next by thread: Re: strict behavior with .pm
- Index(es):
Relevant Pages
|