in reply to Re: implicit numeric conversion isn't
in thread implicit numeric conversion isn't

Try it this way (get last update from the hash as well):
  my $hash    = RRDs::info( $datafile );
  my $hStep   = $hash->{'step'};
  my $lupdate = $hash->{'last_update'};
  my $mid     = $lupdate % $hStep;
  print( "$lupdate % $hStep = $mid\n" );
  • Comment on Re^2: implicit numeric conversion isn't

Replies are listed 'Best First'.
Re^3: implicit numeric conversion isn't
by quester (Vicar) on Nov 25, 2006 at 01:51 UTC
    That works here, too. It prints (at the moment) 187.   Devel::Peek shows both $hStep and $lupdate are integers (IOK set):
    SV = IV(0x9f83208) at 0x9ee8b6c
      REFCNT = 1
      FLAGS = (PADBUSY,PADMY,IOK,pIOK)
      IV = 300
    SV = IV(0x9f8320c) at 0x9ee8b78
      REFCNT = 1
      FLAGS = (PADBUSY,PADMY,IOK,pIOK)
      IV = 1163531587
    
      Thank you for trying. I split out my code, and it works as expected. Therefore something is happening earlier in the code, perhaps somewhere before or during the call to the Cricket libraries, which call this code as a referenced subroutine.