C
Chris
This seems inconsistent:
#!/usr/bin/perl -w
use strict;
my @y;
if(!defined(@y))
{
print "y undefined\n";
}
my $z = scalar(@y);
if(!defined($z))
{
print "z undefined\n";
}
if(!defined(scalar(@y)))
{
print "scalar(\@y) not defined\n";
}
This prints
y undefined
scalar(@y) not defined
So, the question is, why does
my $z = scalar(@y);
if(!defined($z))
behave differently from
if(!defined(scalar(@y)))
???
Thanks,
Chris
#!/usr/bin/perl -w
use strict;
my @y;
if(!defined(@y))
{
print "y undefined\n";
}
my $z = scalar(@y);
if(!defined($z))
{
print "z undefined\n";
}
if(!defined(scalar(@y)))
{
print "scalar(\@y) not defined\n";
}
This prints
y undefined
scalar(@y) not defined
So, the question is, why does
my $z = scalar(@y);
if(!defined($z))
behave differently from
if(!defined(scalar(@y)))
???
Thanks,
Chris