On Fri, 7 Nov 2003, Hardy Merrill wrote: > Bart Lateur [EMAIL PROTECTED] wrote: > > On Fri, 7 Nov 2003 09:48:12 -0500, Hardy Merrill wrote: > > > > >But this doesn't work - just comes back to the command prompt > > >without printing anything: > > > > > > perl -MDBD::mysql -e "print $DBD::mysql::VERSION" > > > > Just enable warnings, and you'll see why it doesn't work. > > > > perl -MDBD::mysql -lwe "print $DBD::mysql::VERSION" > > [EMAIL PROTECTED] root]# perl -MDBD::mysql -lwe "print $DBD::mysql::VERSION" > print() on unopened filehandle VERSION at -e line 1. > > That doesn't make the lightbulb in my head go on - is it > just me, or does that seem kind of confusing?
Okay that was just weird! it seems that the shell playing games with $DBI turning your variable name into ::mysql::VERSION. so if you: pandora:~/.mozilla/plugins:$ perl -MDBD::mysql -wle "print STDERR $DBD::mysql::VERSION" you get: ::mysql::VERSION So, playing with it some more... pandora:~:$ perl -MDBD::mysql -wle "print \$DBD::mysql::VERSION" 2.9003_1 export DBI=\$DBI; perl -MDBD::mysql -wle "print $DBD::mysql::VERSION" In playing with the above, I was somewhat taken by surprise to find that 'pandora:~/.mozilla/plugins:$ DBI=foo echo $DBI' did not echo 'foo'; whereas, 'pandora:~:$ DBI=foo && echo $DBI' did. Rudy
