Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 9890bc3

Browse files
committed
perlfaq-5.20180915
1 parent bd7dd8a commit 9890bc3

File tree

15 files changed

+87
-87
lines changed

15 files changed

+87
-87
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ package Maintainers;
11621162
},
11631163

11641164
'perlfaq' => {
1165-
'DISTRIBUTION' => 'LLAP/perlfaq-5.021011.tar.gz',
1165+
'DISTRIBUTION' => 'LLAP/perlfaq-5.20180915.tar.gz',
11661166
'FILES' => q[cpan/perlfaq],
11671167
'EXCLUDED' => [
11681168
qw( inc/CreateQuestionList.pm

cpan/perlfaq/lib/perlfaq.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use strict;
22
use warnings;
33
package perlfaq;
4-
$perlfaq::VERSION = '5.021011';
4+
5+
our $VERSION = '5.20180915';
6+
57
1;

cpan/perlfaq/lib/perlfaq.pod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=head1 NAME
22

3-
perlfaq - frequently asked questions about Perl
3+
perlfaq - Frequently asked questions about Perl
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -697,15 +697,15 @@ How can I use a filehandle indirectly?
697697

698698
=item *
699699

700-
How can I set up a footer format to be used with write()?
700+
How can I open a filehandle to a string?
701701

702702
=item *
703703

704-
How can I write() into a string?
704+
How can I set up a footer format to be used with write()?
705705

706706
=item *
707707

708-
How can I open a filehandle to a string?
708+
How can I write() into a string?
709709

710710
=item *
711711

@@ -725,7 +725,7 @@ Why do I sometimes get an "Argument list too long" when I use E<lt>*E<gt>?
725725

726726
=item *
727727

728-
How can I open a file with a leading "E<gt>" or trailing blanks?
728+
How can I open a file named with a leading "E<gt>" or trailing blanks?
729729

730730
=item *
731731

cpan/perlfaq/lib/perlfaq1.pod

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq1 - General Questions About Perl
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -42,7 +42,6 @@ are a group of highly altruistic individuals committed to
4242
producing better software for free than you could hope to purchase for
4343
money. You may snoop on pending developments via the
4444
L<archives|http://www.nntp.perl.org/group/perl.perl5.porters/>
45-
or read the L<faq|http://dev.perl.org/perl5/docs/p5p-faq.html>,
4645
or you can subscribe to the mailing list by sending
4746
perl5-porters-subscribe@perl.org a subscription request
4847
(an empty message with no subject is fine).
@@ -58,12 +57,11 @@ users the informal support will more than suffice. See the answer to
5857

5958
=head2 Which version of Perl should I use?
6059

61-
(contributed by brian d foy)
60+
(contributed by brian d foy with updates from others)
6261

6362
There is often a matter of opinion and taste, and there isn't any one
6463
answer that fits everyone. In general, you want to use either the current
6564
stable release, or the stable release immediately prior to that one.
66-
Currently, those are perl5.18.x and perl5.16.x, respectively.
6765

6866
Beyond that, you have to consider several things and decide which is best
6967
for you.
@@ -81,14 +79,21 @@ The latest versions of perl have more bug fixes.
8179

8280
=item *
8381

82+
The latest versions of perl may contain performance improvements and
83+
features not present in older versions. There have been many changes
84+
in perl since perl5 was first introduced.
85+
86+
=item *
87+
8488
The Perl community is geared toward supporting the most recent releases,
8589
so you'll have an easier time finding help for those.
8690

8791
=item *
8892

89-
Versions prior to perl5.004 had serious security problems with buffer
90-
overflows, and in some cases have CERT advisories (for instance,
91-
L<http://www.cert.org/advisories/CA-1997-17.html> ).
93+
Older versions of perl may have security vulnerabilities, some of which
94+
are serious (see L<perlsec> and search
95+
L<CVEs|https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=Perl> for more
96+
information).
9297

9398
=item *
9499

@@ -98,23 +103,23 @@ problems others have if you are risk averse.
98103

99104
=item *
100105

101-
The immediate, previous releases (i.e. perl5.14.x ) are usually maintained
102-
for a while, although not at the same level as the current releases.
103-
104-
=item *
105-
106-
No one is actively supporting Perl 4. Ten years ago it was a dead
107-
camel carcass (according to this document). Now it's barely a skeleton
108-
as its whitewashed bones have fractured or eroded.
106+
The immediate, in addition to the current stable release, the previous
107+
stable release is maintained. See
108+
L<perlpolicy/"MAINTENANCE AND SUPPORT"> for more information.
109109

110110
=item *
111111

112112
There are really two tracks of perl development: a maintenance version
113113
and an experimental version. The maintenance versions are stable, and
114-
have an even number as the minor release (i.e. perl5.18.x, where 18 is the
114+
have an even number as the minor release (i.e. perl5.24.x, where 24 is the
115115
minor release). The experimental versions may include features that
116116
don't make it into the stable versions, and have an odd number as the
117-
minor release (i.e. perl5.19.x, where 19 is the minor release).
117+
minor release (i.e. perl5.25.x, where 25 is the minor release).
118+
119+
=item *
120+
121+
You can consult L<releases|http://dev.perl.org/perl5> to determine the
122+
current stable release of Perl.
118123

119124
=back
120125

cpan/perlfaq/lib/perlfaq2.pod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq2 - Obtaining and Learning about Perl
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -85,8 +85,7 @@ contains tens of thousands of modules and extensions, source code
8585
and documentation, designed for I<everything> from commercial
8686
database interfaces to keyboard/screen control and running large web sites.
8787

88-
You can search CPAN on L<http://metacpan.org> or
89-
L<http://search.cpan.org/>.
88+
You can search CPAN on L<http://metacpan.org>.
9089

9190
The master web site for CPAN is L<http://www.cpan.org/>,
9291
L<http://www.cpan.org/SITES.html> lists all mirrors.

cpan/perlfaq/lib/perlfaq3.pod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq3 - Programming Tools
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -940,9 +940,8 @@ You probably won't see much of a speed increase either, since most
940940
solutions simply bundle a Perl interpreter in the final product
941941
(but see L<How can I make my Perl program run faster?>).
942942

943-
The Perl Archive Toolkit ( L<http://par.perl.org/> ) is Perl's
944-
analog to Java's JAR. It's freely available and on CPAN (
945-
L<http://search.cpan.org/dist/PAR/> ).
943+
The Perl Archive Toolkit is Perl's analog to Java's JAR. It's freely
944+
available and on CPAN ( L<https://metacpan.org/pod/PAR> ).
946945

947946
There are also some commercial products that may work for you, although
948947
you have to buy a license for them.

cpan/perlfaq/lib/perlfaq4.pod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq4 - Data Manipulation
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -128,10 +128,9 @@ need yourself.
128128
To see why, notice how you'll still have an issue on half-way-point
129129
alternation:
130130

131-
for (my $i = 0; $i < 1.01; $i += 0.05) { printf "%.1f ",$i}
131+
for (my $i = -5; $i <= 5; $i += 0.5) { printf "%.0f ",$i }
132132

133-
0.0 0.1 0.1 0.2 0.2 0.2 0.3 0.3 0.4 0.4 0.5 0.5 0.6 0.7 0.7
134-
0.8 0.8 0.9 0.9 1.0 1.0
133+
-5 -4 -4 -4 -3 -2 -2 -2 -1 -0 0 0 1 2 2 2 3 4 4 4 5
135134

136135
Don't blame Perl. It's the same as in C. IEEE says we have to do
137136
this. Perl numbers whose absolute values are integers under 2**31 (on
@@ -2664,7 +2663,7 @@ The arrays.h/arrays.c code in the L<PGPLOT> module on CPAN does just this.
26642663
If you're doing a lot of float or double processing, consider using
26652664
the L<PDL> module from CPAN instead--it makes number-crunching easy.
26662665

2667-
See L<http://search.cpan.org/dist/PGPLOT> for the code.
2666+
See L<https://metacpan.org/release/PGPLOT> for the code.
26682667

26692668

26702669
=head1 AUTHOR AND COPYRIGHT

cpan/perlfaq/lib/perlfaq5.pod

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq5 - Files and Formats
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -626,6 +626,25 @@ related to whether they're strings, typeglobs, objects, or anything else.
626626
It's the syntax of the fundamental operators. Playing the object
627627
game doesn't help you at all here.
628628

629+
=head2 How can I open a filehandle to a string?
630+
X<string> X<open> X<IO::String> X<filehandle>
631+
632+
(contributed by Peter J. Holzer, hjp-usenet2@hjp.at)
633+
634+
Since Perl 5.8.0 a file handle referring to a string can be created by
635+
calling open with a reference to that string instead of the filename.
636+
This file handle can then be used to read from or write to the string:
637+
638+
open(my $fh, '>', \$string) or die "Could not open string for writing";
639+
print $fh "foo\n";
640+
print $fh "bar\n"; # $string now contains "foo\nbar\n"
641+
642+
open(my $fh, '<', \$string) or die "Could not open string for reading";
643+
my $x = <$fh>; # $x now contains "foo\n"
644+
645+
With older versions of Perl, the L<IO::String> module provides similar
646+
functionality.
647+
629648
=head2 How can I set up a footer format to be used with write()?
630649
X<footer>
631650

@@ -684,25 +703,6 @@ accumulator variable C<$^A>, but you lose a lot of the value of formats
684703
since C<formline> won't handle paging and so on. You end up reimplementing
685704
formats when you use them.
686705

687-
=head2 How can I open a filehandle to a string?
688-
X<string> X<open> X<IO::String> X<filehandle>
689-
690-
(contributed by Peter J. Holzer, hjp-usenet2@hjp.at)
691-
692-
Since Perl 5.8.0 a file handle referring to a string can be created by
693-
calling open with a reference to that string instead of the filename.
694-
This file handle can then be used to read from or write to the string:
695-
696-
open(my $fh, '>', \$string) or die "Could not open string for writing";
697-
print $fh "foo\n";
698-
print $fh "bar\n"; # $string now contains "foo\nbar\n"
699-
700-
open(my $fh, '<', \$string) or die "Could not open string for reading";
701-
my $x = <$fh>; # $x now contains "foo\n"
702-
703-
With older versions of Perl, the L<IO::String> module provides similar
704-
functionality.
705-
706706
=head2 How can I output my numbers with commas added?
707707
X<number, commify>
708708

@@ -850,7 +850,7 @@ To get around this, either upgrade to Perl v5.6.0 or later, do the glob
850850
yourself with readdir() and patterns, or use a module like L<File::Glob>,
851851
one that doesn't use the shell to do globbing.
852852

853-
=head2 How can I open a file with a leading ">" or trailing blanks?
853+
=head2 How can I open a file named with a leading ">" or trailing blanks?
854854
X<filename, special characters>
855855

856856
(contributed by Brian McCauley)

cpan/perlfaq/lib/perlfaq6.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq6 - Regular Expressions
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

cpan/perlfaq/lib/perlfaq7.pod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ perlfaq7 - General Perl Language Issues
44

55
=head1 VERSION
66

7-
version 5.021011
7+
version 5.20180915
88

99
=head1 DESCRIPTION
1010

@@ -695,19 +695,19 @@ details, see L<perlsub>.
695695

696696
=head2 How do I create a switch or case statement?
697697

698-
In Perl 5.10, use the C<given-when> construct described in L<perlsyn>:
698+
There is a given/when statement in Perl, but it is experimental and
699+
likely to change in future. See L<perlsyn> for more details.
699700

700-
use 5.010;
701+
The general answer is to use a CPAN module such as L<Switch::Plain>:
701702

702-
given ( $string ) {
703-
when( 'Fred' ) { say "I found Fred!" }
704-
when( 'Barney' ) { say "I found Barney!" }
705-
when( /Bamm-?Bamm/ ) { say "I found Bamm-Bamm!" }
706-
default { say "I don't recognize the name!" }
707-
};
703+
use Switch::Plain;
704+
sswitch($variable_holding_a_string) {
705+
case 'first': { }
706+
case 'second': { }
707+
default: { }
708+
}
708709

709-
If one wants to use pure Perl and to be compatible with Perl versions
710-
prior to 5.10, the general answer is to use C<if-elsif-else>:
710+
or for more complicated comparisons, C<if-elsif-else>:
711711

712712
for ($variable_to_test) {
713713
if (/pat1/) { } # do something

0 commit comments

Comments
 (0)