Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

safe way to upgrade module

by xiaoyafeng (Chaplain)
on May 02, 2013 at 05:42 UTC ( #1031697=perlquestion: print w/replies, xml ) Need Help??
xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

Is there a standard/easiest way to upgrade modules, like apt-update apt-upgrade in debian?


I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: safe way to upgrade module
by karlgoethebier (Prior) on May 02, 2013 at 08:56 UTC
    "Is there a standard/easiest way to upgrade modules, like apt-update apt-upgrade in debian?"

    Yes, shure.

    I assume that you don't want to damage your perl on your debian box, right?

    So you should take a look at perlbrew and cpanm.

    It is elegant, easy, save a.s.o. It works.

    Please see also Re: Perl version (do not update system perl, install local perl) and Re: Perl version.


    And you can have always the newest perl version(s) as well as the newest stuff from CPAN.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      I second perlbrew and cpanm!

      Great tools
Re: safe way to upgrade module
by choroba (Chancellor) on May 02, 2013 at 07:19 UTC
    The simplest way is to use cpan:
    $ cpan cpan[1]> upgrade
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: safe way to upgrade module
by sundialsvc4 (Abbot) on May 02, 2013 at 12:12 UTC

    In many Linux distributions, Perl packages are, well, packaged, as Linux packages in the standard distro upgrade-mechanism.   Most often, you should just use this and be done.   But of course, sometimes you can’t, because distros tend to lag-behind ... and there is a reason why they do, which is this:   that very-important bits of their own system management software is written in Perl.   You do not want to disrupt that.

    So, here’s what to do:   do a Super Search, above, for “install non root,” because your situation is basically identical to that of someone who wants to install Perl in a shared-hosting environment where (s)he does not have access to the root userid.   (Note also that you will not need to be root to do this, either.   You will designate an additional directory to hold “local packages,” then set up cpan or cpanm to know to install to it, then arrange (by some operating-system appropriate means) for the PERL5LIB environment-variable to include it first, as will be confirmed by entering the command perl -V (with a capital V).   Your search will quickly produce about 26 other threads and you should review them all.

    The strategy is simple and sound:   first, see if upgrading a Linux-distro package (or ActiveState or Strawberry) solves your problem.   If not, make your upgrades alongside what is already there, in such a way that you supersede them for your own purposes but not theirs.

      "So, here’s what to do:do a Super Search, above, for “install non root,”..."

      Yes, but that (install non root) is what perlbrew does in a very convenient way. So why the Mess Around?


      «The Crux of the Biscuit is the Apostrophe»

Re: safe way to upgrade module
by zwon (Abbot) on May 02, 2013 at 15:35 UTC
Re: safe way to upgrade module
by Anonymous Monk on May 02, 2013 at 07:13 UTC
    Yes and no. There is ppm, which is pretty much like apt except perl specific. Its about as safe as cpan/cpanp/cpanm , but less standard (mostly activestate specific).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1031697]
Front-paged by Corion
[Corion]: hippo: If you have a Unicode-wise Perl then likely some zero-width characters in $x would work. Maybe $x = "\x{200b}" works.
[Corion]: Hmm - no, that outputs 1 for me on 5.14 - perl -wle "my $x = qq(\x{200b}); warn $x; warn length $x"
[hippo]: Smart - I'll give that a go. Thanks.
[hippo]: Ah
[Corion]: But maybe there is some other Unicode string that will be true but have a zero width
[hippo]: For explanation, I've seen this construct in someone else's code (no names, no pack drill) and couldn't think of a situation to trigger it.
[Corion]: You'll have to look somewhere esoteric for that. Maybe some tied variable or special dualvar can also trigger that. But it's certainly not a common occurrence
[Corion]: And on 5.20, the following also outputs no find:perl -wle 'for my $x ("\x{2000}".."\ x{1fffff}") { if( $x && ! length $x ) { warn qq(<$x>); warn length $x; die } }'
[Corion]: (this time on Unix)
[hippo]: Understood. I'll have to go through the code and see if it's doing anything fancy with ties, dual-vars or non-scalars. In the end, it's probably a bug though.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2017-07-27 13:32 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (413 votes). Check out past polls.