in reply to 0+$1 for numeric, why?

I think that this warning is not caused by that snippet of code. At line 225, Spreadsheet::Format is trying to multiply the string "_size" by something. Your code snippet only calls set_size($1) when $1 contains a string of digits, so it could not be calling set_size("_size"). (If it were, adding 0 first would just get you a warning for the addition instead.)

Can you edit Spreadsheet/Format.pm and see what is happening at line 225?

Replies are listed 'Best First'.
Re: Re: 0+$1 for numeric, why?
by nop (Hermit) on Dec 02, 2000 at 00:09 UTC
    Here's the line from Format.pm...
    $dyHeight = $self->{_size} * 20;
    But I am not sure I fully understand your comment....?
      If you look back at the warning message you got, you see that it mentions "_size" as the string that is not numeric. Your code snippet will only set $1 to a string of digits, not to the string "_size", right? So, I don't think your code snippet is the problem.

      Regarding the line above: somehow, $self->{_size} is getting set to the string "_size", instead of to a number.

      Can you post more of the code from Spreadsheet/Format.pm? What method is line 225 part of? We'll just have to keep poking around the code until we figure this out.