Hello there Perl Monks. I wrote colorapt to learn Perl for my Unix class, and so am posting it here on the off chance that someone thinks it's cool. If anyone has any suggestions on coding style, feature requests, or bug reports, that would be a great help for getting me up to speed on this language. Thanks!

https://github.com/jeffythedragonslayer/colorapt

Seeing as Larry Wall says Perl 6 will be officially out in December, should I just use that for new projects?

Replies are listed 'Best First'.
Re: Colorapt for Ubuntu/Debian
by jeffa (Bishop) on Jul 30, 2015 at 22:03 UTC

    I see a few problems that can be corrected:

    • no documentation. How do i use this? Where do i start? You provide no clues for the end user.
    • no standardization. Try using Module::Starter to create the framework for your distribution.
    • custom installation with no uninstall. You could utilize Makefile.pl instead:
      EXE_FILES => ['colorapt/capt-get','colorapt/capt-search','colorapt/cap +t-cache']
      This delegates installation to something like cpanm, which also provides the means to uninstall. (See ExtUtils::MakeMaker for more.)
    • finally, is this really the best way to accomplish the task? I would think one module and one Perl script (no shell scripts) would suffice. Have the end user pipe the output of apt-get into your script instead of doing that for them.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Colorapt for Ubuntu/Debian
by MidLifeXis (Monsignor) on Jul 30, 2015 at 20:15 UTC

    Perl5 and Perl6 are two different languages, even if they are closely related. IMO, learning both would not be a loss.

    --MidLifeXis

      I agree with this. I toyed around with Perl6 a couple of years ago, and really liked it. Prior to that, I had never imagined being able to call a method on a literal before :)

      Since then, part of my job consists of writing Python. Perl6 is a lot like Python, in that everything is an object, and has methods.

      -stevieb

Re: Colorapt for Ubuntu/Debian
by crusty_collins (Friar) on Jul 30, 2015 at 20:48 UTC
    A couple of suggestion

    Comment Comment Comment

    You can't comment enough.

    I like to define what the regex is looking for specifically

    s/ \+/ /g; # Remove multiple spaces
    should be
    OLD s/\s+/\s/g;
    UPDATE : sorry it should be
    NEW s/\s+//g;
      When I try that, I get "Unrecognized escape \s passed through at ./get.pl line 36."
        AFAIK, \s has been introduced around version 5.10, so it might help if you could upgrade your perl (or, if it's the "system perl", use a mechanism like perlbrew…)
        Big Oops! Sorry, apparently I was not yet awake enough when I wrote this