Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: 0+$1 for numeric, why?

by chipmunk (Parson)
on Dec 02, 2000 at 00:03 UTC ( [id://44449]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://44449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found