You could make a module to hold $out:
my_module.pm (this is the name of the file)
-----------------------------
package my_module;
$out = "123";
1;
last.pl
-----
#!/path/to/perl
use strict;
use my_module; ### works as long as my_module.pm is
### in the same directory, or is in the
### perl search directory @INC. If
### my_module is in a different directory, then you'll need to use
### "use lib " to refer to the directory that
### my_module *sits in*.
print "\$out = $out";
=============================================
I think that should work. If you're going to use modules, you should read up on them - once you get used to using them, they're great. But in the beginning it can be a little trying.
"perldoc perl" says this about perl modules:
perlmod Perl modules: how they work
perlmodlib Perl modules: how to write and use
so you can do "perldoc perlmod" to see how perl modules work.
HTH.
Hardy Merrill
Mission Critical Linux, Inc.