i don't mean to seem rude, i often have very basic questions myself. 1 - perldoc -f defined , or just write a very short piece of code testing the differences. will get you an answer quicker than emailing.
2 - if (@a) is evaluated in scalar context returning the number of elements. therefore 0 2009/1/15 Chanan Berler <[email protected]>: > Hi All, > > I am wondering if there is a difference between: > The last one I believe I know the answer, empty string still defined, but I > sure wanna clear view..:-) > PS: will use strict / warning will make a difference ? > > do_somthing if ($legend); > > or > > do_something if (defined($legend)); > > or > > do_something if ($legend == ""); > > > another question: > is there a difference between > > @arr = (); > > And > > @arr; > > Since both of them showed nothing when trying to do this: > print "Yea" if (@arr); > > > thanks > Chanan > > _______________________________________________ > Perl mailing list > [email protected] > http://perl.org.il/mailman/listinfo/perl > -- -- vish _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
