On Tuesday, June 12, 2012 6:07:07 AM UTC-4, Ben Morrow wrote:
> Quoth Trudge
> > On Jun 11, 7:30�pm, Trudge <tru...@gmail.com> wrote:
> > >
> > > I'm running 'perl -f test.pl', but I did try your suggestion of
> > > 'perl ./test.pl' with identical results.
>
> Do you know what -f does?
>
> > > I'll now try your 2nd one and build it a line at a time.
> > >
> > > btw, I'm using TextWrangler with 'Invisibles' turned on but don't see
> > > anything strange.
> >
> > OK, this is very strange. According to TextWrangler this is my code
> > for perl_test.pl:
> >
> > #!/usr/bin/perl
> > BEGIN
> <snip>
> >
> > *But* according to cat it is really:
> > Prepress-Mac-Pro:scripts prepress$ cat perl_test.pl
> > Prepress-Mac-Pro:scripts prepress$ n";op/northbay_two";
>
> cat is a very bad tool for examining files. At least use less; something
> like od would be better.
>
> It looks to me as though this file has Apple line-endings (\015) rather
> than Unix (\012). This means that as far as perl is concerned your file
> is one very long line, which happens to all be a comment. If you remove
> the #!, it is no longer all a comment, so it works properly.
>
> > And then cmp tells me:
> > Prepress-Mac-Pro:scripts prepress$ cmp perl_test.pl perl_test.1.pl
> > perl_test.pl perl_test.1.pl differ: char 2, line 1
>
> That's interesting: I would have expected something like 'char 16'. Is
> there some other difference? Look at the file with od.
>
> > Ben, it looks like you may have hit on the culprit. Where do I go from
> > here?
>
> Throw away TextWrangler and get a real text editor.
>
> Ben
Heh. Why did I know you would say that
OK, based on yours and Michael's *suggestion* I'll switch to another editor..
btw, TextWrangler was set to Mac line endings. Right on Ben.
Thank you all who responded to this thread. Unless something else weird happens, I would consider this post SOLVED.
--
Amer Neely