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/Dump.pm 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

In reply to DBIx::Dump error - can't use string as subroutine ref by sparkylu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.