Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Simplify parsing a file

by saintly (Scribe)
on Apr 02, 2007 at 18:24 UTC ( [id://607891]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $in_fname (@ARGV) {
      ...
    }
    
  2. or download this
      $input_txt =~ s/\<script.*?\<\/script\>//igs; # remove code
      $input_txt =~ s/\<.*?\>//gs; # remove html tags
      $input_txt =~ s/\&nbsp;/ /gs; # &nbsp -> space
      $input_txt =~ s/\s{2,}/ /gs; # Remove extra spaces
      print $input_txt;
    
  3. or download this
      <a href="" onClick="alert('&lt; foo! &gt;');">
      not:
      <a href="" onClick="alert('< foo! >');"> Invalid HTML!
    
  4. or download this
      while( $input_txt =~ s/\<.*?\>//gs ) {};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found