I cannot get a Perl script to run
I cannot get a Perl script to run - the compiler will not even accept double quotes
iMac with Retina 5K display, OS X El Capitan (10.11.6)
I cannot get a Perl script to run - the compiler will not even accept double quotes
iMac with Retina 5K display, OS X El Capitan (10.11.6)
Hello Newboy02,
You are going to have to provide a few more details than that. What is this Perl script? What do you mean "the compiler will not even accept double quotes"? There is no compiler with Perl.
Into a *.pl file I write ' open (REC,">>save.txt"); ' and get the response that there is an Unrecognized character \xE2; at the first double quote. Sorry to mention compiler rather that parser.
In fact the parser will not accept double quotes (i.e.. ") in any line and the simple ' print "Hello World"; is objected to also. Oddly the open file line I mention will pass if I use back ticks instead and the file is created. But using a line such as ' print REC"hello"; ' is not accepted whether using double or single quotes and with back ticks it is parsed but nothing gets written to the file.
In short the Perl5 is unusable?
Use a "REAL" text editor. I suggest you try TextWrangler (free download) if you want to use a GUI based text editor
<http://www.barebones.com/products/textwrangler/>
If you do not want to download a very good text editor, then use 'nano' from a terminal session, or vim, or emacs, or if you must use TextEdit, make sure you change the file to a Plain Text File before you save it.
PS. You perl statement works just fine on my Mac, when I put it into a file using
echo 'open (REC,">>save.txt");' >tmp.pl
perl tmp.pl
# no error reported
echo $?
0
# completion status was success
Hello again Newboy02,
it sounds like you are using smart quotes. Follow Bob's advice and that should fix it.
Thanks to both of you. A quick trial shows promise. I really though plain text would have been a default for a 'lite' text editor - ah well!
Nope. TextEdit is a lite Word Processor, that can generate plain text files, if you convert the file via the TextEdit -> Format -> Make Plain Text menu item.
Easier to actually use a full time real text editor, as mentioned above.
I cannot get a Perl script to run