summaryrefslogtreecommitdiff
path: root/pod/perlipc.pod
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2014-10-10 10:12:09 +0300
committerJames E Keenan <jkeenan@cpan.org>2014-10-15 19:04:14 -0400
commit8bc5de207a4b3d333e9c6535bd21b8f0b1381270 (patch)
treea44e7e40dc7eaf882672f258e76f1ed0f63aa65d /pod/perlipc.pod
parent4a573b25e5d1b2bb3e3043a95e14fb595dbeca85 (diff)
downloadperl-8bc5de207a4b3d333e9c6535bd21b8f0b1381270.tar.gz
Modernized an example in perlipc.pod.
1. Convert to use strict + use warnings. 2. Changed a while(++ loop) to while(1) { ++ }. Committer revised patch per suggestions in RT # 122938.
Diffstat (limited to 'pod/perlipc.pod')
-rw-r--r--pod/perlipc.pod11
1 files changed, 7 insertions, 4 deletions
diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index 2e80d0d39f..49c605b638 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -188,12 +188,15 @@ itself every time the C<SIGHUP> signal is received. The actual code is
located in the subroutine C<code()>, which just prints some debugging
info to show that it works; it should be replaced with the real code.
- #!/usr/bin/perl -w
+ #!/usr/bin/perl
+
+ use strict;
+ use warnings;
use POSIX ();
use FindBin ();
use File::Basename ();
- use File::Spec::Functions;
+ use File::Spec::Functions qw(catfile);
$| = 1;
@@ -214,9 +217,9 @@ info to show that it works; it should be replaced with the real code.
print "PID: $$\n";
print "ARGV: @ARGV\n";
my $count = 0;
- while (++$count) {
+ while (1) {
sleep 2;
- print "$count\n";
+ print ++$count, "\n";
}
}