in reply to Is it a list or a flip-flop?
#!/usr/bin/perl use strict; use warnings; my $n = 9; my @list = (1..$n); my $list = @list; print @list, "\n"; print $list, "\n";
#!/usr/bin/perl use strict; use warnings; $. = 1; my $n = 9; my $list = (1..$n);
If either operand of scalar ".." is a constant expression, that operand is considered true if it is equal (== ) to the current input line number (the $. variable).
... even with $. undefined.#!/usr/bin/perl use strict; use warnings; my $m = 1; my $n = 9; my $list = ($m..$n);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is it a list or a flip-flop?
by GrandFather (Saint) on Aug 18, 2005 at 19:18 UTC | |
by Transient (Hermit) on Aug 18, 2005 at 19:21 UTC |