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 22:17 UTC
    Or  $main::shared = "Hello World!\n";
Re^2: Passing Variables
by pg (Canon) on Oct 23, 2004 at 22: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.