title: How can remove HTML “<a href=” tags using perl
body: <p>How can I remove the links of an HTML file?</p>
  
  <p>I want remove the links:</p>
  
  <p><li>Typography</li>
            <li>Shortcodes</li>
            <li>Tables</li>
            <li>FAQ</li></p>
  
  <p>I wan't remove the links:</p>
  
  <pre><code>&lt;ul class="dropdown-menu"&gt;
  
        &lt;li&gt;&lt;a href="index_fixed.html"&gt;Home / Fixed&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="index_with_blog.html"&gt;Home + Blog&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="portfolio.html"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="blog.html"&gt;Blog &amp; News&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  
    &lt;li&gt;&lt;a href="left_sidebar.html"&gt;left sidebar&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="right_sidebar.html"&gt;right sidebar&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="full_width.html"&gt;full page&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="contact.html"&gt;contact us&lt;/a&gt;&lt;/li&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>This is my code, but it is not working:</p>
  
  <pre><code>#!/usr/bin/perl
  ########################################## Carrega Modulos
  
  use LWP::UserAgent;
  use LWP::Simple;
  
   $ua = new LWP::UserAgent;
   $ua-&gt;agent('Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.8.1.12) Gecko/20080301 Firefox/2.0.0.12');
  
   my $pedido1 = new HTTP::Request GET =&gt;"http://localhost/site1/index.html";
   my $resposta1 = $ua-&gt;request($pedido1) or die "Error\n"; 
   my $res1 = $resposta1-&gt;content;
   open (OUT, "&gt;&gt;hit.txt"); print OUT "$res1\n"; close(OUT); $cont=$cont+1;
  
   $res1 =~ s/"&lt;li&gt;&lt;a href=\"typography.html\"&gt;Typography&lt;\/a&gt;&lt;\/li&gt;"/""/g;
   $res1 =~ s/"&lt;li&gt;&lt;a href=\"shortcodes.html\"&gt;Shortcodes&lt;\/a&gt;&lt;\/li&gt;"/""/g;
   $res1 =~ s/"&lt;li&gt;&lt;a href=\"blog.html\"&gt;Blog &amp; News&lt;\/a&gt;&lt;\/li&gt;"/""/g;
   $res1 =~ s/"&lt;li&gt;&lt;a href=\"tables.html\"&gt;Tables&lt;\/a&gt;&lt;\/li&gt;"/""/g;
   $res1 =~ s/"&lt;li&gt;&lt;a href=\"faq.html\"&gt;FAQ&lt;\/a&gt;&lt;\/li&gt;"/""/g;
   print $res1;
  </code></pre>
  
  <p>This my HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  Reponsive HTML Template
  
  http://fonts.googleapis.com/css?family=Roboto:400,300,700,100' rel='stylesheet' type='text/css'&gt;
  
  
  
   &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
  
    &lt;div class="collapse navbar-center navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
  
      &lt;ul class="nav navbar-nav"&gt;
  
        &lt;li class="active"&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li class="dropdown"&gt; &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;Pages&lt;/a&gt;
  
          &lt;ul class="dropdown-menu"&gt;
  
            &lt;li&gt;&lt;a href="index_fixed.html"&gt;Home / Fixed&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="index_with_blog.html"&gt;Home + Blog&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="portfolio.html"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="typography.html"&gt;Typography&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="shortcodes.html"&gt;Shortcodes&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="blog.html"&gt;Blog &amp; News&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="tables.html"&gt;Tables&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="faq.html"&gt;FAQ&lt;/a&gt;&lt;/li&gt;
  
          &lt;/ul&gt;
        &lt;/li&gt;
  
        &lt;li&gt;&lt;a href="left_sidebar.html"&gt;left sidebar&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="right_sidebar.html"&gt;right sidebar&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="full_width.html"&gt;full page&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="contact.html"&gt;contact us&lt;/a&gt;&lt;/li&gt;
  
      &lt;/ul&gt;
    &lt;/div&gt;
  
    &lt;!-- /.navbar-collapse --&gt;
  
    &lt;div class="clr"&gt;&lt;/div&gt;
  
    &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
  
    &lt;div class="navbar-header"&gt;
  
      &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt;
  
      &lt;h1 class="navbar-brand"&gt;&lt;a href="index.html"&gt;&lt;span&gt;anti&lt;/span&gt;que&lt;/a&gt;&lt;/h1&gt;
  
    &lt;/div&gt;
  &lt;/nav&gt;
  
  &lt;!-- Indicators --&gt;
  
  &lt;div class="carousel-inner"&gt;
  
    &lt;div class="item"&gt; &lt;img data-src="images/slider/slider1.jpg" alt="First slide" src="images/slider/slider1.jpg"&gt;
  
      &lt;div class="container"&gt;
        &lt;div class="carousel-caption"&gt;
  
          &lt;h1&gt;Vivamus ultricies volutpat egestas. Donec &lt;span&gt;turpis non eros&lt;/span&gt; euismod &lt;/h1&gt;
  
          &lt;p&gt;Aliquam sit amet lectus sagittis, feugiat neque dictum, rutrum augue. Integer vel egestas urna. &lt;/p&gt;
          &lt;p&gt;&lt;a class="btn btn-default" href="#" role="button"&gt;more details&lt;/a&gt;&lt;/p&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="item active"&gt; &lt;img data-src="images/slider/slider2.jpg" alt="Second slide" src="images/slider/slider2.jpg"&gt;
  
      &lt;div class="container"&gt;
        &lt;div class="carousel-caption"&gt;
          &lt;h1&gt;Donec &lt;span&gt;volutpat mattis&lt;/span&gt; odio. Quisque eros. Nullam malesuada. &lt;/h1&gt;
  
          &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. &lt;/p&gt;
          &lt;p&gt;&lt;a class="btn btn-default" href="#" role="button"&gt;get started&lt;/a&gt;&lt;/p&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;a class="left carousel-control" href="#myCarousel" data-slide="prev"&gt;&lt;span class="glyphicon carousel-control-left"&gt;&lt;/span&gt;&lt;/a&gt; &lt;a class="right carousel-control" href="#myCarousel" data-slide="next"&gt;&lt;span class="glyphicon carousel-control-right"&gt;&lt;/span&gt;&lt;/a&gt; &lt;/div&gt;
  
    &lt;h2 class="text-center"&gt;Phasellus ultrices nulla quis nibh. Quisque a lectus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/h2&gt;
  
    &lt;p class="text-center big-paragraph"&gt;Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.&lt;/p&gt;
  
  &lt;/div&gt;
  
    &lt;h2&gt;&lt;span&gt;our services&lt;/span&gt;&lt;/h2&gt;
  
    &lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt; &lt;img src="images/icons/ico1.png" alt="icon" class="icon"&gt;
  
        &lt;h3&gt;CLEAN FLAT &amp; MINIMAL&lt;/h3&gt;
  
        &lt;img src="images/content__images/img1.jpg" alt="image" class="img-rounded img-responsive"&gt;
  
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.&lt;/p&gt;
        &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
  
      &lt;/div&gt;
  
      &lt;div class="col-md-4"&gt; &lt;img src="images/icons/ico2.png" alt="icon" class="icon"&gt;
  
        &lt;h3&gt;FULLY RESPONSIVE&lt;/h3&gt;
  
        &lt;img src="images/content__images/img2.jpg" alt="image" class="img-rounded img-responsive"&gt;
  
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.&lt;/p&gt;
        &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
  
      &lt;/div&gt;
  
      &lt;div class="col-md-4"&gt; &lt;img src="images/icons/ico3.png" alt="icon" class="icon"&gt;
  
        &lt;h3&gt;EASY TO CUSTOMIZE&lt;/h3&gt;
  
        &lt;img src="images/content__images/img3.jpg" alt="image" class="img-rounded img-responsive"&gt;
  
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.&lt;/p&gt;
        &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
    &lt;h2 class="text-center"&gt;&lt;span&gt;about us&lt;/span&gt;&lt;/h2&gt;
  
    &lt;div class="row text-center"&gt;
      &lt;div class="col-md-6"&gt;
  
        &lt;h3&gt;Donec odio. Quisque volutpat mattis eros. 
  
          Nullam malesuada erat. &lt;/h3&gt;
  
        &lt;p&gt;&lt;small&gt;Praesent semper mod quis eget mi. Etiam eu ante risus. &lt;/small&gt;&lt;/p&gt;
  
        &lt;img src="images/content__images/pic1.jpg" class="img-rounded img-responsive" alt="pic1"&gt;
  
        &lt;div class="clearfix"&gt;&lt;/div&gt;
  
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.&lt;/p&gt;
  
        &lt;p&gt;&lt;a class="btn btn-info btn-lg" href="#" role="button"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
  
      &lt;/div&gt;
  
      &lt;div class="col-md-6"&gt;
  
        &lt;h3&gt;Etiam eu ante risus. Aliquam erat volutpat. 
  
          Aliquam luctus mattis.&lt;/h3&gt;
  
        &lt;p&gt;&lt;small&gt;Praesent semper mod quis eget mi. Etiam eu ante risus. &lt;/small&gt;&lt;/p&gt;
  
        &lt;img src="images/content__images/pic2.jpg" class="img-rounded img-responsive" alt="pic2"&gt;
  
        &lt;div class="clearfix"&gt;&lt;/div&gt;
  
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.&lt;/p&gt;
  
        &lt;p&gt;&lt;a class="btn btn-info btn-lg" href="#" role="button"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="container"&gt;
  
    &lt;h2 class=""&gt;Pellentesque egestas sem. Suspendisse commodo ullamcorper magna. Pellentesque egestas sem suspendisse commodo ullamcorper ...&lt;/h2&gt;
  
    &lt;p class=""&gt;Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore eritatis et quasi architecto beatae vitae dicta sunt explicabo.
  
      Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione 
  
      voluptatem sequi nesciunt.&lt;/p&gt;
  
    &lt;p&gt;&lt;a class="btn btn-info" href="#" role="button"&gt;Buy it&lt;/a&gt;&lt;a class="btn btn-default" href="#" role="button"&gt;Learn More&lt;/a&gt;&lt;/p&gt;
  
  &lt;/div&gt;
  
      &lt;h3&gt;About&lt;/h3&gt;
  
      &lt;p&gt;We strive to deliver a level of service that exceeds the expectations of our customers. &lt;br /&gt;
  
        &lt;br /&gt;
  
        If you have any questions about our products or services, please do not hesitate to contact us. We have friendly, knowledgeable representatives available seven days a week to assist you.&lt;/p&gt;
  
    &lt;/div&gt;
  
    &lt;div class="col-md-3"&gt;
  
      &lt;h3&gt;Tweets&lt;/h3&gt;
  
      &lt;p&gt;&lt;span&gt;Tweet&lt;/span&gt; &lt;a href="#"&gt;@You&lt;/a&gt;&lt;br /&gt;
  
        Etiam egestas, ipsum posuere accumsan sollicitudin, nulla mauris volutpat sem, sit amet rutrum risus. &lt;/p&gt;
  
      &lt;p&gt;&lt;span&gt;Tweet&lt;/span&gt; &lt;a href="#"&gt;@You&lt;/a&gt;&lt;br /&gt;
  
        Quisque porta tellus vitae adipiscing molestie. Mauris et lacus blandit, malesuada.&lt;/p&gt;
  
    &lt;/div&gt;
  
    &lt;div class="col-md-3"&gt;
  
      &lt;h3&gt;Mailing list&lt;/h3&gt;
  
      &lt;p&gt;Subscribe to our mailing list for offers, news updates and more!&lt;/p&gt;
  
      &lt;br /&gt;
  
      &lt;form action="#" method="post" class="form-inline" role="form"&gt;
  
        &lt;div class="form-group"&gt;
  
          &lt;label class="sr-only" for="exampleInputEmail2"&gt;your email:&lt;/label&gt;
  
          &lt;input type="email" class="form-control" id="exampleInputEmail2" placeholder="your email:"&gt;
  
        &lt;/div&gt;
  
        &lt;button type="submit" class="btn btn-primary"&gt;subscribe&lt;/button&gt;
  
      &lt;/form&gt;
    &lt;/div&gt;
  
    &lt;div class="col-md-3"&gt;
  
      &lt;h3&gt;Business&lt;/h3&gt;
  
      &lt;p&gt;Street&lt;br /&gt;
  
        City, State &lt;br /&gt;
  
        Country&lt;br /&gt;
  
        &lt;br /&gt;
  
        Phone: (111) 123-4567&lt;br /&gt;
  
        Fax: (111) 123-4567&lt;br /&gt;
  
        &lt;br /&gt;
      &lt;/p&gt;
  
      &lt;div class="social__icons"&gt; &lt;a href="#" class="socialicon socialicon-twitter"&gt;&lt;/a&gt; &lt;a href="#" class="socialicon socialicon-facebook"&gt;&lt;/a&gt; &lt;a href="#" class="socialicon socialicon-google"&gt;&lt;/a&gt; &lt;/div&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  $('.carousel').carousel({ interval: 3500, // in milliseconds pause: 'none' // set to 'true' to pause slider on mouse hover })
  </code></pre>
  
  <p>Thanks very much</p>