Jeff,
thanks for your response. here is the output:
--- snip ---
$ ./program.pl
done
localhost$
--- snip ---
here is how I used it:
localhost$ cat ./program.pl
#!/sw/bin/perl
use Expect;
use strict;
my @elementList;
my $elementfile = './test.pl';
eval {require $elementfile};
for my $element (@elementList) {
print $element->{blah};
print $element->{blah2};
}
print "\n\ndone\n";
exit 0;
1;
localhost$ cat ./test.pl
use strict;
our (@elementList);
@elementList = (
{
blah => 'element',
blah2 => 'again',
},
);
1;
Jeff Pang wrote:
> Message du 08/10/08 14:55
> De : "Noah"
> A : "Jeff Pang"
> Copie à : "Perl Beginners"
> Objet : Re: use variables from another file
>
>
> Hi there,
>
> I am using the first example and the array variable always is
blank. Any
> clues why?
>
What's your code? How did you use it?
Regards,
Jeff.
/Créez votre adresse <http://www.laposte.net> électronique
[EMAIL PROTECTED]
1 Go d'espace de stockage, anti-spam et anti-virus intégrés./
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/