Commands-Guarded
view release on metacpan or search on metacpan
lib/Commands/Guarded.pm view on Meta::CPAN
=back
Much has been written on good programming methodology, but in general
such methodologies have general-purpose programs in mind. When
applied to scripts, which are generally very high-level and procedural
in nature, the methodologies can rapidly result in unreadable
spaghetti, with more code devoted to methodology than to method.
Most scripters react in one of two ways: they either let the spaghetti
ensue, or they throw up their hands and write fragile code.
=head2 An example
Suppose you want to write a script to mount a scratch directory from
an NFS server. (This would usually be accomplished via a shell
language such as I<bash>, but for the sake of argument let's suppose
that you're writing in Perl, because you need access to another module
or perhaps just because you like Perl better.)
An optimistic implementation on a Red Hat Linux machine might be:
( run in 0.921 second using v1.01-cache-2.11-cpan-364913b4093 )