On Thursday 18 April 2002 1:52 pm, Felix Geerinckx wrote:
> on Thu, 18 Apr 2002 13:26:21 GMT, [EMAIL PROTECTED] (Gary
>
> Stainburn) wrote:
> > [..]
> > while this one, using $_ instead of $line fails stating once per line
> > before the break that I'm using an uninitialised variable on the
> > 'while' line
> >
> > __BEGIN__
> > print while (shift @HTML)!~/^<!--break/; # copy until break
>
> Your assume that '$_' is assigned to the shifted '@HTML' array-element
> here, but it isn't. You should use
>
>       print while ($_ = shift @HTML) !~ etc...
>
> You get the uninitialized value warning because you use 'print' without
> parameters, so it defaults to '$_' which isn't initialized yet.

Thanks for that Felix.

While your answer makes sense, why doesn't shift use the $_ as I obviously 
expected?

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

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

Reply via email to