in reply to Re^3: perl DBI special variable problem
in thread perl DBI special variable problem

In my application, most of the files include $ora_errstr=""; line. Earlier it was working fine.Now since we upgraded perl, oraperl(DBI & DBD). All these scripts are failing due to this initialization. We can remove those lines($ora_errstr="";) but it needs lot of effort. I'm not sure how come it was working for previous versions not for new versions. Can anyone help?
  • Comment on Re^4: perl DBI special variable problem

Replies are listed 'Best First'.
Re^5: perl DBI special variable problem
by graff (Chancellor) on Apr 08, 2006 at 08:03 UTC
    We can remove those lines($ora_errstr="";) but it needs lot of effort.

    How much effort is it to do this?

    perl -i.bak -pe 's/(\$ora_errstr="";)/\# $1/' *.pl
    That assumes all your perl script files have a ".pl" extenstion; if that's not the case, just create a simple plain-text list of the names of the script files to be edited, and do it like this:
    xargs perl -i.bak -pe 's/(\$ora_errstr="";)/\# $1/' < file.list
    (xargs is a standard unix tool; it you're using ms-windows, just get one of the windows ports of unix tools)

    Of course, it sounds like a more profound rewrite might be in order, to get away from the old oraperl paradigm, but just removing the offending line from your scripts might get things running well enough that stuff will work while you hammer out the next version of your code.