in reply to PDF::Table last page

You have neglected to show us sample data tho. scalar(@$data) also would fail if $data was an EMPTY array.

(ref($data) eq 'ARRAY') per http://perldoc.perl.org/functions/ref.html would fail if $data is a blessed object. If the referenced object has been blessed into a package, then that package name is returned instead.

Replies are listed 'Best First'.
Re^2: PDF::Table last page
by PierreForget (Acolyte) on Apr 16, 2018 at 14:21 UTC

    Hi,

    Thanks for the reply.

    I found a simple solution that works for me and it's quite funny.

    Instead of

    main_table($pdf, $some_data); main_table2($pdf, $some_data);

    I put

    main_table($pdf, $some_data); main_table2($pdf, $data2);

    Where the $data2 is an empty variable.

    In theory, it shouldn't work, because the $data2 array is empty. But it does exactly what I need!

    My culprit was probably because I repeated $some_data twice.

    Thanks to everybody