List Info

Thread: Re: Net::Cmd 2.24: ?error in response()




Re: Net::Cmd 2.24: ?error in response()
user name
2007-08-29 09:57:50
On Wed, August 29, 2007 7:01 am, hvcrypt.org wrote:
> hvcrypt.org wrote:
> :Just noticed an unusual diagnostic in my server logs:
> :  Use of uninitialized value in substr at
> /opt/perl-5.8.1/lib/5.8.1/Net/Cmd.pm line 354.
> :
> :Net::Cmd->response() does (in brief):
> :  while (1)
> :    stuff that gets $str
> :    ($code,$more) = $cmd->parse_response($str);
> :    unless (defined $code) {
> :      $cmd->ungetline($str);
> :      last;
> :    }
> :    some more stuff
> :  }
> :  return substr($code, 0, 1);
> :
> :Shouldn't the C<last> in that unless block be
rather a C<return
> CMD_ERROR>?
> :Else it will always try to C<return substr(undef,
0, 1)>, which doesn't
> look
> :right.
>
> I just noticed this old message (from 22nd July 2006)
in my pending
> folder.
> I haven't seen a response, and bleadperl still looks
exactly as described
> here.
>
> Anybody able to venture an opinion on it?

I would need to see what is being passed to parse_response.
Can you
recreate this with Debug => 1 passed into ->new and
send me what was on
STDERR

Graham.



Re: Net::Cmd 2.24: ?error in response()
user name
2007-08-30 07:06:05
"Graham Barr" <gbarrpobox.com> wrote:
:On Wed, August 29, 2007 7:01 am, hvcrypt.org wrote:
:> hvcrypt.org wrote:
:> :Just noticed an unusual diagnostic in my server
logs:
:> :  Use of uninitialized value in substr at
:> /opt/perl-5.8.1/lib/5.8.1/Net/Cmd.pm line 354.
:> :
:> :Net::Cmd->response() does (in brief):
:> :  while (1)
:> :    stuff that gets $str
:> :    ($code,$more) = $cmd->parse_response($str);
:> :    unless (defined $code) {
:> :      $cmd->ungetline($str);
:> :      last;
:> :    }
:> :    some more stuff
:> :  }
:> :  return substr($code, 0, 1);
:> :
:> :Shouldn't the C<last> in that unless block be
rather a C<return
:> CMD_ERROR>?
:> :Else it will always try to C<return substr(undef,
0, 1)>, which doesn't
:> look
:> :right.
:>
:> I just noticed this old message (from 22nd July 2006)
in my pending
:> folder.
:> I haven't seen a response, and bleadperl still looks
exactly as described
:> here.
:>
:> Anybody able to venture an opinion on it?
:
:I would need to see what is being passed to parse_response.
Can you
:recreate this with Debug => 1 passed into ->new and
send me what was on
:STDERR

No sorry, it was a one-off diagnostic in my logs in July
2006.

But on finding C<$code> is undef, the C<last>
drops it directly into
C<return substr($code, 0, 1);>, so do you not agree
that it must be
wrong as stands?

Hugo

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )