http://www.perlmonks.org?node_id=175812


in reply to Re: Schwartzian Transform and memory allocation.
in thread Schwartzian Transform and memory allocation.

Why split once for the Schwartzian Transform then again for the output?
open FILE, "<$data_file"; my @file_data = sort { $a->[$variable-1] cmp $b->[$variable-1] }, map [ split(/\|/) ], <FILE>; close FILE; print qq(<TABLE BORDER="1">); for my $row (@file_data){ print ( qq(<TR>), map(qq(<TD>$_</TD>), @$row), qq(</TR>) ); } print qq(</TABLE>);
____________
Makeshifts last the longest.