Perl Quickie

Discussion in 'OT Technology' started by XERQ, Apr 13, 2008.

  1. XERQ

    XERQ Guest

    So I have a method that I'm getting a value from, how do I assign it to a variable:

    the method with parameters:
    adj_int_units(${$hashRef->{$_}}[$index]);

    I tried doing this but it doesn't get the returned value:
    my $adjustedUnits = adj_int_units(${$hashRef->{$_}}[$index]);

    $adjustedUnits becomes ' ', so when it gets executed I get this error:
    Argument " " isn't numeric in numeric gt (>) at ./pflogsumm line 1111, <> line 7603457.


    How can I make it execute THEN give the value to $adjustedUnits??
     
    Last edited by a moderator: Apr 13, 2008
  2. XERQ

    XERQ Guest

    Anyone have an idea?
     
  3. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    whats your adj_int_units look like buddy?
     
  4. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    And we wonder why people shit on perl. Pop out and name your variables, if you want people to read your code.

    We need to see your function. It looks like the abomination: ${$hashRef->{$_}}[$index] is " " and you can't do a numeric comparison on that value, as it is not a number.
     

Share This Page