in reply to Undefined Hash Values and Ternary Operators
(BTW:When you call warn it will generate a warning with the input you give it, so I'm not surprised by the warning you got. If you intended it as a test clause then you should say warn 'err' if( !defined($x) ); or something like that.)#!/usr/bin/perl $x='y'; # comment this line out to test undef case. %p = ( 'a' => 'B', 'z' => defined($x) ? $x : 'n', 'c' => 'D'); print $p{z}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Undefined Hash Values and Ternary Operators
by merlyn (Sage) on May 25, 2000 at 21:13 UTC |