summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perldelta.pod3
-rw-r--r--x2p/find2perl.PL14
2 files changed, 16 insertions, 1 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index b71457ebc6..f8b5deaa86 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -460,6 +460,9 @@ C<perlcc -B> works now at least somewhat better, while C<perlcc -c>
is rather more broken. (The Perl compiler suite as a whole continues
to be experimental.)
+C<find2perl> now assumes C<-print> as a default action. It needed to be
+specified explicitly.
+
=head1 New Documentation
perl573delta has been added to list the differences between the
diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL
index 94cf242306..679ca3c05c 100644
--- a/x2p/find2perl.PL
+++ b/x2p/find2perl.PL
@@ -80,6 +80,7 @@ my $out = '';
my $declaresubs = "sub wanted;\n";
my %init = ();
my ($follow_in_effect,$Skip_And) = (0,0);
+my $print_needed = 1;
while (@ARGV) {
$_ = shift;
@@ -117,8 +118,10 @@ while (@ARGV) {
$out .= tab . "-$filetest _";
} elsif ($_ eq 'print') {
$out .= tab . 'print("$name\n")';
+ $print_needed = 0;
} elsif ($_ eq 'print0') {
$out .= tab . 'print("$name\0")';
+ $print_needed = 0;
} elsif ($_ eq 'fstype') {
my $type = shift;
$out .= tab;
@@ -183,6 +186,7 @@ while (@ARGV) {
$declaresubs .= "sub doexec (\$\@);\n";
$init{doexec} = 1;
}
+ $print_needed = 0;
} elsif ($_ eq 'ok') {
my @cmd = ();
while (@ARGV && $ARGV[0] ne ';')
@@ -194,6 +198,7 @@ while (@ARGV) {
{ local $" = "','"; $out .= "doexec(1, '@cmd')"; }
$declaresubs .= "sub doexec (\$\@);\n";
$init{doexec} = 1;
+ $print_needed = 0;
} elsif ($_ eq 'prune') {
$out .= tab . '($File::Find::prune = 1)';
} elsif ($_ eq 'xdev') {
@@ -217,6 +222,7 @@ while (@ARGV) {
$out .= tab . "ls";
$declaresubs .= "sub ls ();\n";
$init{ls} = 1;
+ $print_needed = 0;
} elsif ($_ eq 'tar') {
die "-tar must have a filename argument\n" unless @ARGV;
my $file = shift;
@@ -258,6 +264,10 @@ while (@ARGV) {
}
}
+if ($print_needed) {
+ $out .= "\n" . tab . '&& print("$name\n")';
+}
+
print <<"END";
$startperl
@@ -833,7 +843,9 @@ True if last-modified time of file matches N.
=item C<-print>
-Print out path of file (always true).
+Print out path of file (always true). If none of C<-exec>, C<-ls>,
+C<-print0>, or C<-ok> is specified, then C<-print> will be added
+implicitly.
=item C<-print0>