Re: strict behavior with .pm
- From: chas.owens@xxxxxxxxx (Chas. Owens)
- Date: Fri, 28 Sep 2007 17:31:33 -0400
On 9/28/07, Jeremy Kister <perl-04@xxxxxxxxxxxxxxxx> wrote:
Given the below code, is there something that will warn/prevent me fromsnip
declaring $variable when i really meant @variable ?
package My::Example;snip
sub new {
return bless({}, shift);
}
sub go {
my $variable;
push @variable, 1;
return(\@int);
}
1;
The strict pragma is lexically scoped, so you need to use it again
after the package statement. It is probably a good idea to turn on
warnings as well.
.
- Follow-Ups:
- Re: strict behavior with .pm
- From: Tom Phoenix
- Re: strict behavior with .pm
- References:
- strict behavior with .pm
- From: Jeremy Kister
- strict behavior with .pm
- Prev by Date: strict behavior with .pm
- Next by Date: Re: strict behavior with .pm
- Previous by thread: strict behavior with .pm
- Next by thread: Re: strict behavior with .pm
- Index(es):
Relevant Pages
|
|