in reply to Re: what is @$varname in perl
in thread what is @$varname in perl
i read up on reference and understand a scalar is assigned as reference :
my @array = (1, 2, 3, 'four'); my $reference = \@array;
i modified using your suggestion as below
foreach $line (@lines){ chomp $line; $count++; next unless $count; my @row = (); @row = split(/,/, $line ); push @sheet2 , \@row; } foreach my $row ( sort {$a->[0] cmp $b->[0] || $a->[1] cmp $b- +>[1]} @sheet2 ) #sorting based on date ,then stockcode { chomp $row; print hanw join (',', @$row ),"\n"; }
then why assign @sheet2 as reference
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: what is @$varname in perl
by 2teez (Vicar) on Jul 03, 2014 at 15:35 UTC | |
|
Re^3: what is @$varname in perl
by perlfan (Parson) on Jul 04, 2014 at 03:18 UTC |