On Mon, Apr 23, 2001 at 03:23:06PM -0400, David Gilden wrote:

> What is $|++ for?

perldoc perlvar

It sets the output to be unbuffered.  Personally I'd use $| = 1 just to
be explicit, and in case some joker had previously set it to -1 :-)

> I could not seem to include the sub chekPrice in my if statement 
> 
> $x = &checkPrice($in{'price'});
> if ( ($in{'name'} eq "") or
>      ($in{'type'} eq "") or
>      ($in{'price'} eq "") or 
>      $x)
> 
>     {  .....
>     
>     
>   ###  won't pass syntax validation!  
>    if ( ($in{'name'} eq "") or
>      ($in{'type'} eq "") or
>      ($in{'price'} eq "") or 
>      &checkPrice($in{'price'})
>      )
> 
>     { ......

Hmmm.  Looks OK.  You'll have to be a bit more explicit unless someone
else can see the problem.

> Are there any issues with using 
>  if (!length $in{price}) ....
> as opposed to:
> if ($in{price} eq "") ...
> 
> I am not sure about !length, 
> I mean it is not a $length, so it is not scalar is it some special variable?  

perldoc -f length

I suppose it's just a preference of mine.  I don't like testing for
specifics if I can test for generalities.  I don't think you could have
a zero length string that wasn't "" though ....

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to