physi has asked for the wisdom of the Perl Monks concerning the following question:
I've got a in my eyes strange behavior:
This small line works on the commandline:
but within a script I have to write:perl -e '@a=(a..z,A..Z); print $a[rand @a]'
#!/usr/bin/perl use strict; use warnings; my @a = ('a'..'z','A'..'Z'); print $a[rand @a];
Can anyone explain it, why I have to quote the letters in the script, while I haven't on the commandline ?
Cheers
physi
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: commandline and script behavior differs
by fruiture (Curate) on Feb 10, 2003 at 11:30 UTC | |
by physi (Friar) on Feb 10, 2003 at 11:37 UTC | |
|
Re: commandline and script behavior differs
by broquaint (Abbot) on Feb 10, 2003 at 11:39 UTC |