[Israel.pm] FW: newbie question

Avishalom Shalit avishalom at gmail.com
Thu Jan 15 05:30:58 PST 2009


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 <chananb at centerity.com>:
> 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
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



-- 
-- vish



More information about the Perl mailing list