FAQ

On Nov 27, 2010, at 7:45 AM, Téssio Fechine wrote:

--
tessio@krauzer:~/Perl/Ex/ch15$ cat smart

use 5.010;

use strict;

use warnings;



my @divisors = (1, 2);

say "It's divisible by 2!" if @divisors ~~ 2;

tessio@krauzer:~/Perl/Ex/ch15$ perl smart

tessio@krauzer:~/Perl/Ex/ch15$

--

Why "@divisors ~~ 2" is not true?
No idea - it seems to work fine for me:
- - -
/Users/chap/private/perl$ cat smart
use 5.010;
use strict;
use warnings;

my @divisors = (1, 2);

say "It's divisible by 2!" if @divisors ~~ 2;
- - -
/Users/chap/private/perl$ perl smart
It's divisible by 2!

/Users/chap/private/perl$ perl -v

This is perl, v5.10.0 built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 10 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedNov 26, '10 at 7:10p
activeNov 27, '10 at 11:55p
posts10
users4
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase