Re: Include variables from external perl script
- From: rkb@xxxxxxxxxx (Ron Bergin)
- Date: Tue, 30 Oct 2007 13:38:07 -0000
On Oct 30, 3:34 am, pa...@xxxxxxxxxxxxx (Jeff Pang) wrote:
On 10/30/07, howa <howac...@xxxxxxxxx> wrote:In addition to changing 'my' to our' in Config.pl, you'll also need to
Consider the example below...
Config.pl
======
#!/usr/bin/perl -w
my $value = "abc";
change 'my' to 'our'.
1;
Script.pl
======
require "Config.pl";
add the 'our $value;' to Script.pl
Here's another option.
print $value; # How to do this, beside using .pm?
Thanks.
Config.cfg
==========
$value = "abc";
Script.pl
=========
#!/usr/bin/perl
use strict;
use warnings;
our $value;
do 'config.cfg';
print $value;
.
- Follow-Ups:
- Re: Include variables from external perl script
- From: Howa
- Re: Include variables from external perl script
- From: Paul Lalli
- Re: Include variables from external perl script
- References:
- Include variables from external perl script
- From: Howa
- Re: Include variables from external perl script
- From: Jeff Pang
- Include variables from external perl script
- Prev by Date: Re: Split function
- Next by Date: Re: printf problem
- Previous by thread: Re: Include variables from external perl script
- Next by thread: Re: Include variables from external perl script
- Index(es):