Thanks much for your detail explanation.
What if I'm doing a fetch (array refs) within a while
loop and want to assign them to a maxtrix each loop?
before (in my another large clunky program i have
written) I simply fetch and print in the same loop.
Now that I am incorporating your code help for
> also the @$line is confusing to me since I thought @ implied
> a whole array thus meaning an array reference so I cant seem
> to explain how @$ works.
It's a dereference. In other words, if $line is a reference to an array,
then @$line retrieves the original array. You can also write it @{$li
Markham, Richard wrote:
> this explained just about everything and was 10 times less confusing than my
> own broken code.
> where I really get confused in Perl is different situations will return
> ARRAY reference and
> others will return the element.
>
> as an example (printf is obviously better
this explained just about everything and was 10 times less confusing than my
own broken code.
where I really get confused in Perl is different situations will return
ARRAY reference and
others will return the element.
as an example (printf is obviously better), if i were to do a
print @$line . "
use strict;
use warnings;
my @newarray;
my ($xnumvar,$xvar,$ynumvar,$yvar,@maxlength);
my @newmatrix=(["123.45","JOHN DOE","Coal Miner"],
["12.45","MR. PEANUT","peanut"],
["4.1","Bill Clinton","unknown"]);
# iterate through each element and gather maximum character length for