PERL borked on Mac OSX 10.6

dfnkt

Senior member
May 3, 2006
434
0
76
So I have been dealing a lot lately with using putty on PC to ssh into all the mac computers in my environment and taking a look at some installed versions of software, trivial file deletion, and some uninstalling of some utilities.

Fast forward to today and I decide that I am going to write some simple perl scripts to handle these tasks and release them out for the community that works with the same systems management tool that we use. I fire up terminal on my MBP and type in 'perl -v' which tells me it is 5.10.

I decide to go ahead and test out perl to make sure it's functional so I write a simple test script of:

#!/usr/bin/perl

print "Hello\n";

I then CD to the directory where that script was housed and do 'perl test.pl' and holy torrent of errors. I've pasted them below as an example.

(Missing semicolon on previous line?)
Backslash found where operator expected at myfirstscript.pl line 7, near "f0\"
Backslash found where operator expected at myfirstscript.pl line 7, near "fs24 \"
(Do you need to predeclare fs24?)
syntax error at myfirstscript.pl line 1, near "rtf1\"
syntax error at myfirstscript.pl line 3, near "red255\"
syntax error at myfirstscript.pl line 4, near "margl1440\"
Execution of myfirstscript.pl aborted due to compilation errors.

Keep in mind some of these errors refer to a line 7 when I don't even have a line 7. I found some info online that talks about a 2009-01 software update package that killed perl with certain CPAN modules. I was going to follow the steps outlined (involves reinstalling IO) but make is not installed on this macbook?!??!

Any ideas?
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
Your text editor is inserting garbage into the script (IE font information ect). Get a text editor that doesn't do that.
 

dfnkt

Senior member
May 3, 2006
434
0
76
Your text editor is inserting garbage into the script (IE font information ect). Get a text editor that doesn't do that.

It must be time to give up for the day. I had opened this file a few times in BBEdit and it had all that crap in it, I had just written it off as bbedit being silly. Thanks for the tip i'll fix it up.