Skip Menu |

This queue is for tickets about the Net-MAC CPAN distribution.

Report information
The Basics
Id: 63017
Status: resolved
Priority: 0/
Queue: Net-MAC

People
Owner: OLIVER [...] cpan.org
Requestors: grail [...] goldweb.com.au
Cc:
AdminCc:

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



Subject: Net::MAC - un-obfuscate the class data?
Date: Tue, 16 Nov 2010 15:23:35 +1100
To: bug-Net-MAC [...] rt.cpan.org
From: Alex Satrapa <grail [...] goldweb.com.au>
I've been trying to extend the Net::MAC class to cater for some different formats (SNMP and weird vendor-specific strings). This has proven to be harder than I'd like, due to the use of a closure to hide the "class data and methods" outside of any namespace. For my purposes, I'd have been able to achieve my desired result by simply adding a new format spec to the "%_format_for" hash. As it stands, I've had to define my own "as_X" methods, and override the _discover method to handle the parsing of my specific formats, then pass everything on to the Net::MAC version of _discover - this makes my code longer than necessary, introduces more avenues for bugs (since I'm basically duplicating code), and makes my code look messy. Is there any possibility of removing that closure and just leave the Net::MAC class variables in the Net::MAC namespace where they can be modified by programmers who understand the risks?
On Mon Nov 15 23:23:50 2010, grail@goldweb.com.au wrote: Show quoted text
> I've been trying to extend the Net::MAC class to cater for some > different formats (SNMP and weird vendor-specific strings). This > has proven to be harder than I'd like, due to the use of a closure > to hide the "class data and methods" outside of any namespace. > > Is there any possibility of removing that closure and just leave the > Net::MAC class variables in the Net::MAC namespace where they can > be modified by programmers who understand the risks?
Yes this seems a reasonable request. I'll do the necessary development and if our tests pass then release to CPAN. Many thanks for reporting this issue! -- regards, oliver.
Hello, On Mon Nov 15 23:23:50 2010, grail@goldweb.com.au wrote: Show quoted text
> I've been trying to extend the Net::MAC class to cater for some > different formats (SNMP and weird vendor-specific strings).
I've uploaded a new version of the module to CPAN which includes support for custom MAC address formats. There is a new ->set_format_for() class method to install them, and a format option to new() as well. See the documentation for further details. Please let me know how you get on. regards, oliver. -- regards, oliver.
Subject: Re: [rt.cpan.org #63017] Net::MAC - un-obfuscate the class data?
Date: Wed, 29 Dec 2010 09:34:11 +1100
To: bug-Net-MAC [...] rt.cpan.org
From: Alex Satrapa <grail [...] goldweb.com.au>
On 29/12/2010, at 02:07 , Oliver Gorwits via RT wrote: Show quoted text
> I've uploaded a new version of the module to CPAN which includes support for custom MAC > address formats. There is a new ->set_format_for() class method to install them, and a > format option to new() as well. See the documentation for further details.
Thanks, I'll have a play with it promptly! Alex