On Tue, 28 Jan 2003 20:19:57 -0600, [EMAIL PROTECTED] (J. Alejandro
Ceballos Z.) wrote:
>I have 2 perl programs
>
>The first one is using strict, are two variables have a value, but in a
>procedure it calls a second program, and I want to load the value of the
>previous variables, but I can't. See example
You should use "our" to declare the variables.
#!/usr/bin/perl
# program1.pl
use strict;
our ($a,$b);
require ("program2.pl");
&proc1;
sub proc1 {print "$a $b\n"}
&proc2;
#!/usr/bin/perl
# program2.pl
our($a,$b)=(1,2);
sub proc2 {print $a+$b,"\n"}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]