use File::Spec::Functions;
chdir(updir()); # go up one directory
- $file = catfile(curdir(), 'temp', 'file.txt');
+ my $file = catfile(curdir(), 'temp', 'file.txt');
# on Unix and Win32, './temp/file.txt'
# on Mac OS Classic, ':temp:file.txt'
# on VMS, '[.temp]file.txt'
better, use the three-arg version of open, unless you want the user to
be able to specify a pipe open.
- open(FILE, '<', $existing_file) or die $!;
+ open my $fh, '<', $existing_file) or die $!;
If filenames might use strange characters, it is safest to open it
with C<sysopen> instead of C<open>. C<open> is magic and can
of the various operating system possibilities, say:
use Config;
- $thisperl = $^X;
+ my $thisperl = $^X;
if ($^O ne 'VMS')
{$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;}
To convert $Config{perlpath} to a file pathname, say:
use Config;
- $thisperl = $Config{perlpath};
+ my $thisperl = $Config{perlpath};
if ($^O ne 'VMS')
{$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;}
it may be appropriate to calculate an offset for the epoch.
require Time::Local;
- $offset = Time::Local::timegm(0, 0, 0, 1, 0, 70);
+ my $offset = Time::Local::timegm(0, 0, 0, 1, 0, 70);
The value for C<$offset> in Unix will be C<0>, but in Mac OS Classic
will be some large number. C<$offset> can then be added to a Unix time
for (0..10000000) {} # bad
for (my $x = 0; $x <= 10000000; ++$x) {} # good
- @lines = <VERY_LARGE_FILE>; # bad
+ my @lines = <$very_large_file>; # bad
- while (<FILE>) {$file .= $_} # sometimes bad
- $file = join('', <FILE>); # better
+ while (<$fh>) {$file .= $_} # sometimes bad
+ my $file = join('', <$fh>); # better
The last two constructs may appear unintuitive to most people. The
first repeatedly grows a string, whereas the second allocates a
be aware that each of these file specifications may have subtle
differences:
- $filespec0 = "c:/foo/bar/file.txt";
- $filespec1 = "c:\\foo\\bar\\file.txt";
- $filespec2 = 'c:\foo\bar\file.txt';
- $filespec3 = 'c:\\foo\\bar\\file.txt';
+ my $filespec0 = "c:/foo/bar/file.txt";
+ my $filespec1 = "c:\\foo\\bar\\file.txt";
+ my $filespec2 = 'c:\foo\bar\file.txt';
+ my $filespec3 = 'c:\\foo\\bar\\file.txt';
System calls accept either C</> or C<\> as the path separator.
However, many command-line utilities of DOS vintage treat C</> as
=back
-=head1 Supported Platforms
+=head1 Supported Platforms (Perl 5.12)
-As of July 2002 (the Perl release 5.8.0), the following platforms are
+
+As of _____ 20??, (The release of Perl 5.12), the following platforms are
+known to build Perl from the standard source code distribution available
+at http://www.cpan.org/src
+
+
+=over
+
+=item Linux (x86, ARM, IA64)
+
+=item HP-UX
+
+=item AIX
+
+=item Win32
+
+=over
+
+=item Windows 2000
+
+=item Windows XP
+
+=item Windows Server 2003
+
+=item Windows Vista
+
+=item Windows Server 2008
+
+=item Windows 7
+
+=back
+
+=item Cygwin
+
+=item Solaris (x86, SPARC)
+
+=item OpenVMS
+
+=over
+
+=item Alpha (7.2 and later)
+
+=item I64 (8.2 and later)
+
+=back
+
+=item Symbian
+
+=item NetBSD
+
+=item FreeBSD
+
+=item Haiku
+
+=item Irix (6.5. What else?)
+
+=item OpenBSD
+
+=item Dragonfly BSD
+
+=item MirOS BSD
+
+Caveats:
+
+=over
+
+=item time_t issues that may or may not be fixed
+
+=back
+
+
+=item Symbian (Series 60 v3, 3.2 and 5 - what else?)
+
+=item Stratus VOS
+
+=item AIX
+
+=back
+
+=head1 EOL Platforms (Perl 5.12)
+
+The following platforms were supported by a previous version of
+Perl but have been officially removed from Perl's source code
+as of 5.12:
+
+=over
+
+=item Atari MiNT
+
+=item Apollo Domain/OS
+
+=item Apple Mac OS 8/9
+
+=item Tenon Machten
+
+=back
+
+The following platforms may still work as of Perl 5.12, but Perl's
+developers have made an explicit decision to discontinue support for
+them:
+
+=over
+
+=item Windows 95
+
+=item Windows 98
+
+=item Windows ME
+
+=item Windows NT4
+
+=back
+
+=head1 Supported Platforms (Perl 5.8)
+
+As of July 2002 (the Perl release 5.8.0), the following platforms were
able to build Perl from the standard source code distribution
available at http://www.cpan.org/src/