Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Hash-FieldHash CPAN distribution.

Report information
The Basics
Id: 52073
Status: resolved
Priority: 0/
Queue: Hash-FieldHash

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

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



Subject: No error if method name matches field hash name
Hi I'd like an error to be produced when a field hash name matches a method name. This is perhaps most likely when inheriting from another class. Sample code (X.pm): package X; use Hash::FieldHash qw(:all); fieldhash my %marine => 'marine'; # ----------------------------------------------- sub new { my($class) = @_; my($self) = bless {}, $class; $self -> marine; return $self; } # End of new. # ----------------------------------------------- sub marine { print "Invisible msg. \n"; } # ----------------------------------------------- 1; x.pl: #!/usr/bin/perl use lib '.'; use strict; use warnings; use X; # ---- my($x) = X -> new(); $x -> marine(99); print 'marine: ', $x -> marine, "\n"; ------------ $many x $thanx. Cheers
Hi,

I have shipped 0.09, which makes warnings on subroutine redefinition. If you prefer a fatal error, you can say "use warnings FATAL => 'redefine'":

use Hash::FieldHash qw(:all);
use warnings FATAL => 'redefine';
fieldhash my %marine => 'marine'; # bomb!

sub marine { ... }

Regards,
--
Goro Fuji (gfx) GFUJI at CPAN.org
(resolved)
--
Goro Fuji (gfx) GFUJI at CPAN.org
Subject: Re: [rt.cpan.org #52073] No error if method name matches field hash name
Date: Wed, 06 Jan 2010 23:26:24 +0000
To: bug-Hash-FieldHash [...] rt.cpan.org
From: ron [...] savage.net.au
Hi Fuji Beautiful! Quoting "Goro Fuji via RT" <bug-Hash-FieldHash@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=52073 > > > Hi, > > I have shipped 0.09, which makes warnings on subroutine redefinition. If you > prefer a fatal error, you can say "use warnings FATAL => 'redefine'": > > use Hash::FieldHash qw(:all); > use warnings FATAL => 'redefine'; > fieldhash my %marine => 'marine'; # bomb! > > sub marine { ... } > > Regards, > -- > Goro Fuji (gfx) GFUJI at CPAN.org > >
(resolved) -- Goro Fuji (gfx) GFUJI at CPAN.org