brentheigold has asked for the wisdom of the Perl Monks concerning the following question:
So I tried using the following:while(<INPUT_FILE>) { my ($symbol,$side,$account,$shares) = split(','); if ($side eq 'BL') { $side = 'BUY'; { push(@$outputRef, "$symbol,$side,$account,$shares") }
When I try to run it, i get an error that says:my (@sorted) = sort{ $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] || $a->[2] cmp $b->[2] } @$outputRef;
"Can't use string "IBM,BUY,K226110,2700" as an ARRAY ref while "strict + refs" in use...
It also doesn't like it when I try to take out the "$" from the @$outputRef.
I need to sort this array by $symbol,$side,$account. Is there any way around this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting a referrenced array and need to sort by specific fields.
by thpfft (Chaplain) on Jul 15, 2002 at 02:39 UTC | |
|
Re: Sorting a referrenced array and need to sort by specific fields.
by lachoy (Parson) on Jul 15, 2002 at 02:32 UTC | |
by Abigail-II (Bishop) on Jul 15, 2002 at 09:17 UTC | |
|
Re: Sorting a referrenced array and need to sort by specific fields.
by shotgunefx (Parson) on Jul 15, 2002 at 07:49 UTC |