dysmai has asked for the wisdom of the Perl Monks concerning the following question:

I am wondering how it is possable to have a not equal to multapal charicters. IE: if ($sum ne "1, 2, 3, 4\n") { print " bla bla bla\n"); } thanks to any help on the topic. -Dysmai

Replies are listed 'Best First'.
Re: multipal NE scalar
by chromatic (Archbishop) on Mar 22, 2001 at 11:56 UTC
Re: multipal NE scalar
by $code or die (Deacon) on Mar 22, 2001 at 17:23 UTC
    Hmm. If you use Quantum::Superpositions you can say something like:
    use Quantum::Superpositions; if ($sum ne any(1, 2, 3, 4)) { ... }
    It's probably not worth using this module as there are other ways of doing what you want to do. But if you want to do more complex things like Composite Superpositions, it might be worthwhile.

    $ perldoc perldoc
Re: multipal NE scalar
by busunsl (Vicar) on Mar 22, 2001 at 11:32 UTC
    Use regular expressions:
    @searcharray = (1, 2, 3, 4, 5); $scalar = 3; if (join(':', ('', @searcharray, '')) !~ /:$scalar:/) { print "not found!\n"; }