On Tue, Jul 02, 2002 at 09:09:36AM -0400, Ronald J Kimball wrote:
> On Tue, Jul 02, 2002 at 08:50:02AM -0400, Hapworth, Adam wrote:
> > 
> > I found that were were previously set but I set them in the script according
> > to the DBD::Oracle docs.  Here is a trimed down script and then the output I
> > am receiving.
> > NOTE: I receive a "No such file or directory" for :0 and :1 if I do not
> > include the "use Data::Dumper;" line.  I am still not sure why.
> 
> `perldoc perlvar`
> 
>        $!      If used in a numeric context, yields the current
>                value of errno, with all the usual caveats.  (This
>                means that you shouldn't depend on the value of $!
>                to be anything in particular unless you've gotten
>                a specific error return indicating a system
>                error.)  If used in a string context, yields the
>                corresponding system error string.
> 
> Note the parenthetical.
> 
> > 
> > #!/usr/bin/perl5 -w
> > print $?."0\n";
> > print $!.":0\n";
> > 
> > [snip code containing further invalid uses of $!]
> 
> Don't print $! unless you've actually gotten a system error, such as from
> open().

Spot on. $! is not set in any meaningful way by DBD::Oracle. Don't use it.

Adam, read the DBI docs about how to detect and handle errors.
Also read up about trace() you'll find it helpful.
You may also find it helpful to give more than 8 bytes of space
for bind_param_inout() so there's more than enough for the date to
be returned into. 8 is possibly too small. Be generous, the only
cost is memory and I'm sure you could spare tens times that amount :)

Tim.

Reply via email to