perl.1   [plain text]


.Dd Apr 17, 2010
.Dt PERL 1
.Os
.Sh NAME
.Nm perl,
.Nm a2p
.Nd Practical Extraction and Report Language
.Sh SYNOPSIS
.Nm perl
\&...
.Nm a2p
\&...
.Sh DESCRIPTION
To support multiple versions, the program named
.Nm perl
now just selects the real version of Perl to run, and the program named
.Nm a2p
now just selects the real version of the awk-to-perl translator to run,
depending on various settings.
The current supported versions are
.Sy @VERSION_DEFAULT@
and
.Sy @VERSION_ALT@ ,
with the default being
.Sy @VERSION_DEFAULT@
(older alternate versions are provided for backward-compatibility, while newer
alternate versions are provided before we are ready to make it the default).
Use
.Pp
.Dl % man perl@VERSION_DEFAULT@
.Dl % man perl@VERSION_ALT@
.Dl % man a2p@VERSION_DEFAULT@
.Dl % man a2p@VERSION_ALT@
.Pp
to see the man page for a specific version.
When the version is unspecified, as in:
.Pp
.Dl % man perldoc
.Pp
the man page for the (unmodified) default
version of Perl
.Sy ( @VERSION_DEFAULT@ )
will be shown.
.Sh CHANGING THE DEFAULT PERL VERSION
Using
.Pp
.Dl % defaults write com.apple.versioner.perl Version @VERSION_ALT@
.Pp
will make version
.Sy @VERSION_ALT@
the user default when running the both the
.Nm perl
and
.Nm a2p
commands
.Sy ( versioner
is the internal name of the version-selection software used).
.Pp
To set a system-wide default, replace
.Ql Li com.apple.versioner.perl
with
.Ql Li /Library/Preferences/com.apple.versioner.perl
(admin privileges will be required).
.Pp
The environment variable
.Ev VERSIONER_PERL_VERSION
can also be used to set the
.Nm perl
and
.Nm a2p
version:
.Pp
.D1 Li % export VERSIONER_PERL_VERSION=@VERSION_ALT@ Em # Bourne-like shells
.D1 Li "    " Sy or
.D1 Li % setenv VERSIONER_PERL_VERSION @VERSION_ALT@ Em # C-like shells
.Dl % perl ...
.Pp
This environment variable takes precedence over the setting in any preference file.
.Sh 64-BIT SUPPORT
Both versions of perl
support 64-bit execution (which is the default).
Like the setting the version of Perl, the
.Nm perl
command can select between 32 and 64-bit execution.
Use:
.Pp
.Dl % defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes
.Pp
to make 32-bit execution the user default (using
.Ql Li /Library/Preferences/com.apple.versioner.perl
will set the system-wide default).
The environment variable
.Ev VERSIONER_PERL_PREFER_32_BIT
can also be used (has precedence over the preference file):
.Pp
.D1 Li % export VERSIONER_PERL_PREFER_32_BIT=yes Em # Bourne-like shells
.D1 Li "    " Sy or
.D1 Li % setenv VERSIONER_PERL_PREFER_32_BIT yes Em # C-like shells
.Pp
Again, the preference setting and environmental variable applies to both
.Nm perl
and
.Nm a2p .
.Sh USING A SPECIFIC VERSION
Rather than using the
.Nm perl
command, one can use a specific version directly.
For example, running
.Nm perl@VERSION_ALT@
from the command line will run the
.Sy @VERSION_ALT@
version of Perl, independent of what the default version of Perl is.
.Pp
One can use a specific version of Perl on the
.Em #!
line of a script, but that may have portability and future compatibility issues.
.Pp
Note that the preference files and environment variable that apply to the
.Nm perl
command, do
.Sy not
apply when running a specific version of Perl.
In particular, running
.Nm perl@VERSION_DEFAULT@
will always default to 64-bit execution
(unless one uses the
.Xr arch 1
command to specifically select a 32-bit architecture).
.Sh SEE ALSO
.Xr perl@VERSION_DEFAULT@ 1 ,
.Xr perl@VERSION_ALT@ 1 ,
.Xr a2p@VERSION_DEFAULT@ 1 ,
.Xr a2p@VERSION_ALT@ 1 ,
.Xr arch 1