jptxs has asked for the wisdom of the Perl Monks concerning the following question:
ah...
Is it possible to use packages/modules all in one file? something like this:
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?#!/usr/bin/perl -w use strict; package try; use Exporter; use vars qw(@ISA @EXPORT_OK); @ISA = qw(Exporter); @EXPORT_OK = qw($sql); my $sql = 'select name from v$database;'; 1; system("echo \'$try::sql\' | sqlplus -s system/manager");
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...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: packages / modules in the same file
by dragonchild (Archbishop) on Nov 13, 2001 at 19:41 UTC | |
by jptxs (Curate) on Nov 13, 2001 at 20:12 UTC | |
(tye)Re: packages / modules in the same file
by tye (Sage) on Nov 13, 2001 at 22:02 UTC | |
Re: packages / modules in the same file
by clintp (Curate) on Nov 13, 2001 at 19:49 UTC |