home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!bu.edu!bu-pub.bu.edu!jdh
- From: jdh@bu-pub.bu.edu (Jason Heirtzler)
- Newsgroups: comp.lang.perl
- Subject: perl sort bug on Irix?
- Message-ID: <93641@bu.edu>
- Date: 14 Aug 92 00:47:09 GMT
- Sender: news@bu.edu
- Organization: Boston University, Information Technology
- Lines: 53
-
- Perl's sort seems to behave oddly on Irix. What I would like
- to do is an inverse sort based on the length. Is this program
- correct perl (ie. not some implementation dependant thing?)
-
- #!/usr/local/bin/perl -- # -*-Perl-*-
-
- push( @dirs, "usr" );
- push( @dirs, "usr/bin" );
- push( @dirs, "usr/bin/X11" );
- push( @dirs, "usr/lib" );
-
- @crud = sort {length($a) < length($b);} @dirs;
-
- foreach $p ( @crud ) {
- print "$p\n";
- }
-
- It seems to work okay on sun4 SunOs-4.1:
-
- sun% ./sorter
- usr/bin/X11
- usr/bin
- usr/lib
- usr
-
- But fails on the sgi irix 4.0.{1,5}:
-
- sgi% ./sorter
- usr/bin
- usr/lib
- usr/bin/X11
- usr
-
- It behaved the same odd way on patch level 19, but this
- is patch level 35:
-
- % perl -v
-
- This is perl, version 4.0
-
- $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
- Patch level: 35
-
- What is the appropriate way to do the same sort on previous
- releases? At patch level 10 perl bawks at the sort syntax
- (guess it's new syntax.)
-
-
- ----------------------------------------------------------------
- Jason Heirtzler 1-617-353-2780 jdh@bu-pub.bu.edu
- Sci Comp & Vis Information Technology Boston University
-
- "Congratulations. You aren't running Eunice."
-