Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Regarding Option parsing modules - this is not to bug you into using them, but rather an option for others to decide.

I though to myself, "hmmmm ... let's use TheDamian's Getopt::Declare" and proceded to RTFM. I had always wanted to learn this module, and now seemed like the time.

After about 40 minutes of racking my brain (:D) i finally came up with this:

#!/usr/bin/perl -w use strict; use LWP::UserAgent; use Getopt::Declare; # -h, -v, --help, --version are included # and these are tabs - not spaces! my $spec = q( -a List all matches --all [ditto] ); my $args = Getopt::Declare->new($spec); my $all = $args->{'--all'} || $args->{'-a'}; for my $woord ($args->unused) { # insert for loop block innards from code above }
But that is 40 minutes of well spent time, because now i see the power of this module. And thanks to the Von Neumann bottleneck of having to retrieve the page from the Internet, the fact that Getopt::Declare is slower than the option parsing code above is negligible.

P.S. i also have no quandaries about using regexes to parse HTML, just as long as the coder understands how to use the CPAN HTML parsers. Sometimes using regexes really is easier. Sometimes.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: vandale.pl (with Getopt::Declare) by jeffa
in thread vandale.pl by Juerd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (12)
    As of 2014-07-25 15:25 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (172 votes), past polls