[prog] list membership in Python and Perl

Katie Bechtold katie at katie-and-rob.org
Wed May 11 01:34:22 EST 2005


In the course of learning Python, I've been introduced to a list
operation that tests for list membership:

>>> 3 in [1, 2, 3]                    # Membership (1 means true)
1

Is there any analogous list operation in Perl?  I haven't been able
to find one, but it seems so useful and basic that I must be missing
something.

-- 
Katie Bechtold         http://katie-and-rob.org/




More information about the Programming mailing list