F
Francois Wisard
Hi folks,
I encounter a strange "perl -e" behaviour since I'm running FreeBSD 5.1
(Perl 5.6.1). My one-liners are refused with strange error messages.
Some examples:
bash-2.05b$ perl -e "@a=('a'..'z');print $a[5]"
ARRAY(0x810115c)bash-2.05b$
or
bash-2.05b$ perl -e "$_="abc";s/b/c/g;print $_"
Undefined subroutine &main::ls called at -e line 1.
or even
bash-2.05b$ perl -e "@a=('a'..'z');print $#a"
Bareword found where operator expected at -e line 1, near "0a"
(Missing operator before a?)
syntax error at -e line 1, next token ???
Anyone knows what happens there? I'm tired of writing files when a
one-liner should have sufficed.
TIA
Francois
--
"The main reception foyer was almost empty but Ford
nevertheless weaved his way through it."
- Ford making his way out of Milliways whilst under the
influence of enough alchol to make a rhino sing.
I encounter a strange "perl -e" behaviour since I'm running FreeBSD 5.1
(Perl 5.6.1). My one-liners are refused with strange error messages.
Some examples:
bash-2.05b$ perl -e "@a=('a'..'z');print $a[5]"
ARRAY(0x810115c)bash-2.05b$
or
bash-2.05b$ perl -e "$_="abc";s/b/c/g;print $_"
Undefined subroutine &main::ls called at -e line 1.
or even
bash-2.05b$ perl -e "@a=('a'..'z');print $#a"
Bareword found where operator expected at -e line 1, near "0a"
(Missing operator before a?)
syntax error at -e line 1, next token ???
Anyone knows what happens there? I'm tired of writing files when a
one-liner should have sufficed.
TIA
Francois
--
"The main reception foyer was almost empty but Ford
nevertheless weaved his way through it."
- Ford making his way out of Milliways whilst under the
influence of enough alchol to make a rhino sing.