in reply to Is list member
Note tossing $test and $_ into strings solves all sorts of internal numerical <=> issues. I think it always comes up with the same string that you'd get as if you print'ed it. However, if you're looking for numerical equivalency (ie, you're passing in things like "0e0" and expecting it to match to it's equivalent), then you're probably out of luck. This is for ultra simple data sets. Just another way of thinking about it...#!/usr/bin/perl -w use strict; my @stuff = ("foo", 1, "3", "5", 8, "jerk", "bummer"); my $test = "1"; foreach(@stuff){ print "Found!\n" if ("$test" eq "$_"); }
|
|---|