in reply to Bug in Sort::Fields?
in thread Split(), Initial Spaces, & a limit?

Alternatively, you can change the definition of a field.
use strict; use warnings; use Sort::Fields; use Data::Dumper; my @data = ( " 56 1752.eps", " 56 2613.eps", " 56 3469.eps", " 8 INPUT000", " 16 INPUT001", " 16 INPUT002", " 96 MTA.1.ps", " 96 MTA.6.ps", " 80 MTA.7.ps", " 32 head.eps", " 8 labs", " 0 lib", " 8 mkexe.bat", " 112 out", " 0 screenshots", "8720 trace.exe", " 16 trace.pl", " 8 tracehosts", "1160 trace.041409.exe", "1160 trace.orig.exe", ); my @sorted = fieldsort( "".qr/(?<!^)(?<!\s)\s+/, ['1n'], @data); print(Dumper(\@sorted));

Replies are listed 'Best First'.
Re^2: Bug in Sort::Fields?
by cmv (Chaplain) on Jul 20, 2010 at 20:07 UTC
    ikegami++

    Brilliant!

    I believe I understand the theory here. Now I just have to go off and figure out the specifics of what ".qr/(?<!^)(?<!\s)\s+/ is actually doing. I'll get it after a while, and will learn a lot in doing so, no doubt!

    Nicely done!