CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
"?" added at the end of dir on Linux Server


New User

Mar 2, 2015, 6:43 AM

Post #1 of 2 (3070 views)
"?" added at the end of dir on Linux Server Can't Post

Hi all,

When I tried to run the attached script on Linux server "?" mark is added at the end of dir.

But If I run the same script on the Windows it works fine.

Can any one help what should be the issue?


Attachments: Filter.txt (30 B) (2.67 KB)

Veteran / Moderator

Mar 2, 2015, 10:02 AM

Post #2 of 2 (3067 views)
Re: [sumit2606] "?" added at the end of dir on Linux Server [In reply to] Can't Post

I strongly suspect that your input file has been prepared under Windows ans is used under Linux.

Windows lines end with "\r\n" and Unix lines end with "\n" only.

If your was prepared under Windows and is processed in Perl under Unix, the chomp function will only remove "\n", thus leaving the "\r".

Try to replace the chomp with a regular expression such as:



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives