> $var->in(@list)
> ...
> Not very tingly. Sorry about that.
so why not
$var->$in(@list) ??
use warnings; use strict; my $in = sub { my $x=shift; return scalar grep {$x eq $_} @_ }; if ( 5 ->$in (0..9) ) { print "bin ich drin oder was?"; } if ( 'x' ->$in (0..9) ) { print "mennoooooo... :("; }
(diabolic laughter)/usr/bin/perl -w /tmp/in.pl bin ich drin oder was? Compilation finished at Wed Aug 26 15:42:03
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^2: Create a new operator, get LHS (lexical method)
by LanX
in thread Create a new operator, get LHS
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |