Skeeve has asked for the wisdom of the Perl Monks concerning the following question:
Hi! I just noticed that this, entered on the commandline (bash / OS X 10.5) dos not work:
perl -e 'print <DATA>; __DATA__ line 1 line 2 '
Whereas this similar code works:
perl <<'XXX' print <DATA>; __DATA__ line 1 line 2 XXX
Can someone explain why the first version does not work?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: __DATA__ on commandline does not work?
by ikegami (Patriarch) on Apr 10, 2010 at 20:09 UTC | |
|
Re: __DATA__ on commandline does not work?
by The Perlman (Scribe) on Apr 10, 2010 at 19:17 UTC | |
|
Re: __DATA__ on commandline does not work?
by repellent (Priest) on Apr 10, 2010 at 20:11 UTC | |
by cdarke (Prior) on Apr 11, 2010 at 14:24 UTC | |
by Skeeve (Parson) on Apr 11, 2010 at 18:51 UTC | |
|
Re: __DATA__ on commandline does not work?
by afoken (Chancellor) on Apr 10, 2010 at 18:19 UTC | |
|
Re: __DATA__ on commandline does not work?
by pid (Monk) on Apr 12, 2010 at 09:05 UTC |