Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Batch remove "404 Not Found" URLs

by kcott (Archbishop)
on Oct 27, 2017 at 08:42 UTC ( [id://1202130]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MO=Deparse -e 's/s/http://example.com/[404 Not Found]/g'
    Bareword found where operator expected at -e line 1, near "404 Not"
        (Missing operator before Not?)
    syntax error at -e line 1, near "404 Not Found"
    -e had compilation errors.
    
  2. or download this
    $ perl -MO=Deparse -e 's/http://example.com/[404 Not Found]/g'
    Bareword found where operator expected at -e line 1, near "404 Not"
    ...
    Regexp modifiers "/a" and "/l" are mutually exclusive at -e line 1, at
    + end of line
    syntax error at -e line 1, near "404 Not Found"
    -e had compilation errors.
    
  3. or download this
    $ perl -MO=Deparse -e 's{http://example.com}{[404 Not Found]}g'
    s[http://example.com][[404 Not Found]]g;
    -e syntax OK
    
  4. or download this
    #!/usr/bin/env perl -l
    
    ...
    >http://bad3.com/</a>
    <a href="http://bad4.com/">http://bad3.com/</a>
    <a href="http://bad4.com/">http://bad4.com/</a>
    
  5. or download this
    *** ORIGINAL ***
    <h1>HTM1</h1>
    ...
    <span class="bad-url">[404 Not Found]</span>
    <a href="http://bad4.com/">http://bad3.com/</a>
    <span class="bad-url">[404 Not Found]</span>
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found