The following example does what is expected, i.e. prints out the word
password on its own line.

used.pm
-------
$password='password';

use.pl
------
#!/usr/bin/perl

require "./used.pm";
print "$password\n";

However, as soon as I turn on warnings and strict, and declare
$password:
#!/usr/bin/perl -w
use strict;
my $password;
require "./used.pm";
print "$password\n";

I no longer get password printed on its own line. What is the proper way
to push variables off to a different file? I could do a subroutine:
sub Password { return 'password'; }
and then call sub Password from my main perl script, but that doesn't
seem like "The Right Way To Do It". Should I be using require instead of
use, or something else?

        Pete

-- 
Those responsible for the signature have been sacked.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to