Win95/NT Perl using WinGCC, then you'll have to modify the Registry
yourself.
-Macintosh perl scripts will have the the appropriate Creator and
+Macintosh perl scripts will have the appropriate Creator and
Type, so that double-clicking them will invoke the perl application.
I<IMPORTANT!>: Whatever you do, PLEASE don't get frustrated, and just
=head2 Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Short answer: No, Perl does not have a Year 2000 problem. Yes,
-Perl is Y2K compliant. The programmers you're hired to use it,
+Perl is Y2K compliant. The programmers you've hired to use it,
however, probably are not.
Long answer: Perl is just as Y2K compliant as your pencil--no more,
count of a certain single character (X) within a string, you can use the
C<tr///> function like so:
- $string = "ThisXlineXhasXsomeXx'sXinXit":
+ $string = "ThisXlineXhasXsomeXx'sXinXit";
$count = ($string =~ tr/X//);
print "There are $count X charcters in the string";
Then use any of those as you would a normal filehandle. Anywhere that
Perl is expecting a filehandle, an indirect filehandle may be used
instead. An indirect filehandle is just a scalar variable that contains
-a filehandle. Functions like C<print>, C<open>, C<seek>, or the functions or
-the C<E<lt>FHE<gt>> diamond operator will accept either a read filehandle
+a filehandle. Functions like C<print>, C<open>, C<seek>, or
+the C<E<lt>FHE<gt>> diamond operator will accept either a real filehandle
or a scalar variable containing one:
($ifh, $ofh, $efh) = (*STDIN, *STDOUT, *STDERR);
$got = <$ifh>
print $efh "What was that: $got";
-Of you're passing a filehandle to a function, you can write
+If you're passing a filehandle to a function, you can write
the function in two ways:
sub accept_fh {
Variable suicide is when you (temporarily or permanently) lose the
value of a variable. It is caused by scoping through my() and local()
-interacting with either closures or aliased foreach() interator
+interacting with either closures or aliased foreach() iterator
variables and subroutine arguments. It used to be easy to
inadvertently lose a variable's value this way, but now it's much
harder. Take this code:
=head2 How can I measure time under a second?
-In general, you may not be able to. The Time::HiRes module (available
-from CPAN) provides this functionality for some systems.
+The Time::HiRes module (available from CPAN) provides this
+functionality for some systems.
In general, you may not be able to. But if your system supports both the
syscall() function in Perl as well as a system call like gettimeofday(2),