> From: frederic fabbro <[EMAIL PROTECTED]>
> Date: Wed, 8 Jan 2003 15:26:58 +0100
>
> Can one see it as a shell redirection/pipe? This may sound funny,
> but is the following ok?
> @b <~ @a ~> @c; # @c = @b = @a;
> (@b <~ @a) ~> @c; # same order i guess
Ummm, whellll... that depends on the semantics of A <~ B when A is not
a function. If it's just assignment, why not just use = ? But
assuming it does assign, yes, that's what it would do.
> so one can also:
> @keep <~ grep /good/ <~ @list ~> grep /bad!/ ~> @throw;
You're playing with my brain, here. That, in theory, would be
equivalent to:
(@keep <~ grep /good/ <~ @list) ~> grep /bad!/ ~> @throw;
@keep = @throw = grep /bad/, @list.grep(/good/)
So, in other words, no.
> is this if valid too?
> @b ~> @a <~ @c; # push @a, @b, @c;
(@b ~> @a) <~ @c;
(@a = @b) = @c
Would end up setting @a to @c.
> or: @b, @c ~> push @a;
> qw/hello world/ ~> print
I think it would be good to allow only one parameter on the left. The
latter is correct (except for qw// is spelled <<>>).
> I guess it modifies $_
> print "$_ \t %stat{$_} \n" <~ grep /^[Aa]/ <~ keys %stat
> print "$_ \t %stat{$_} \n" for grep /^[Aa]/, keys %stat
That is not at all how it works. Print would try to use
grep %stat.keys: /^[Aa]/
As a filehandle.
> Could we get pairs (or more), and also something like a step, for
> example to only take one array elements every two?
In that case you would probably just want to use the versatile C<for>
loop, instead of cluttering syntax to support that.
Luke