0

I have a very strange problem..

perl5 Number Sign # not working correctly for comments..

We use emperl, mod_perl, apache, linux..

In some programs if I have a line commented out with a number sign # or just a number sign # by itself on a line, all of the code below that line doesn't work correctly.

There is a sysadmin so I don't have access or control over any of the settings on the server.

This is a new issue everything always worked previously.

So many possible area's that this might be coming from that I'm checking to see if anybody has run across this..

Any suggestions?

MidLifeXis
  • 84
  • 5
Donavon Lerman
  • 343
  • 1
  • 6
  • 19
  • Yes, all things being equal, "#" should very definitely work as a Perl comment. The problem is "something else". SUGGESTIONS: Q: "What changed" since the script last worked? Q: Can you post a snippet before and after one of the "failing comments"? – paulsm4 Mar 18 '13 at 23:47
  • 1
    An additional means to checking what might be happening would be to use **hd** or **od** against the file, and examine the # character itself, and whatever follows it. – tink Mar 18 '13 at 23:52
  • I don't know what happened. I've check rights and permission on the directory and files. Tried renaming the file. IF I create a new blank file, copy all of the logic over to the new file, delete the old file and rename the new file to the old name, the number sign # for comments work again! Strange, very strange. BUT it works! – Donavon Lerman Mar 19 '13 at 17:29

1 Answers1

0

Found the issue:

Was transferring the files from LINUX to Windows to edit them.

If the file was originally created in Windows the end of a line was just a <CR> and for some reason the whole file wasn't running right. It mainly showed up when using the hash symbol for perl comments.

When I made sure the files had end of lines with <CR><LF>, this solved this issue.

MidLifeXis
  • 84
  • 5
Donavon Lerman
  • 343
  • 1
  • 6
  • 19