in reply to Re^2: Should I upload it on CPAN?
in thread Should I upload it on CPAN?

And what is the point of a 3 line script?

I used to think that too, but I've moved more and more of my programs into modules and used wrapper scripts to invoke them with the most common arguments already defined. It's improved the testability and usability of a lot of my code. Otherwise I ended up with a lot of shell aliases to invoke modules—and there's not much documentation there.

Replies are listed 'Best First'.
Re^4: Should I upload it on CPAN?
by BrowserUk (Patriarch) on Feb 24, 2012 at 13:48 UTC

    Let's see.

    2 modules; 2 namespaces; and two hundred and eighty eight support modules:

    To create a 3 line script that downloads 2 files, constructs a single object and calls a single method upon it -- Ie. Calls one function passing some parameters.

    And when it goes wrong, no one knows how to fix it. If that's modern Perl, you can keep it.

    Isn't it amazing how technology is giving us ever more powerful ways of creating unbelievable (and unintelligible) complexity from simplicity.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Isn't it amazing how technology is giving us ever more powerful ways of creating unbelievable (and unintelligible) complexity from simplicity.

      The same twelve tone western scale that allows Handel's music for the royalfireworks, Beethoven's symphonies, and Mozart also allows autotuned and sampled radio pop performed by talentless hacks. You can (rightly) decry the latter without diminishing the former.

      Then again, Liszt would have fit right into the LA party scene.

        That is a studiously osbcure retort, but an interesting analogy none the less.

        When some techo-hack scratches The Crazy Frog together with a jazz-rap fusion that sampled a movie soundtrack that had a Country&Western band playing Ballade No.2 in B minor on an autoharp and slide guitar, no one has to go back and try to debug Liszt's original score.

      I'm not entirely sure what your point is.

      # lib/App/Apache/Wrapper.pm { package App::Apache::Wrapper; use Moose; has 'apache_path' => ( is => 'ro', isa => 'Str', ); sub run { my $self = shift; system($self->apache_path); } } # apache.pl use App::Apache::Wrapper; App::Apache::Wrapper -> new(apache_path => '/usr/sbin/httpd') -> run;

      The fact that a program consists of instantiating a single object and calling a single method on it, is not necessarily an indication of the complexity of the program as a whole.

      Yes, it's frustrating that App::Reprove has not worked for that person. On the whole its test results are reasonably good (about 90% pass) though there's room for improvement. I'm sure that by dropping MooseX::Declare (which is still pretty experimental) I could push that up to pretty close to 100%. But I have no immediate plans to do that. Maintaining Module::Reprove is not my main priority in life. Patches welcome though.

        Maintaining Module::Reprove is not my main priority in life. Patches welcome though.

        Here is patch for you ;)

        $ cat reprove.pl #!/usr/bin/perl -- system $^X, qw/ -S cpanp t/, @ARGV;

        scriptdist reprove.pl
        cd reprove.pl.d
        perl Makefile.PL
        make dist
        cpanupload reprove.pl-0.10.tar.gz

        The fact that a program consists of instantiating a single object and calling a single method on it, is not necessarily an indication of the complexity of the program as a whole.

        Sorry, but that is simply fatuous pseud-OO.

        You pull in nearly 300 modules to do nothing more than: system '/usr/sbin/httpd';

        That's not just fatuous, it is moronic.

        I truly hope that doesn't offend you, because that is not my intention -- all said and done, it is just the opinion of some obscure Englishman on the net -- but it is my opinion.

        You are gaining exactly nothing from your use of OO here; and exactly nothing from your dependency on, and the considerable overheads of, Moose.

        It's not even validating your parameter for you. It will happily accept 1234567890 as a string -- as all Perl will.

        If App::Reprove consisted of (something like):

        package App::Reprove; use App::Prove; use LWP::Simpe; require Exporter; our @ISA = qw[ Exporter ]; our @EXPORT = qw[ doit ]; sub doit { my %arg = @_; ## maybe a little validation my $file1 = get delete $args{ file1 }; my $file2 = get delete $args{ file2 }; ## do whatver you do with the file contents... App::Prove->new( %args )->run } 1;

        It would:

        • be just as useful;
        • not require 300MB of downloads;
        • (probably) work everywhere;
        • (probably) never need maintenance;
        • be easy to understand, debug, and patch should that ever be required.

          By any semi-competent perl (or C or D or Ruby or Java or Python or maybe even PHP) programmer, anywhere.

        As is, you've got a module that requires users to install a huge crap-load of dependencies only to find -- for 10% of them at least -- that it doesn't work. And probably never will unless 1 or more of the 3 or 4 guys that understand what the **** is going on inside Moose decide to step in and help you out.

        I'm pretty damn good at working my way through new modules and working out what is wrong, but with Moose in the picture, I can't even get started.

        Quite frankly, I cannot see any merit in your module over using App::Prove myself. But then, I can see no merit in App::Prove over using the prove command directly either. But at least I can look inside the latter and see the value-add -- no matter how tenuous I might think it is -- and can understand the code enough that I could fix any problems that arose. With yours, NADA. Not a hope in hell.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?