in reply to Array shortcut

By using chr, you can recover a character from its index in the character set. You can therefore use that in combination with Range Operators in order to generate the kind of list you are looking for. For example:
#!/usr/bin/perl use warnings; use strict; my @chars = map chr($_), 32 .. 122; print @chars;

outputs

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz

Replies are listed 'Best First'.
Re^2: Array shortcut
by jettero (Monsignor) on Jul 01, 2009 at 01:26 UTC
    You can actually do some of them without needing chr. my @a = ('a' .. 'z');

    my @a = ('a'..'z', 'A'..'Z', 0..9, qw(! @ # $ % ^ & *), ' '); # maybe?

    Just another way to do it.

    UPDATE: Or you could disable that warning. It is just a warning afterall.

    -Paul

      and avoid a warning by pulling '#' out of qw:
      my @chars = ('a' .. 'z', 'A' .. 'Z', 0 .. 9, '#', ' ', qw(! @ $ % ^ & +*));