Sorry for posting this general Perl question, but I can't figure out what the
cause of my problems is. If someone can point me in the right direction I would
be most grateful.

I've tried looking in 'Programming Perl' and the FAQs but it seems that 
I'm to stupid to understand what I'm doing wrong. 

So I would like to ask two things: 

1  What am I doing wrong in the code below? 

2  Where can I find an explaination of the content of the BEGIN 
   block? I've tried reading 'Programming Perl' 3:ed and the 
   perlmod page but I still doesn't get it. 

Below are four files, when I do a syntax check on the content of 
'news.pl' I get the following error messages: 

File "Dokument:Scripts:Perl:JEM:Util.pm"; Line 16:  Subroutine 
formatDate redefined. 
File "Dokument:Scripts:Perl:JEM:Util.pm"; Line 20:  Subroutine 
formatTime redefined. 
File "Dokument:Scripts:Perl:JEM:Util.pm"; Line 24:  Subroutine trim 
redefined. 

But I can't figure out why I get this. I assume I'm doing some basic 
error ... 

I would be grateful for a pointer where to look. 

                 jem 

--- file news.pl 
#! perl -w 

use strict; 

use JEM::Info::PairParse; 

--- file PairParse.pm 
package JEM::Info::PairParse; 
use strict; 

BEGIN{ 
  use Exporter   (); 
  use vars    qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 
  $VERSION    = 0.1; 
  @ISA        = qw(Exporter); 
  @EXPORT     = qw(&parse); 
  %EXPORT_TAGS   = (); 
  @EXPORT_OK     = (); 
} 

use vars @EXPORT_OK; 

use JEM::Error; 
use JEM::Util; 

sub parse { 
  # content deleted 
} 

1; 
--- file Error.pm 
package JEM::Error; 
use strict; 

BEGIN{ 
  use Exporter   (); 
  use vars    qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 
  $VERSION    = 0.1; 
  @ISA        = qw(Exporter); 
  @EXPORT     = qw(&logFatalError &logWarning); 
  %EXPORT_TAGS   = (); 
  @EXPORT_OK     = (); 
} 
use vars @EXPORT_OK; 

use Jem::Util; 

sub logFatalError { 
  # content deleted 
} 

sub logWarning { 
  # content deleted 
} 

1; 
--- file Util.pm 
package JEM::Util; 
use strict; 

BEGIN{ 
  use Exporter   (); 
  use vars    qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 
  $VERSION    = 0.1; 
  @ISA        = qw(Exporter); 
  @EXPORT     = qw(&formatDate &formatTime &trim); 
  %EXPORT_TAGS   = (); 
  @EXPORT_OK     = (); 
} 

use vars @EXPORT_OK; 

sub formatDate{ 
  # content deleted 
} 

sub formatTime{ 
  # content deleted 
} 

sub trim { 
  # content deleted 
} 
1; 

--
Jan Erik Moström                             mailto:[EMAIL PROTECTED]
Free Elektron                      http://www.mostrom.pp.se/folk/jem/

Reply via email to