[plug] [Perl] sorting arrays based on scalar value - Golf any one?

Anthony J. Breeds-Taurima tony at cantech.net.au
Mon Nov 18 16:35:30 WST 2002


On Mon, 18 Nov 2002, Carl Gherardi wrote:

> How about:
> ./program.pl < infile

When you use the -p commandline switch perl wrapps your code in
while (<>) {
} continue {
	print;
}


So what you en up with is
while (<>) {
	open...
        print ...<>
} continue {
	print;
}

What's happening is the <> operator on the sort line, sess EOF and stops
BUT the <> in the while loop never sess it.  AFAI concerend the file is open
just slow, so it blocks forever.


Yours Tony

   Jan 22-25 2003           Linux.Conf.AU            http://linux.conf.au/
		  The Australian Linux Technical Conference!



More information about the plug mailing list