On Fri, 24 Jan 2014 06:26:58 -0600
"Martin G. McCormick" <mar...@server1.shellworld.net> wrote:

>       I have read perl instructional documentation that warns
> about using system("commands") and shell commands so my question
> is, what is wrong with that?
> 
>       The only thing I can see is that it is not portable and
> that since the commands are outside of perl, the results might
> change one day. It probably also takes extra CPU cycles but
> unless one is doing DSP, who's counting?

There Is More Than One Way To Do It (TIMTOWTDI). There is nothing wrong
provided you accept its limitations. But why not?

    @files = sort { (stat($a))[9] <=> (stat($b))[9]
                    || lc($a) cmp lc($b)
                    || $a cmp $b
                  } glob( 'filenames*' );


-- 
Don't stop where the ink does.
        Shawn

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to