That produces this error:#!C:/perl/bin/perl.exe use strict; use warnings; my @tmp_oid = (); while(<DATA>) { chomp; my $last_oid = $_; if ($#tmp_oid < 2) { push @tmp_oid, $last_oid; } else { my $first_oid = shift @tmp_oid; if ( (pack("C*", split('\.', $first_oid)) cmp pack("C*", split +('\.', $last_oid)) ) > 0 ) { print "Sort needed\n"; } push @tmp_oid, $last_oid; } } __DATA__ 1.3.6.1.2.1.7.5.1.1.0.0.0.0.1020 1.3.6.1.2.1.7.5.1.1.0.0.0.0.1021 1.3.6.1.2.1.7.5.1.1.0.0.0.0.1022 1.3.6.1.2.1.7.5.1.1.0.0.0.0.1023 1.3.6.1.2.1.7.5.1.1.0.0.0.0.701
My method seems to work correctly determining that a sort is required but why am I seeing this error? If I shorten the OIDs I don't see the error ???Character in 'C' format wrapped in pack at sort.pl line 16, <DATA> lin +e 4. Character in 'C' format wrapped in pack at sort.pl line 16, <DATA> lin +e 4. Character in 'C' format wrapped in pack at sort.pl line 16, <DATA> lin +e 5. Character in 'C' format wrapped in pack at sort.pl line 16, <DATA> lin +e 5. Sort needed
2006-01-18 Retitled by g0n, as per Monastery guidelines
Original title: 'Sorting Question'
In reply to pack() format error. by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |