Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl: Creating a Child Perl Script

Status
Not open for further replies.

ExSpedy

Vendor
Jul 26, 2010
1
US
Hello All,
I'm currently attempt to create a Perl Script which will perform the following:

1. Gather the a set of variables from the user
2. Use the variables to create a child Perl script

The child Perl script will then perform a pre-defined action based on the variables gathered in the Step 1.

I've already manually created the child Perl script.
I've also created the portion which will gather the variables.

My problem is:
when attempting to create the child Perl script -my variables which are intended for the child script are being read by the master Perl script. This is causing my master Perl script to fail with errors.

For example:
****
PRINT << FORCHILDSCRIPTS;
my $file ="";
FORSCRIPT
****

This fails with an error that I didn't initialize the field -when the field is only intended for the child Perl script.

Any help is greatly appreciated.
Please let me know if a better description is required.
Thanks



 
Hey,

Place single quotes around the End tag, so that perl doesn't attempt to interpolate variables:

Code:
PRINT << 'FORCHILDSCRIPTS';

Chris
 
The start and end tags of a here-doc should be the same in order for it to be read correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top