Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Having selected the link of "Comment on...", I feel obliged to comment on this program after a cursory glance as follows.

I find your introduction of the synthetic variable $control to be very confusing to follow. I had to read that loop three times to figure out when you were getting out to verify that it was doing what the text said it was doing. I think you want this general idiom:

{ print "value for XYZ? "; chomp($xyz = <STDIN>); unless (validate $xyz) { print "$xyz is not a valid XYZ\n"; redo; } print "confirm value $xyz for XYZ? (y/n)"; redo unless <STDIN> =~ /^y/i; }
In fact, you can bundle this up as a subroutine, and it'd make even more sense. If you ever find yourself typing the same code two or three times, except for some parameters (used in its most generic sense here), it's a good candidate for factoring out. I heard somewhere once "put the regular part as code, and the irregular part as data". And that really makes sense.

-- Randal L. Schwartz, Perl hacker

In reply to Re: Basic DNS Record Creation by merlyn
in thread Basic DNS Record Creation by CiceroLove

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-08-06 03:02 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (44 votes). Check out past polls.