Good day, Your help is greatly appreciated. Thanks
For some reason I am not getting the sorted list in my output file. Instead I am getting the following: bc8) HASH(0x100d0d78) HASH(0x100d15e8) HASH(0x100d0f28) HASH(0x100d0c58) HASH(0x100d1168) HASH(0x100d1678) HASH(0x100d21 70) HASH(0x100d0ce8) HASH(0x100b4450) HASH(0x100d2200) HASH(0x100b3eb0) HASH(0x100d1438) HASH(0x100d0e98) HASH(0x100d205 0) HASH(0x100b47b0) HASH(0x100d10d8) HASH(0x100b4720) HASH(0x100d1288) HASH(0x100d1048) HASH(0x100d0e08) HASH(0x100b42a0 ) HASH(0x100b4690) HASH(0x100d13a8) HASH(0x100d1318) HASH(0x100b4180) HASH(0x100b4210) HASH(0x100d1558) HASH(0x100b4060) HASH(0x100b4600) HASH(0x100b3d90) HASH(0x100d0b38) HASH(0x100d0fb8) HASH(0x100b43c0) HASH(0x100b3e20) HASH(0x100b40f0) HASH(0x100d20e0) HASH(0x100d0a18) HASH(0x100d14c8) HASH(0x100b4330): #!/usr/bin/perl use warnings; use strict; my $filepath = "test.txt"; my $outfile = "output.txt"; open (OUTFILE, ">> $outfile") || die "ERROR: opening $filepath\n"; my @array = (); #sub num {$a <=> $b;} while (<>) { chomp; if (/;/) { my @data = split /;/; my($cell,$sect,$carr,$RTD) = ($data[31],$data[32],$data[38],$data[261]); push @array, { cell => $cell, sect => $sect, carr => $carr, RTD => $RTD, }; } } my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] || $a->[3] <=> $b->[3] } map { [ $_, $_->{cell}, $_->{sect}, $_->{carr} ]} @array; print OUTFILE "@sorted:\n"; close OUTFILE; #RTD 1 unit = 4 chips RUM Field 16 0 - 2^16 - 1 milliseconds -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/