Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

use Filter::Simple ??? are you serious?

absolutely, makes things much nicer

use base 'Devel::Declare::MethodInstaller::Simple' ??? are you serious?

absolutely, its for those who want sugar but not source filters -- schwern says its reliable

nice but ... - overhead by extra sub call

HA! are you serous? You can't be serious :)

- parameters are unpacked into %p hash, i.e. you need to type $p{x} to access x

this isn't the only usage, there is validate_pos, and even as Attribute::Params::Validate

and you'll miss all the benefits of compiletime checks for lexicals like my $x.

What compile-time checks?

So any serious arguments other than clicking thru CPAN?

You're looking for arguments about something? About what?

Hey look, these are compile-time :) fields, Hash::Util::lock_keys, Sub::NamedParams

If you're referring to so which pattern do you think is better? to me there really isn't much difference between them -- not that your mission makes sense to me

Even if I'm typing this stuff myself, I'm fine with

defined $pos1 or die "missing arg"; defined $pos2 or $pos2 = 42;

but I wouldn't mix that and  my ($name1,$name2) = @arg{qw/name1 name2/};

I would use a hash or a flatlist


In reply to Re^3: RFC: New style for argument check in subs by Anonymous Monk
in thread RFC: New style for argument check in subs by LanX

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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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 having an uproarious good time at the Monastery: (6)
    As of 2015-07-02 00:41 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (25 votes), past polls