I apologize if this appears twice. Since I sent it once and forgot to
abandon HTML in favor of plain text, I'm sending  it again.

This works:


$ perl -e ' $s = <STDIN> ; print "$s\n"; '



I don't like it because <STDIN> is hard coded. What if I want to
conditionally read from a file?


Here is my attempt to store it in a variable but it does not work with
ActiveState Perl:


$ perl -e ' local X;  X = <STDIN> ; $s = X ; print "$s\n"; '
Can't modify constant item in local at -e line 1, near "X;"
Execution of -e aborted due to compilation errors.



What is the syntax? Is <STDIN> a file handle in perl?
thanks,
siegfried


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to