Skip Menu |

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 131097
Status: resolved
Priority: 0/
Queue: File-Slurp

People
Owner: cwhitener [...] gmail.com
Requestors: michaelclark [...] siemens-healthineers.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Documentation oops
Date: Wed, 27 Nov 2019 19:52:21 +0000
To: "bug-File-Slurp [...] rt.cpan.org" <bug-File-Slurp [...] rt.cpan.org>
From: "Clark, Michael" <michaelclark [...] siemens-healthineers.com>
On meta cpan<https://metacpan.org/pod/File::Slurp>, there are several examples that use File::Spec instead of File::Slurp. [cid:image001.jpg@01D5A532.44EF50E0] Cheers, Mike
Download image001.jpg
image/jpeg 13.9k
image001.jpg
Wow. You're absolutely right. Thanks for pointing it out. I'll get it fixed ASAP. Thanks, Chase
Subject: Re: [rt.cpan.org #131097] Documentation oops
Date: Wed, 27 Nov 2019 15:01:32 -0500
To: bug-File-Slurp [...] rt.cpan.org
From: Uri Guttman <uri [...] stemsystems.com>
On 11/27/19 3:00 PM, Chase Whitener via RT wrote: Show quoted text
> Queue: File-Slurp > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131097 > > > Wow. You're absolutely right. Thanks for pointing it out. I'll get it fixed ASAP. > > Thanks, > Chase
he reported it to me. there are at least 3 spec's instead of slurp in use lines. there is a legit reference to file::spec in the read_dir docs (prefix option). thanx, uri
Indeed. The fix would look like this...
Subject: foo.diff
diff --git a/lib/File/Slurp.pm b/lib/File/Slurp.pm index 5d77403..e059e07 100644 --- a/lib/File/Slurp.pm +++ b/lib/File/Slurp.pm @@ -671,7 +671,7 @@ L<File::Slurp> implements the following functions. =head2 append_file - use File::Spec qw(append_file write_file); + use File::Slurp qw(append_file write_file); my $res = append_file('/path/file', "Some text"); # same as my $res = write_file('/path/file', {append => 1}, "Some text"); @@ -761,7 +761,7 @@ function. =head2 overwrite_file - use File::Spec qw(overwrite_file); + use File::Slurp qw(overwrite_file); my $res = overwrite_file('/path/file', "Some text"); The C<overwrite_file> function is simply a synonym for the @@ -798,7 +798,7 @@ a consistent file. =head2 read_dir - use File::Spec qw(read_dir); + use File::Slurp qw(read_dir); my @files = read_dir('/path/to/dir'); # all files, even the dots my @files = read_dir('/path/to/dir', keep_dot_dot => 1); @@ -947,7 +947,7 @@ copy of the file to return. =head2 rf - use File::Spec qw(rf); + use File::Slurp qw(rf); my $text = rf('/path/file'); The C<rf> function is simply a synonym for the L<File::Slurp/"read_file"> @@ -955,7 +955,7 @@ function. =head2 slurp - use File::Spec qw(slurp); + use File::Slurp qw(slurp); my $text = slurp('/path/file'); The C<slurp> function is simply a synonym for the L<File::Slurp/"read_file"> @@ -963,7 +963,7 @@ function. =head2 wf - use File::Spec qw(wf); + use File::Slurp qw(wf); my $res = wf('/path/file', "Some text");
Subject: Re: [rt.cpan.org #131097] Documentation oops
Date: Wed, 27 Nov 2019 15:19:35 -0500
To: bug-File-Slurp [...] rt.cpan.org
From: Uri Guttman <uri [...] stemsystems.com>
On 11/27/19 3:06 PM, Chase Whitener via RT wrote: Show quoted text
> Queue: File-Slurp > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131097 > > > Indeed. The fix would look like this...
looks good to me. on a side note, i added the 2 letter versions so they could be used in one liners. but loading them isn't short. i had an idea for a FS.pm to be optionally installable (or a separate distro) and it loads slurp and exports all the 2 letter aliases. then you could do stuff like: perl -MFS -e 'efl {s/foo/bar/} filename' instead of the -i method. only downside is no option for a backup file. uri
Hi Mike, Thanks again for reporting this. The fix has landed in https://github.com/perhunter/slurp/commit/cc9a00b65d7ac47f36a6e2c25549396050241851 and a release will be cut soon to correct it for everyone. Please let us know if you notice any further issues! Thanks, Chase
Subject: RE: [rt.cpan.org #131097] Documentation oops
Date: Wed, 27 Nov 2019 23:15:34 +0000
To: "bug-File-Slurp [...] rt.cpan.org" <bug-File-Slurp [...] rt.cpan.org>
From: "Clark, Michael" <michaelclark [...] siemens-healthineers.com>
You're most welcome. I've never used this ticketing system, and TBH, I didn't expect any response at all. So wow, I'm so pleasantly surprised that, first, I got a response from a human, and second, that you got the fix rolling immediately. Well done! Regards from Tennessee, Mike Show quoted text
-----Original Message----- From: Chase Whitener via RT <bug-File-Slurp@rt.cpan.org> Sent: Wednesday, November 27, 2019 3:32 PM To: Clark, Michael (SHS CS MI SLM KNV) <michaelclark@siemens-healthineers.com> Subject: [rt.cpan.org #131097] Documentation oops <URL: https://rt.cpan.org/Ticket/Display.html?id=131097 > Hi Mike, Thanks again for reporting this. The fix has landed in https://github.com/perhunter/slurp/commit/cc9a00b65d7ac47f36a6e2c25549396050241851 and a release will be cut soon to correct it for everyone. Please let us know if you notice any further issues! Thanks, Chase