Subject: | Procedural interface does not export generate |
Hello,
the procedural interface of Color::Spectrum::Multi does not export the
generate function:
My script:
#!/usr/bin/env perl
use Color::Spectrum::Multi qw(generate);
########
$ ./script.pl
"generate" is not exported by the Color::Spectrum::Multi module
Can't continue after import errors at ./script.pl line 3
BEGIN failed--compilation aborted at ./script.pl line 3.
Next version:
#!/usr/bin/env perl
use Color::Spectrum::Multi;
my @color = generate(3,'#222222','#dddddd');
#######
$./script.pl
Undefined subroutine &main::generate called at ./script.pl line 4
When I use the fullyqualified version, everything is fine:
#!/usr/bin/env perl
use Color::Spectrum::Multi;
my @color = Color::Spectrum::Multi::generate(3,'#222222','#dddddd');
#######
The OO interface is fine.
As far as I see the attached patch would solve the problem.
Simply use the Exporter module...
Kind regards,
Philipp
Using perl from GNU/Linux Ubuntu oneiric
perl5 (revision 5 version 12 subversion 4)
Subject: | 0001-Added-export-of-generate.patch |
From a8e56e1d1d9ccc57b74a6fa13b957500ac151e93 Mon Sep 17 00:00:00 2001
From: Philipp Grau <phgrau@zedat.fu-berlin.de>
Date: Thu, 5 Jan 2012 14:29:55 +0100
Subject: [PATCH] Added export of generate
---
Multi.pm | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Multi.pm b/Multi.pm
index 3a301dc..3d98c1a 100644
--- a/Multi.pm
+++ b/Multi.pm
@@ -2,8 +2,12 @@ package Color::Spectrum::Multi;
use warnings;
use strict;
+use vars qw (@ISA @EXPORT @EXPORT_OK);
use base qw(Color::Spectrum);
+require Exporter;
+@ISA = qw(Exporter AutoLoader);
+@EXPORT = qw(generate);
=head1 NAME
--
1.7.5.4