G'day Aldebaran,

"... I do not know the perl command to update itself."

Having been advised against using the system Perl on Mac, you wouldn't be doing this even if Perl had such a command. Correct?

I used Perlbrew on Mac for about nine years and never had any problems. I changed to Cygwin on Win10 about five years ago; still using Perlbrew and still having no problems.

Following links from Perlbrew, you'll eventually get to CPAN: perlbrew. Here you'll find documentation for perlbrew commands; in the context of the current discussion, the most pertinent are probably install, upgrade-perl, and install-cpanm.

Once you have Perlbrew installed, you can easily switch between whatever versions of Perl you have; e.g.

$ perl -v | head -2 | tail -1 This is perl 5, version 36, subversion 0 (v5.36.0) built for cygwin-th +read-multi $ perlbrew switch perl-5.32.0 $ perl -v | head -2 | tail -1 This is perl 5, version 32, subversion 0 (v5.32.0) built for cygwin-th +read-multi $ perlbrew switch perl-5.36.0 $ perl -v | head -2 | tail -1 This is perl 5, version 36, subversion 0 (v5.36.0) built for cygwin-th +read-multi

I recommend using the following shebang in your scripts.

#!/usr/bin/env perl

This means that the script will use whatever Perl version is current.

$ cat test_shebang.pl #!/usr/bin/env perl print $^V; $ ./test_shebang.pl v5.36.0 $ perlbrew switch perl-5.33.5 $ perl -v | head -2 | tail -1 This is perl 5, version 33, subversion 5 (v5.33.5) built for cygwin-th +read-multi $ ./test_shebang.pl v5.33.5

— Ken


In reply to Re^3: Establishing a beachhead and acquiring privileges on a Mac-mini by kcott
in thread Establishing a beachhead and acquiring privileges on a Mac-mini by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.