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 926629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:42:54+00:00 2026-05-15T19:42:54+00:00

This is something thats been hard for me to find info on, I was

  • 0

This is something thats been hard for me to find info on, I was fortunate to get an answer on the other thing I was trying to do that relates to this (code below).. so say I am using the $content input (in reality it would be a full HTML page, not just the snippet I gave below) and I want to just get the contents of the input tag that has the name or ID “hush_username”. The way it is now it gives the content of all of the input tags.. the only thing that I could find on this mentioned something like incorporating this:

$tag->[1]{name} and $tag->[1]{name} eq "hush_username" ;

But I have been unable to get this to work.. I would greatly appreciate any advice

#!/usr/bin/perl
use strict; use warnings;
use HTML::TokeParser::Simple;
$content = do { local $/; <DATA> };            
my $parser = HTML::TokeParser::Simple->new(\$content);

while ( my $tag = $parser->get_tag('input') ) {
    print $tag->as_is, "\n";
    print "####" ;
    for my $attr ( qw( type name value ) ) {
        printf qq{%s="%s"\n}, $attr, $tag->get_attr($attr);
    }
}
__DATA__
<form name="authenticationform" id="authenticationform"
    action="/authentication/login?skin=mobile&next_webapp_name=hushmail5&amp;next_webapp_url_name=m" method="post">
<input type="hidden" name="next_webapp_page" value=""/>
<p><label for="hush_username">Email address:</label><br/>
<input type="email" name="hush_username" id="hush_username" value="email@test.com"/></p>
<p><label for="hush_passphrase">Passphrase:</label><br/>
<input type="password" name="hush_passphrase" id="hush_passphrase"  maxlength="1000" value=""/></p>
<p><input type="checkbox" name="hush_remember_me" id="hush_remember_me" value="on"
/><label for="hush_remember_me">Stay signed in when I close my browser</label></p>
<p><input type="submit" value="Sign In"/></p>
<input type="hidden" name="hush_customerid" value="0000000000000000"/>
</form>
  • 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-15T19:42:55+00:00Added an answer on May 15, 2026 at 7:42 pm

    Keep it simple. How about this?

    while ( my $tag = $parser->get_tag('input') ) {
      my $name = $tag->get_attr('name');
      next unless defined $name and $name eq 'hush_username';
      print "Value: ", $tag->get_attr('value'), "\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this is something that I have not been able to find any documentation
I've been whacking on this regex for a while, trying to build something that
This is something that's been bugging me with PHP for a while now and
This is something that's been bugging me for many years: why most online services
I'm trying to do something that doesn't seem to hard, but I just can't
I've been trying to find out the name for something, but without knowning the
I'm sure this has been asked before in some other way that I just
I've been trying to look for an answer and can't seem to find one
Now I'm not sure if this is something I'm doing wrong, or something thats
This is something that's I've wanted to know recently, mostly out of curiousity. I'm

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.