Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: find acronyms in a text

by rovf (Priest)
on Jul 23, 2009 at 10:16 UTC ( #782615=note: print w/replies, xml ) Need Help??


in reply to find acronyms in a text

$_ =~ s/\s+//; my @Elements = split /\s/;

You are first removing all white space from the input, and then try to split on white space???? This doesn't make sense to me.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: find acronyms in a text
by davorg (Chancellor) on Jul 23, 2009 at 10:22 UTC
    You are first removing all white space from the input

    I thought that at first too. But he's only removing the first run of whitespace from each record he reads in.

    --

    See the Copyright notice on my home node.

    Perl training courses

      he's only removing the first run of whitespace

      Of course! No g modifier! I did not pay close attention...

      -- 
      Ronald Fischer <ynnor@mm.st>
Re^2: find acronyms in a text
by steph_bow (Pilgrim) on Jul 23, 2009 at 10:23 UTC

    Sorry, you are right and I have updated my programm

    I wanted to remove the new line character at the end of each line

      I wanted to remove the new line character at the end of each line

      See chomp.

      But does a Word document contain anything that Perl would recognise as a newline character? I don't know anything about that file format.

      --

      See the Copyright notice on my home node.

      Perl training courses

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-07-03 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?