in reply to Perl Syntax
0+ is a numeric operation; add 0 to $new. And $new contains an array reference, which stringifies as something like ARRAY(0x1427fc8), and numerifies as something like 28299208. So 0+ forces a numeric representation of the array reference held in $new.
Far more than you ever wanted to know (but you did ask, so...) about stringification and numerification is detailed in perldata. Perl's "duck typing" means that if you treat something like a string, Perl will do what it can to make a string of it. If you treat something as a number, Perl will do what it can to make a number of it.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Syntax
by kbfiles (Initiate) on Oct 30, 2013 at 22:01 UTC | |
by davido (Cardinal) on Oct 31, 2013 at 00:24 UTC | |
by NetWallah (Canon) on Oct 30, 2013 at 23:22 UTC |