in reply to Re: Create a new operator, get LHS
in thread Create a new operator, get LHS
> $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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Create a new operator, get LHS (lexical method)
by shmem (Chancellor) on Aug 26, 2015 at 17:36 UTC | |
by LanX (Saint) on Aug 26, 2015 at 22:38 UTC |