At 11:26 PM -0400 9/30/10, Mark wrote:
 On 9/30/10 10:59 PM, Chas. Owens wrote:
The only thing I can do to reproduce what you are seeing is to place a
control-d (aka ASCII character 4) in the file.  Try saying this

echo 'print "hello\n"' | perl -

If that works, then try this:

perl -nle 'print for grep { $_<  31 or $_>  126 } map ord, split //' t.pl

It will tell use what control characters may be lurking in that file of yours.


I use the 'od -c' command to do that.


AH HA! When you mentioned control characters, I wondered if my text editor -- BBEdit -- was causing the problem. It must have been, because when I copy & pasted the code from BBEdit into Emacs, suddenly the script ran perfectly in iTerm. Problem apparently solved. Thanks, everyone!

Use the Edit -> Document Options menu item in BBEdit to set your line endings to "Unix (LF)".

--
Jim Gibson
j...@gibson.org

--
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