NOTE: before telling me how terrible and wrong what I'm trying to do here is, know that I am aware of this and you can see NOTE2 at the bottom of this post for the reasons I'm doing it this way. I know DBI. I know this is bad form. There are reasons...
Is it possible to use packages/modules all in one file? something like this:
use vars qw(@ISA @EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT_OK = qw($sql);
my $sql = 'select name from v$database;';
system("echo \'$try::sql\' | sqlplus -s system/manager");
As you've guessed, that doesn't work. I've tried it without the Exporter
stuff, after the call, using the OO syntax, putting in a use try;
and some other dumber things. Am I barking up the wrong tree? Do you ABSOLUTELY have to have modules in different files?
We speak the way we breathe. --Fugazi
NOTE2: the reason for this is I am trying to sneak something in the back door simply to prove it can be done. I tried installing DBI in my own directory (This is *NIX) but it was a no go b/c I don't even have access to compilers, make, etc., etc. The reason for wanting it all in one file is for "perception of ease" on the part of some of those who are anti my idea. If I can just drop in one file, show what we need done getting done, then that proves the point soundly. The reason for the packges is that there will be different version of the SQL for different situations, which could be differentiated by calling $mod1::sql vs $mod2::sql. I would knee-jerk hate all this too, but I'm backed in a corner...