Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Can't use string as an ARRAY ref

by GotToBTru (Prior)
on Aug 21, 2015 at 15:07 UTC ( [id://1139427]=note: print w/replies, xml ) Need Help??


in reply to Can't use string as an ARRAY ref

$princ is an AoA, an array whose elements are array refs. You are passing one of those array refs to add_more, which you store as $data. However, $data->[0] is a scalar, not an array ref, hence the error message.

Dum Spiro Spero

Replies are listed 'Best First'.
Re^2: Can't use string as an ARRAY ref
by Anonymous Monk on Aug 21, 2015 at 15:25 UTC
    I know, I just can't think on how to fix it.

      It looks like you might be trying to construct a table, possibly in HTML. I would suggest looking into the CPAN modules for that purpose. They will dictate your data structure, at least to an extent.

      Otherwise, what do you want the output to look like?

      Dum Spiro Spero
        Its actually PDF.
        use PDF::API2; use PDF::Table;
        The issue is in the "for loop", cause if I just pass something like this out side of the "for loop" it goes wel:

        my $extra_data = $data->{$num}{extra}; unshift @$extra_data,["City", "Street", "ZIP"];
        I even tried passing this:
        add_more( data => $type->[$i], );
        as:
        add_more(data => @{ $type->[$i] }, );

        Course, it didn't work!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1139427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found