in reply to Re: Archive::Zip: Passing members to subroutines
in thread Archive::Zip: Passing members to subroutines

Hello Corion: Thank you so much for your prompt reply. You were of course 100% correct! That was the offending line. In the end I opted to keep everything in one array:
push @appendArr,([$idArr[$c],$command,$srcArr[$c],$destArr[$c],$cmdArg +s]);
and access it thus:
foreach $fAppend (@appendArr) { print "is an array\n" if (ref($fAppend) eq "ARRAY"); print "fAppend[0]=@$fAppend[0]\n"; print "fAppend[2]=".(@$fAppend[2])->fileName()."\n"; print "fAppend[2]=".(@$fAppend[2])->contents()."\n"; ...
If you have time and inclination, could you expound on what is going on with the referencing and typing?

I presume the original ZIP "member" object is a hash reference.

The array was originally passed through as a scalar \@ then plopped into a string.

And as you pointed out, it lost its array-ness and hash-ness when I pushed it in a string "...,$member,..." into @appendArr. How does that happen?

If you have any reading recommendations on these intricacies, I'd be pleased to receive them!

Thanks again for your help!

We are up and running.

Rgds

Steve

Replies are listed 'Best First'.
Re^3: Archive::Zip: Passing members to subroutines
by Corion (Patriarch) on Feb 01, 2018 at 15:38 UTC

    Converting something to a string is mostly a one-way road.

    You can only interchangeably use a string as a number or a string. There is no (sane) way to convert a string back to a reference in Perl.

    The process of converting something to a string is called "stringification" in Perl. I'm not sure what you mean by "how does that happen" - I could explain to you how Perl constructs a string in which you use variables, or I could guess about how you wrote code that did that, but I'm not sure that any of these would give you the information you really seek.