On Thu, Dec 12, 2002 at 10:40:20PM -0000, Smylers wrote:
> What if the thing being C<sort>ed (or whatever) is not an array but a
> list?
> 
>   @out = sort $scalar, @array, result_of_calling_function($param);
> 
> Would the list have to be stored in an array before it could be sorted?

I would hope Perl would be smart enough to allow this:

  @out = ($scalar, @array, result_of_calling_function($param)).sort

which Ruby does:

  $ ruby -wle 'out = ["foo", "bar"].sort;  print out.join " "' 
  bar foo

but as I said, I find the Lisp flow style worth keeping.

  @out = join "\n", map {...} grep {...} sort {...} @foo


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Pancakes is the better part of valor.
        http://www.goats.com/archive/971202.html

Reply via email to