in reply to Re: Re: Re: Is there an InString-like function?
in thread Is there an InString-like function?

=pod /^[adsf0asd]/ will match if $_ contains a or d or f or 0 or s . It matches character classes, not words. =cut my @matchthis = qw(abe age rod); my $beginswiththis = join '|', @matchthis; print "looking for strings that begin with '$beginswiththis'\n"; @_ = qw( abey AbEy abeoy agg aggb agge agee rodo rodd rddo); print "looking through:", join(' ', map { "'".$_."'" } @_),"\n"; for (@_) { print "Found one: ",$_,"\n" if(/^($beginswiththis)/); }
  • Comment on Re: Re: Re: Re: Is there an InString-like function? (keep this one)
  • Download Code