Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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...

ah...

Is it possible to use packages/modules all in one file? something like this:

#!/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");
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...


In reply to packages / modules in the same file by jptxs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2024-04-18 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found