Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 441651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:59:37+00:00 2026-05-12T20:59:37+00:00

Possible Duplicate: How can I remove external links from HTML using Perl? Alright, i’m

  • 0

Possible Duplicate:
How can I remove external links from HTML using Perl?

Alright, i’m working on a job for a client right now who just switched up his language choice to Perl. I’m not the best in Perl, but i’ve done stuff like this before with it albeit a while ago.

There are lots of links like this:

<a href="/en/subtitles/3586224/death-becomes-her-en" title="subtitlesDeath Becomes Her" onclick="reLink('/en/subtitles/3586224/death-becomes-her-en');" class="bnone">Death Becomes Her
        (1992)</a>

I want to match the path “/en/subtitles/3586224/death-becomes-her-en” and put those into an array or list (not sure which ones better in Perl). I’ve been searching the perl docs, as well as looking at regex tutorials, and most if not all seemed geared towards using ~= to match stuff rather than capture matches.

Thanks,

Cody

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:59:38+00:00Added an answer on May 12, 2026 at 8:59 pm

    Use a proper HTML parser to parse HTML. See this example included with HTML::Parser.

    Or, consider the following simple example:

    #!/usr/bin/perl
    
    use strict; use warnings;
    
    use HTML::TokeParser::Simple;
    
    my $parser = HTML::TokeParser::Simple->new(\*DATA);
    
    my @hrefs;
    
    while ( my $anchor = $parser->get_tag('a') ) {
        if ( my $href = $anchor->get_attr('href') ) {
            push @hrefs, $href if $href =~ m!/en/subtitles/!;
        }
    }
    
    print "$_\n" for @hrefs;
    
    __DATA__
    <a href="/en/subtitles/3586224/death-becomes-her-en" title="subtitlesDeath 
    Becomes Her" onclick="reLink('/en/subtitles/3586224/death-becomes-her-en');" 
    class="bnone">Death Becomes Her
                    (1992)</a>
    

    Output:

    /en/subtitles/3586224/death-becomes-her-en
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 226k
  • Answers 227k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Microsoft's .NET framework has the System.Speech.Synthesis library which will accommodate… May 13, 2026 at 1:17 am
  • Editorial Team
    Editorial Team added an answer I think you described the most popular ways to comment… May 13, 2026 at 1:17 am
  • Editorial Team
    Editorial Team added an answer <input type="text" id="email" name="email" class="required email" />, in this code,… May 13, 2026 at 1:17 am

Related Questions

Possible Duplicate: How can I remove external links from HTML using Perl? Alright, i'm
Possible Duplicate: flash AS3 how do I remove stage event listeners Say I have
Possible Duplicate: How to remove an XmlNode from XmlNodeList Hi, How can i delete
Possible Duplicate: How to set cellpadding & cellspacing in CSS? i have a little
Possible Duplicate: How do you remove Subversion control for a folder? Command line to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.