Re: a declaring

2008-04-21 Thread Chas. Owens
On Mon, Apr 21, 2008 at 9:25 PM, J. Peng <[EMAIL PROTECTED]> wrote: > On Tue, Apr 22, 2008 at 1:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > > Because of a quirk in how the current and past versions of perl parsed > > and handled the statement. It is a mis-feature according to Larry. > >

Re: a declaring

2008-04-21 Thread J. Peng
On Tue, Apr 22, 2008 at 1:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > Because of a quirk in how the current and past versions of perl parsed > and handled the statement. It is a mis-feature according to Larry. Chas, do you mean this is a bad style to declare and assign a variable like belo

Re: a declaring

2008-04-21 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Mon, Apr 21, 2008 at 11:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: snip Please read the last para in the "Statement Modifiers" section in "perldoc perlrun". snip I think you mean perlsyn, not perlrun: http://perldoc.perl.org/perlsyn.html#Statement-Modifiers Y

Re: a declaring

2008-04-21 Thread Chas. Owens
On Mon, Apr 21, 2008 at 10:40 AM, J. Peng <[EMAIL PROTECTED]> wrote: > I'm not sure, but why this can work? > > use strict; > use warnings; > use Data::Dumper; > > my $y=0; > my @x =(1,2,3) if $y; > print Dumper [EMAIL PROTECTED]; > > > Since $y is false, it seems @x shouldn't be declared. >

Re: a declaring

2008-04-21 Thread Chas. Owens
On Mon, Apr 21, 2008 at 11:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: snip > Please read the last para in the "Statement Modifiers" section in "perldoc > perlrun". snip I think you mean perlsyn, not perlrun: http://perldoc.perl.org/perlsyn.html#Statement-Modifiers -- Chas. Owens wonkd

Re: a declaring

2008-04-21 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: J. Peng wrote: I'm not sure, but why this can work? use strict; use warnings; use Data::Dumper; my $y=0; my @x =(1,2,3) if $y; print Dumper [EMAIL PROTECTED]; Since $y is false, it seems @x shouldn't be declared. Please read the last para in the "Statement Modifier

Re: a declaring

2008-04-21 Thread Gunnar Hjalmarsson
J. Peng wrote: I'm not sure, but why this can work? use strict; use warnings; use Data::Dumper; my $y=0; my @x =(1,2,3) if $y; print Dumper [EMAIL PROTECTED]; Since $y is false, it seems @x shouldn't be declared. Please read the last para in the "Statement Modifiers" section in "perldoc pe

a declaring

2008-04-21 Thread J. Peng
I'm not sure, but why this can work? use strict; use warnings; use Data::Dumper; my $y=0; my @x =(1,2,3) if $y; print Dumper [EMAIL PROTECTED]; Since $y is false, it seems @x shouldn't be declared. But why the last print can work? -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] A