in reply to Re: for loops and 'and'
in thread for loops and 'and'
And when I ran it, I got the following warnings and results -use strict; use warnings; use Data::Dumper; # test 1 print for (1..10 or 'a'..'k'); # line 6 print "\n"; # test 2 my @range = 1..10 or 'a'..'k'; # line 10 print for (@range); print "\n"; # test 3 my @r1 = 1..10; my @r2 = 'a'..'k'; @range = @r1 or @r2; # line 17 print for (@range); print "\n";
The warnings and results might give a clue to what is happenning with list/range and the for and or operators?Useless use of range (or flop) in void context at p92.pl line 10. Useless use of private array in void context at p92.pl line 17. Use of uninitialized value in range (or flip) at p92.pl line 6. abcdefghijk 12345678910 12345678910
|
|---|