无法在@INC中找到CGI / Ajax.pm(@INC包含:

时间:2013-07-10 04:42:24

标签: ajax perl

当我使用shebang(#!/ usr / local / bin / perl)时,错误就是那个

DBI connect('SQLSERVER','ivr',...)失败:[unixODBC] [驱动程序管理器]未找到数据源名称,并且未指定默认驱动程序(SQL-IM002)....

如果我使用shebang(#!/ usr / bin / perl),那么我得到以下错误:

Can't locate CGI/Ajax.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi.... 

代码如下:

    #!/usr/bin/perl
    use strict;
    use DBI qw(:sql_types);
    use CGI;
    use CGI qw/:standard/;
    use CGI::Ajax;

    my $cgi = new CGI();

    my $ajax = new CGI::Ajax( 'saveStudInfo_JScript' => \&saveStudInfo_PerlScript );
    $cgi->header(-charset=>'US-ASCII');
    print $ajax->build_html($cgi,\&generateHTML);

Error   
        Can't locate CGI/Ajax.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi....


    #!/usr/local/bin/perl
    use strict;
    use DBI qw(:sql_types);
    use CGI;
    use CGI qw/:standard/;
    use CGI::Ajax;

    my $cgi = new CGI();
    my $ajax = new CGI::Ajax( 'saveStudInfo_JScript' => \&saveStudInfo_PerlScript );

    $cgi->header(-charset=>'US-ASCII');
    print $ajax->build_html($cgi,\&generateHTML);


Error

DBI connect('SQLSERVER','ivr',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002)....


    $ instmodsh
    Available commands are:
       l            - List all installed modules
       m <module>   - Select a module
       q            - Quit the program
    cmd? l
    Installed modules are:
       CGI::Ajax
       Class::Accessor
       DBD::ODBC
       DBI
       Date::Manip
       Date::Parse

我已经安装了DBI并正确定义了驱动程序。

0 个答案:

没有答案