develooper Front page | perl.beginners | Postings from April 2008

a declaring

Thread Next
From:
J. Peng
Date:
April 21, 2008 07:40
Subject:
a declaring
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 \@x;


Since $y is false, it seems @x shouldn't be declared.
But why the last print can work?

-- 
J. Peng - QQMail Operation Team
eMail: peng.kyo@gmail.com  AIM: JeffHua

Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About