perhaps such a statement would suit:

$var = defined $var ? $var : 10;


On Mon, 2003-02-03 at 09:37, Rob Dixon wrote:
> "John W. Krahn" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > [EMAIL PROTECTED] wrote:
> > >
> > > $var|=10; # like that if u want to set the variable to a default
> value--
> > >           # if the $var is not defined it assigns a value of 10  to
> it.
> >
> > You need to use the ||= operator not the |= operator for that.
> 
> ... and it will change $var to ten if it is already set to zero.
> 
> Rob
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to