Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

[doc] Missing `;` in code snippet in perlfaq5 #22098

Closed ikegami closed 1 month ago

ikegami commented 1 month ago

Search for slurp, and you'll find the following:

open my $in,  '<',  $file      or die "Can't read old file: $!"
open my $out, '>', "$file.new" or die "Can't write new file: $!";

my $content = do { local $/; <$in> }; # slurp!

    # do your magic here

print $out $content;

The first statement isn't terminated by a semi-colon.

choroba commented 1 month ago

Might be better to move to https://github.com/perl-doc-cats/perlfaq.

https://github.com/perl-doc-cats/perlfaq/blob/c2b59dcb3a26533921a9e0d38377ce8eeced66d6/lib/perlfaq5.pod#L194

rwp0 commented 1 month ago

Thanks @ikegami but why not create a PR instead?

https://github.com/perl-doc-cats/perlfaq/pull/119

rwp0 commented 1 month ago

Merged, thanks @davorg

Can close the issue I guess.

ikegami commented 1 month ago

Thanks @ikegami but why not create a PR instead?

I bet it took you less than 30 seconds to create it with the precise info I provided. Me, I wasn't even looking in the right repo...

rwp0 commented 1 month ago

@ikegami now that the PR is merged, can you close the issue please?