On Tue, 2006-06-06 at 19:35 -0500, [EMAIL PROTECTED] wrote:
> "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> writes:
> 
> [...]
> 
> Harry wrote:
> >> Introducing your code causes a new failure and nothing is printed.
> 
> 
> Shawn wrote:
> > The line: print Dumper $self;
> > should be just before the line you posted in your earlier post:
> > $self->_read_file($self->{file});
> 
> I'm really botching this up... I got so confused here I put your code
> into the wrong script entirely.  Once inserted where it belongs in
> /cgi-bin/lib/Database.pm, when I run the calling script at:
> /cgi-bin/gen_images I get output different by a couple lines and those
> lines still don't tell much about what is supposed to be in $self.
> 
> ==========
> Error output:
> root # ./gen_images
> 
> Use of uninitialized value in split at ./gen_images line 39.
> Output path is '/var/www/locahost/htdocs/photo/data/'
> $VAR1 = bless( {
>                  'is_reversed' => 0,
>                  'file' => undef
>                }, 'Database' );
> Use of uninitialized value in open at lib/Database.pm line 219.
> Use of uninitialized value in concatenation (.) or string at lib/Database.pm 
> line 219.
> Cannot read database : No such file or directory at lib/Database.pm line 219.
> ===========  End Error output
> 
> The Dumper code you supplied cause the $VAR1 section.

Yes, Dumper() calls its first variable VAR1 (it calls its second VAR2,
etc.). This tells more than you know. The line:

  'file' => undef,

means that somewhere in your code (or the class) that 'file' was
actually assigned a value (the value being undef). If not, then 'file'
would not appear in the dump.

Try: grep -w file Database.pm
If on MS DOS: perl -n -e "/\bfile\b/ && print" Database.pm


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to