source: gsdl/trunk/perllib/XMLParser.pm@ 19617

Last change on this file since 19617 was 15894, checked in by mdewsnip, 16 years ago

Added "use strict" to the files missing it.

  • Property svn:keywords set to Author Date Id Revision
File size: 800 bytes
Line 
1# Wrapper that ensures the right version of XML::Parser is loaded given
2# the version of Perl being used. Need to distinguish between Perl 5.6 and
3# Perl 5.8
4
5
6sub BEGIN {
7 my $perl_dir;
8
9 # Note: $] encodes the version number of perl
10 if ($]>5.008) {
11 # perl 5.8.1 or above
12 $perl_dir = "perl-5.8";
13 }
14 elsif ($]<5.008) {
15 # assume perl 5.6
16 $perl_dir = "perl-5.6";
17 }
18 else {
19 print STDERR "Warning: Perl 5.8.0 is not a maintained release.\n";
20 print STDERR " Please upgrade to a newer version of Perl.\n";
21 $perl_dir = "perl-5.8";
22 }
23
24 if ($ENV{'GSDLOS'} !~ /^windows$/i) {
25 # Use push to put this on the end, so an existing XML::Parser will be used by default
26 push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir");
27 }
28}
29
30use XML::Parser;
31use strict;
32
331;
Note: See TracBrowser for help on using the repository browser.