"Chris" <[EMAIL PROTECTED]> writes:

> > "Scott K Purcell" <[EMAIL PROTECTED]> writes:
> > hello,
> > I am sorry to ask, but I can't seem to find this kind of statement in my 
> > book or in the documentation.
> > 
> > $text = defined($ARGV[0]) ? $ARGV[0] : "Hello world";
> > 
> > PS, the end makes sense, that if there is a $ARGV[0] being passed to use 
> > it, and if not use the "hello world", but what is that defined($ARGV[0]) 
> > all about?????
> > 
> > If anyone knows where an eg of this is, I would really appreciate.
> > 
> Off the top of my head, the ?: operator?
> which eq 
> if(defined($ARGV[0]))
> {
>       $text = $ARGV[0];
> }
> else
> {
>       $text = "Hello world";
> }

>From `perlop':

  Conditional Operator

    Ternary "?:" is the conditional operator, just as in C. It works
    much like an if-then-else. ...

--David


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to