Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: same script, different results

by Dallaylaen (Monk)
on Oct 25, 2013 at 15:07 UTC ( #1059690=note: print w/ replies, xml ) Need Help??


in reply to same script, different results

If you run the script on Unix ($/ = "\n"), but the files are saved on Windows ($/ = "\r\n"), you'll get botched result. Don't trust chomp, use s/\s*$//s instead. Or better yet, use regexp matching and capturing (this is what -T mode and perlsec would suggest):

while (<SYM>) { m/($insert_expected_symbol_format_here)/ or die "Bad input format"; # or maybe just "or next" my $symbol = $1; };


Comment on Re: same script, different results
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2015-07-30 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls