I remain unconvinced. For pure Perl modules on CPAN I have had good luck under Windows just downloading, untarring, and then copying them manually. Other than the need to find something that will handle .tar.gz files on Windows, I don't see what is gained by having such modules on PerlMonks.
As for the examples that you give, your routines make perfect sense if you are working in a language like VB with poor string handling capability. But in Perl I, and I think most experienced Perl developers, find it much easier and more reasonable to just inline the regular expressions in question where needed.
A better example might be something like:
# Runs a system command with basic error handling.
sub run_system {
if ($verbose) {
my ($cmd, @args) = @_;
print "Running '$cmd'\n";
if (@args) {
print " with arguments '@args'\n";
}
}
if (system(@_)) {
my $cmd = shift;
my $arg_msg = "";
if (@_) {
$arg_msg = " with args ['@_']";
}
confess("Running '$cmd'$arg_msg failed on return code ($?)\n");
}
}
But how many truly useful ones are there? The fact is that the built-ins in Perl combined with its flexibility make a lot of the basic utility functions you might write in a different language (VB, C, etc) pretty much useless. I cannot think of enough for me to want a new section. Instead I think that they belong in Snippets. True, that needs improvement (eg making it searchable). Perhaps it should have categories, etc. But I think that it is the right place for this.
-
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 How to display code and escape characters
are good places to start.
|