Oh, I see. I was reading it while someone was talking to me, so I was a little distracted. That clears it up a bit. Perhaps I will look into having them return information when called a certain way... perhaps using some level of currying... I still hope to use my current plan though, as it just looks better in my opinion.
After all, what would you rather see?
$check->newrule(
-name => 'myname', #required, if no element specified, takes this.
-element => ['one','two'], #Takes arrayref or string
-required => 0, #required has no effect unless the data is omi
+tted altogether.
-tests => {
-def => ['array','of','test','names'],
-custom => [
sub($$) : modifies { #code },
sub(@) { #code },
],
}
);
#Or
$check->newrule(
-name => 'myname', #required, if no element specified, takes this.
-element => ['one','two'], #Takes arrayref or string
-required => 0, #required has no effect unless the data is omi
+tted altogether.
-tests => {
-def => ['array','of','test','names'],
-custom => [
ctest(
-args => 2,
-mod => 1,
-code => sub { #code },
),
ctest(
-args => '*',
-code => sub { #code },
),
],
}
);
Personally I prefer the first, but I'll admit, the second will probably be easier to implement.
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.