Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985735]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-05-20 12:47 GMT
Find Nodes?
    Voting Booth?