Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Subtracting Stringified Negative Numbers

by monkfan (Curate)
on Jun 22, 2007 at 04:07 UTC ( #622704=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $n1 = '-933';
    my $n2 = '-1039';
    
    my $dif = $n1 - $n2;
    
  2. or download this
    $VAR1 = '-933';
    $VAR1 = '-1039';
    
  3. or download this
    Argument "^\-933" isn't numeric in subtraction (-) at mycode.pl line 1
    +15.
    Argument "^\-1039" isn't numeric in subtraction (-) at mycode.pl line 
    +115.
    
  4. or download this
    my $some_string = "0,-933";
    my ($id1,$n1) = split(",",$some_string);
    
  5. or download this
    This is perl, v5.8.5 built for i386-linux-thread-multi
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://622704]
Approved by naikonta
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-10-22 16:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (273 votes). Check out past polls.

    Notices?