Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Extracting full digits from a range

by smw6181 (Initiate)
on Aug 06, 2012 at 14:23 UTC ( #985735=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Extracting full digits from a range
in thread Extracting full digits from a range

Well it's good to hear my coding is right.....and I tried removing all whitespace, still produces a blank output. Same with putting a \n after @range. I'm completely confused now though. printing out $line also produces '', so it seems that something's going wrong with parsing the original infile. Guess that's where I need to look. Thanks for confirming my basic code is right folks.

Found it. It's definitely whitespace at the end of the line in the text file. Not sure why $line =~ s/\G //g; didn't work, but I'll figure it out. Thanks for pointing me in the right direction folks!

Last update: $line =~ s/^\s+|\s+$//g; is the regex I was looking for. That does the trick. Thank you all again, I really appreciate the help!


Comment on Re^4: Extracting full digits from a range

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-09-23 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls