in reply to Re^2: Establishing a beachhead and acquiring privileges on a Mac-mini
in thread Establishing a beachhead and acquiring privileges on a Mac-mini
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Establishing a beachhead and acquiring privileges on a Mac-mini
by Aldebaran (Curate) on May 07, 2023 at 02:51 UTC | |
by kcott (Archbishop) on May 07, 2023 at 03:23 UTC |