Help for this page

Select Code to Download


  1. or download this
    print "$_\n" for glob "{0,1}"; # 0 1
    print "$_\n" for glob "{0,1}{0,1}"; # 00 01 10 11
    print "$_\n" for glob "{0,1}{0,1}{0,1}"; # 000 001 010 011 100 101 110
    + 111
    
  2. or download this
    print "AB" x 1; # AB
    print "AB" x 2; # ABAB
    print "AB" x 3; # ABABAB
    
  3. or download this
    use Data::Dumper;
    my %hash = map { $_ => 1 } glob "{0,1}" x 3;
    ...
              '100' => 1,
              '110' => 1
            };