Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Passing Variables

by rlb3 (Deacon)
on Oct 23, 2004 at 18:12 UTC ( [id://401895]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Passing Variables

Hello,

You may want to try something like this:

file: test.pl
#!/usr/bin/perl use strict; use warnings; use PackageName; our $shared = "Hello World!\n"; my $returnedValue = PackageName->routine(); print $returnedValue; __END__

file: PackageName.pm
package PackageName; sub routine { print $main::shared; return "Done\n"; } 1;
This maybe what your looking for.

rlb3

Replies are listed 'Best First'.
Re^2: Passing Variables
by hlen (Beadle) on Oct 23, 2004 at 18:17 UTC
    Or  $main::shared = "Hello World!\n";
Re^2: Passing Variables
by pg (Canon) on Oct 23, 2004 at 18:19 UTC

    However it is much more important to point out that, this is not the right thing to do.

    You are using mudules, but yet try to break the higher principles that "modules" meant to server.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://401895]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.