Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: find acronyms in a text

by rovf (Priest)
on Jul 23, 2009 at 10:16 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found