Nigel Peck - MIS Web Design wrote:

In Perl can I say:

if this = that or that or that

instead of saying:

if this = that or this = that or this = that

Not yet, but good point. In Perl 6 you'll be able to write:


if $x == 1|2|7

but now there's only:

if $x == 1 or $x == 2 or $x == 7

Maybe you could use a regexp instead, like:

if $x =~ /^(1|2|7)$/

or, in this case:

if $x =~ /^[127]$/

I almost forgot about Quantum::Superpositions module:

if $x == any(1, 2, 7)

See: http://search.cpan.org/author/LEMBARK/Quantum-Superpositions-2.02/lib/Quantum/Superpositions.pm

How do your "that" values look like anyway?

--
ZSDC Perl and Systems Security Consulting


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to