Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

(jptxs) Re: packages / modules in the same file

by jptxs (Curate)
on Nov 13, 2001 at 20:12 UTC ( #125068=note: print w/replies, xml ) Need Help??

in reply to Re: packages / modules in the same file
in thread packages / modules in the same file

wow, how silly my mistake was. I was forgetting to put in the package main; at the end of the "module". I guess I was thinking the 1; would automagically put me back in main, but I don't know why...

I agree that the OO syntax is cleaner and wanted to use it. Both OO and non suffered from my oversight, though. anyway, here's what I am going with:

#!/usr/bin/perl -w use strict; package try; sub new { my $self = {}; $self->{SQL} = 'select name from v$database;'; bless $self, 'try'; return $self; } package main; my $getit = try->new; system("echo \'$getit->{SQL}\' | sqlplus -s system/manager");
Thanks =]

We speak the way we breathe. --Fugazi

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://125068]
[Discipulus]: gee a social network with the family.. is this a dread? ;=)
[Corion]: Discipulus: Nah, I'm thinking of posting more short stuff, but not all of it is fit for, more something a bit longer than Twitter but shorter than my usual b.p.o module posts
[Corion]: But Google+ is tedious and I'd like to keep my posts on an open platform instead, which can be followed via RSS

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-26 07:40 GMT
Find Nodes?
    Voting Booth?