Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Script behaving differently on Linux vs windows

by Corion (Patriarch)
on May 16, 2016 at 17:50 UTC ( [id://1163153]=note: print w/replies, xml ) Need Help??


in reply to Script behaving differently on Linux vs windows

my $configFile="/home/testuser/perl/config.properties"; ... chomp $splitLine[1];

The file contains Windows newlines (\r\n), but you only remove the trailing newline \n, leaving the \r at the end.

Instead of chomp, remove all whitespace from the end of each line:

$splitLine[1] =~ s!\s*$!!;

Replies are listed 'Best First'.
Re^2: Script behaving differently on Linux vs windows
by venu2016 (Initiate) on May 16, 2016 at 19:20 UTC
    thank you...that fixed the issue..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found