]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 83633: perl warnings in 5.6
authorjustdave%syndicomm.com <>
Fri, 1 Jun 2001 17:03:52 +0000 (17:03 +0000)
committerjustdave%syndicomm.com <>
Fri, 1 Jun 2001 17:03:52 +0000 (17:03 +0000)
r= Hixie

importxml.pl

index b4b27b1e0bd1433f9243ef5fe08ee357854b714a..730c5a39c03164b5288fceaf49e7025cbeedb3e1 100755 (executable)
@@ -46,10 +46,15 @@ use strict;
 # figure out which path this script lives in. Set the current path to
 # this and add it to @INC so this will work when run as part of mail
 # alias by the mailer daemon
-my $path = $0;
-$path =~ s#(.*)/[^/]+#$1#;
-chdir $path;
-use lib ($path);
+# since "use lib" is run at compile time, we need to enclose the
+# $::path declaration in a BEGIN block so that it is executed before
+# the rest of the file is compiled.
+BEGIN {
+ $::path = $0;
+ $::path =~ s#(.*)/[^/]+#$1#;
+}
+chdir $::path;
+use lib ($::path);
 
 use XML::Parser;
 use Data::Dumper;