Creates a digest string exactly like the crypt(3) function in the C
library (assuming that you actually have a version there that has not
-been extirpated as a potential munitions).
+been extirpated as a potential munition).
crypt() is a one-way hash function. The PLAINTEXT and SALT is turned
into a short string, called a digest, which is returned. The same
Traditionally the result is a string of 13 bytes: two first bytes of
the salt, followed by 11 bytes from the set C<[./0-9A-Za-z]>, and only
-the first eight bytes of the digest string mattered, but alternative
+the first eight bytes of PLAINTEXT mattered. But alternative
hashing schemes (like MD5), higher level security schemes (like C2),
and implementations on non-UNIX platforms may produce different
strings.
for (;;) {
undef $!;
unless (defined( $line = <> )) {
+ last if eof;
die $! if $!;
- last; # reached EOF
}
# ...
}
}
# In the main program
- push @INC, new Foo(...);
+ push @INC, Foo->new(...);
Note that these hooks are also permitted to set the %INC entry
corresponding to the files they have loaded. See L<perlvar/%INC>.
use sort '_mergesort'; # note discouraging _
@new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;
+
+Warning: Care is required when sorting the list returned from a function.
+
+If you want to sort returned by the function call: find_records(@key) then
+you can use:
+ @contact = sort { $a cmp $b } find_records @key;
+ @contact = sort +find_records(@key);
+ @contact = sort &find_records(@key);
+ @contact = sort(find_records(@key));
+
+If instead you want to sort the array @key with the comparison routine
+find_records then you can use:
+ @contact = sort { find_records() } @key;
+ @contact = sort find_records(@key);
+ @contact = sort(find_records @key);
+ @contact = sort(find_records (@key));
+
+
If you're using strict, you I<must not> declare $a
and $b as lexicals. They are package globals. That means
if you're in the C<main> package and type