Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @one_to_six = 1..6;
    print "Counting up: " . @one_to_six . "\n";  # scalar context (no. of 
    +elts)
    print "Counting up: " , @one_to_six , "\n";  # list context
    
  2. or download this
    Use of uninitialized value $. in range (or flip) at cnt.pl line 4.
    Counting up:
    ...
    Counting up: 1 2 3 4 5 6
    Counting up: 6
    Counting up: 123456