#!/usr/bin/perl -l use strict; use warnings; sub is { bless \shift, '_ghgh'; } sub _ghgh::in { my $x=${ shift, }; $x eq $_ and return 1 for @_; 0; } print is($_)->in(qw/foo bar baz/) ? 'yes' : 'no' for qw/bar fred/; __END__
In reply to Re: boolean IN(); function in perl like
by blazar
in thread boolean IN(); function in perl like
by Frank John
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |