Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-ValidateRM CPAN distribution.

Report information
The Basics
Id: 15833
Status: resolved
Priority: 0/
Queue: CGI-Application-Plugin-ValidateRM

People
Owner: MARKSTOS [...] cpan.org
Requestors: william [...] knowmad.com
Cc:
AdminCc:

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



Subject: Helper function - load_dfv_profiles()
Hey Mark, I've got a function that loads my profiles from an external file into a hash. Instead of having to lug this sub from project to project, I was wondering if you had any interest in adding it to the plugin. Here's the rough version without any caching: sub load_dfv_profiles { my $self = shift; my $profiles = shift; # # Load DFV profiles my %prf; die "Invalid profile '$profiles'" unless defined $profiles && $profiles && -e $profiles; require $profiles or warn "Error loading profiles from '$profiles': $!"; die "Profiles not loaded" unless keys %prf; return \%prf; }
[guest - Tue Nov 15 13:48:50 2005]: Show quoted text
> Hey Mark, > > I've got a function that loads my profiles from an external file into > a hash. Instead of having to lug this sub from project to project, > I was wondering if you had any interest in adding it to the
plugin. Show quoted text
> Here's the rough version without any caching: > > sub load_dfv_profiles { > my $self = shift; > my $profiles = shift; > > # > # Load DFV profiles > my %prf; > die "Invalid profile '$profiles'" unless defined $profiles && > $profiles && -e $profiles; > require $profiles or warn "Error loading profiles from '$profiles': > $!"; > die "Profiles not loaded" unless keys %prf; > > return \%prf; > }
William, I'm not really interested in adding this since DFV already has built-in support for loading profiles from files, and this functionality isn't specific to C::A. Still, don't lug it from project to project. Put it in a super-class or plugin that is shared among projects. Mark