Re: reversable foreach ()?

2000-09-12 Thread Bart Lateur

On Tue, 12 Sep 2000 18:46:04 GMT, Ed Mills wrote:

>So what about
>
>   (do something) foreach (some list);
>
>i.e.
>
>   print foreach (@l);

You really should try out one of the more recent Perls.

http://www.perl.com/CPAN-local/doc/manual/html/pod/perldelta.html#C_EXPR_foreach_EXPR_is_supporte

-- 
Bart.



Re: reversable foreach ()?

2000-09-12 Thread John Porter

Ed Mills wrote:
> 
> So what about
> 
>(do something) foreach (some list);
> 
> Just a thought..

No, it's not just a thought.  

% perl56 -e 'print "Item $_\n" for qw( foo bar quux )'
Item foo
Item bar
Item quux

But you're thinking along the right lines!

-- 
John Porter




reversable foreach ()?

2000-09-12 Thread Ed Mills

I really like

  (do something) if (something is TRUE);

as opposed to

  if (something is TRUE) {do something}

Just personal taste I guess, but to me the former is a nice Perlism.

So what about

   (do something) foreach (some list);

i.e.

   print foreach (@l);

as opposed to

   foreach (@l) {print}


Just a thought..

-E

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.