程序报错,可能是环境变量问题,帮忙看看,谢谢

程序报错,可能是环境变量问题,帮忙看看,谢谢

错误如下:
Perl lib version (v5.8.3) doesn't match executable version (v5.10.0) at d:\oracle\product\10.2.0\db_1\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 32.

我在执行一个perl程序的时候(windows操作系统),报上面的错误,我安装的perl环境是v5.10.0,我本机上装了oracle10g,上面的错误好像是程序默认去找oracle的perl了
估计得改环境变量吧,我对perl不熟悉,请问这个该怎么办?谢谢!

环境变量如下:
PERL5LIB:
d:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86;d:\oracle\product\10.2.0\db_1\perl\5.8.3\lib;d:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86;d:\oracle\product\10.2.0\db_1\perl\site\5.8.3;d:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib;d:\oracle\product\10.2.0\db_1\sysman\admin\scripts;

Path:
D:\Perl\site\bin;D:\Perl\bin;%JAVA_HOME%\bin;d:\oracle\product\10.2.0\db_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\IDM Computer Solutions\UltraEdit-32
贴出你的程序看看...
开一下cmd窗口,perl -v 看看你默认用的Perl版本
#!usr/bin/perl
use strict;
use warnings;
use Win32::OLE;

my $dir = 'D:\\myperl\\win32ole\\';
my $src_name = $dir."test1"."\.xls";
my $dst_name = $dir."test2"."\.xls";
my $nowstr;
my $app_xls = Win32::OLE->new('Excel.Application', sub{$_[0]->Quit}) or die"Can't install Excel01!";
my $src_sheet = $src_book->Worksheets(1);
$nowstr = $src_sheet->Cells(1,'A')->{Value};
print($nowstr);
$src_sheet->Cells(1,'A')->{Value}="change";

my $dst_book = $app_xls->WorkBooks->Open($dst_name);
my $dst_sheet = $dst_book->Worksheets(1);
$app_xls->{DisplayAlerts} = 'False';
#$dst_book->Worksheets(1)->Delete;

$src_book->Worksheets(1)->Copy($dst_book->Worksheets('sheet3'));  
$dst_book->Save;  
$app_xls->{DisplayAlerts} = 'True';

undef $src_book;
undef $dst_book;
undef $app_xls;


我是初学者,对perl不是很了解,在网上找到这个例子,在调用Win32::OLE的时候,就报那个错误了
D:\>perl -v

This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2007, Larry Wall

Binary build 1001 [283495] provided by ActiveState http://www.ActiveState.com
Built Dec 18 2007 08:46:15

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
环境变理中,这PERL5LIB部分直接删除掉.
PERL5LIB,这个是我oracle的环境变量,删了应该对oracle有影响吧!
先把它保存一下,删除后,测一下程序,然后在愎复呗.这样不就确定是不是环境变量的问题了吗?
呵呵,我删了,问题依旧,还是报那个错误
不晓得了,你贴出的程序在我机器上测试是报这个错误,Can't call method "Worksheets" on an undefined value at D:\MyPerl\test.pl line 12.  程序内部错误.