in reply to Is there an andand for Perl like there is in Ruby?

In Perl 6 you can do that with the $object.?method syntax, and that works in Rakudo today:
$ cat test.t class A { method some-method { say "called some-method"; } } my $a = undef; my $b = A.new; for $a, $b -> $obj { $obj.?some-method } $ ./perl6 test.t called some-method

You can also use it to call a method on $_ like this:

for $a, $b { .?some-method }

Replies are listed 'Best First'.
Re^2: Is there an andand for Perl like there is in Ruby?
by frew (Acolyte) on Jan 09, 2009 at 23:03 UTC
    I wish we had perl6 at work :-)
    But yeah, this would be the best case scenario as it's part of the language.