Ok so after changing my callback sub to this

sub callback { my ( $sftp, $data, $offset, $size ) = @_; use Math::Pari qw( :DEFAULT PARI pari2num ); print 'offset is a: '; print ref $offset; print "\n"; $offset = pari2num($offset); print 'now offset is a: '; print ref $offset; print "\n"; print 'size is a: '; print ref $size; print "\n"; $size = pari2num($size); print 'now size is a: '; print ref $size; print "\n"; my $percent = ($offset/$size) * 100; print "percent=$percent\n"; return; }

Things now start to make sense to me in the output:
offset is a: now offset is a: offset=0 size is a: Math::Pari size is a: size=666974 percent=0 offset is a: now offset is a: offset=8192 size is a: Math::Pari size is a: size=666974 percent=1.22823378422547 offset is a: now offset is a: offset=16384 size is a: Math::Pari size is a: size=666974 percent=2.45646756845094


In reply to Re^3: Strange math issue with Net::SFTP (Pari) by vendion
in thread Strange math issue with Net::SFTP by vendion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.