Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: sharyanto [...] cpan.org
Cc:
AdminCc:

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



Subject: Disable autodie when errmode=quiet is specified?
Download (untitled) / with headers
text/plain 228b
When doing read_file(FILE, errmode=>'quiet') under 'use autodie', Perl still dies on error, e.g. if the file does not exist. Wishlist: Since we have specifically requested errmode, how about 'no autodie' inside read_file()?
Sorry, disregard this bug report. Obviously 'use autodie' is lexical and is not in play here.
Download (untitled) / with headers
text/plain 277b
On Wed Nov 24 06:02:41 2010, SHARYANTO wrote: Show quoted text
> Sorry, disregard this bug report. Obviously 'use autodie' is lexical
and Show quoted text
> is not in play here.
The mistake is of course on the typo errmode -> err_mode. It would be nice though to emit a warning/error on mistyped arguments.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #63301] Disable autodie when errmode=quiet is specified?
Date: Wed, 24 Nov 2010 11:35:40 -0500
To: bug-File-Slurp [...] rt.cpan.org
From: "Uri Guttman" <uri [...] StemSystems.com>
Download (untitled) / with headers
text/plain 773b
Show quoted text
>>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org> writes:
Show quoted text
shvR> Queue: File-Slurp shvR> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63301 >
Show quoted text
shvR> On Wed Nov 24 06:02:41 2010, SHARYANTO wrote:
Show quoted text
>> Sorry, disregard this bug report. Obviously 'use autodie' is lexical
Show quoted text
shvR> and
Show quoted text
>> is not in play here.
Show quoted text
shvR> The mistake is of course on the typo errmode -> err_mode. It would be shvR> nice though to emit a warning/error on mistyped arguments.
no one does that in general. uri -- Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
Download (untitled) / with headers
text/plain 715b
On Wed Nov 24 11:35:58 2010, uri@stemsystems.com wrote: Show quoted text
> >>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org>
> writes: >
> shvR> Queue: File-Slurp > shvR> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63301
> >
>
> shvR> On Wed Nov 24 06:02:41 2010, SHARYANTO wrote:
> >> Sorry, disregard this bug report. Obviously 'use autodie' is
> lexical
> shvR> and
> >> is not in play here.
>
> shvR> The mistake is of course on the typo errmode -> err_mode. It
> would be
> shvR> nice though to emit a warning/error on mistyped arguments.
> > no one does that in general.
Hi Uri, Are you saying that no one makes typos, in general? Because I do, lots of time. -- sh
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #63301] Disable autodie when errmode=quiet is specified?
Date: Wed, 24 Nov 2010 11:46:33 -0500
To: bug-File-Slurp [...] rt.cpan.org
From: "Uri Guttman" <uri [...] StemSystems.com>
Download (untitled) / with headers
text/plain 1.4k
Show quoted text
>>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org> writes:
Show quoted text
shvR> Queue: File-Slurp shvR> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63301 >
Show quoted text
shvR> On Wed Nov 24 11:35:58 2010, uri@stemsystems.com wrote:
Show quoted text
>> >>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org>
>> writes: >>
Show quoted text
shvR> Queue: File-Slurp shvR> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63301
Show quoted text
>> >
>>
Show quoted text
shvR> On Wed Nov 24 06:02:41 2010, SHARYANTO wrote:
Show quoted text
>> >> Sorry, disregard this bug report. Obviously 'use autodie' is
>> lexical
Show quoted text
shvR> and
Show quoted text
>> >> is not in play here.
>>
Show quoted text
shvR> The mistake is of course on the typo errmode -> err_mode. It
Show quoted text
>> would be
Show quoted text
shvR> nice though to emit a warning/error on mistyped arguments.
Show quoted text
>> >> no one does that in general.
Show quoted text
shvR> Hi Uri,
Show quoted text
shvR> Are you saying that no one makes typos, in general? Because I do, lots shvR> of time.
no. very few modules barf on unknown options. it means tracking all possible options in each sub, deleting them as they get processed correctly and then barfing on what is left. it is a fair amount of code and will slow things down. slurp is already getting more bloated with features as it is. uri -- Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
Download (untitled) / with headers
text/plain 981b
On Wed Nov 24 11:46:42 2010, uri@stemsystems.com wrote: Show quoted text
> no. very few modules barf on unknown options. it means tracking all > possible options in each sub, deleting them as they get processed > correctly and then barfing on what is left. it is a fair amount of > code > and will slow things down. slurp is already getting more bloated with > features as it is.
At least 4 modules which I currently use daily do that (warn/barf on unknown options): App::options, Getopt::Long, Config::IniFiles, Log::Any::App (okay, the last one is my own module). Checking for unknown options can be very simple, just maintain a hash of known options (yes, a duplicate from individual option processing code, but this also serves as a double check) and add a line to check against the hash. Also, I don't buy the "slow things down" argument. Do people call usually read_file() and write_file() many thousands times a second? Of course, these are all just suggestions. Regards, Steven
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #63301] Disable autodie when errmode=quiet is specified?
Date: Wed, 24 Nov 2010 13:23:58 -0500
To: bug-File-Slurp [...] rt.cpan.org
From: "Uri Guttman" <uri [...] StemSystems.com>
Show quoted text
>>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org> writes:
Show quoted text
shvR> At least 4 modules which I currently use daily do that (warn/barf on shvR> unknown options): App::options, Getopt::Long, Config::IniFiles, shvR> Log::Any::App (okay, the last one is my own module).
well i would expect option parsing modules to do that!! and possibly config modules. so that leaves one module which is yours. Show quoted text
shvR> Checking for unknown options can be very simple, just maintain a hash shvR> of known options (yes, a duplicate from individual option processing shvR> code, but this also serves as a double check) and add a line to check shvR> against the hash.
i know how to do it. i don't want to do it. it isn't common for general modules. sorry but this is off the table. i have way too many other more important features and tests to add to slurp. thanx, uri -- Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.