Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Subtracting Stringified Negative Numbers

by agianni (Hermit)
on Jun 22, 2007 at 04:28 UTC ( #622710=note: print w/replies, xml ) Need Help??


in reply to Subtracting Stringified Negative Numbers

Hmmm... when I tried your code it worked just fine and $dif had the value of 106. What version of Perl are you using? What is the actual context of the code?

Not knowing the context, you might consider doing something like:

my $dif = ( int $n1 ) - ( int $n2 );
to force the strings into integers. But I'm thinking there's something else going on. Additional context would definitely help.

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622710]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2018-07-17 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (363 votes). Check out past polls.

    Notices?