sparkylu has asked for the wisdom of the Perl Monks concerning the following question:

Salutations Monks!

I am running the following code on WIN 2000 server to connect to a DB that's running locally, however, i get the following error :

Software error: Can't use string ("") as a subroutine ref while "strict refs" in use at F:/Perl/site/lib/DBIx/ line 149

Any help will be much appreciated ....

#!f:/Perl/bin/perl.exe use DBI; use CGI::Lite; use CGI::Carp qw(fatalsToBrowser); use DBIx::Dump; my %data = $cgi->parse_form_data; ##read values that are passed #print distinct values of values of a db. #if values are not passed end... else call the subroutine -> display_d +ata() sub display_data { ##Write to Excel ## my $sth = $dbh->prepare("SELECT devicename,cadb,substatus,dns,ping,snm +p,dsiname,ovpi_st,sat,nnm,fqdn FROM consolidated_data where cadb like + '$cadb_pass' and substatus like '$substatus_pass' and dns like '$dn +s_pass' and ping like '$ping_pass' and snmp like '$snmp_pass' and ovp +i_st like '$ovpi_st_pass' and sat like '$sat_pass' and nnm like '$nnm +_pass' ORDER BY rowid"); $sth->execute() or die "Cannot execute sth: $DBI::errstr"; my $out = DBIx::Dump->new('format' => $format_pass, 'output' => $filename_pass, 'sth' => $sth); $out->dump( ); $sth->finish(); ###This above code works when used as stand alone code### #run the same query { print the results } $sth->finish(); $dbh->disconnect(); }
Update: changed the title