Click here to get back home

insert codes dynamically

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
insert codes dynamically Rose 03-05-2008
Get Chitika Premium
Posted by Ben Morrow on March 6, 2008, 10:27 am
Please log in for more thread options

>
> Frank, Thanks a lot for your response. Indeed, @arr is not known beforehand
> and the content of @arr is generated by another perlscript. How would you
> recommend to bridge these 2 perlscripts?

Do they need to be separate scripts? Are they run at different times? If
you are using separate scripts simply as a way of putting the code in
separate files, you may want to use modules instead.

The easy and straightforward way to pass data from Perl to Perl is the
use the Storable module, which is core as of 5.8. In the first script
you say

use Storable qw/store/;

store \@arr, 'file' or die "store failed";

and then in the second

use Storable qw/retrieve/;

my $aref = retrieve 'file' or die "retrieve failed";

If you want the data to be human-readable, or readable from another
language, you could use YAML instead.

Ben


Similar ThreadsPosted
how to "see" DOS errorlevel codes? January 15, 2007, 12:17 pm
Help writing semaphore codes July 12, 2007, 5:27 pm
Help: Debug perl codes August 17, 2008, 8:15 am
Fork, processes and exit codes? February 3, 2005, 2:36 am
Text descriptions of signal codes? July 27, 2006, 12:11 pm
How to get the return codes for shell commands January 19, 2007, 7:24 am
translating MS Word codes using regexps April 27, 2007, 8:05 am
Dynamically Generating A Format February 8, 2005, 7:33 pm
Online forum source codes in Perl/CGI without SQL? October 23, 2004, 12:00 am
Making Net::SMTP Robust: Return Codes May 27, 2005, 12:16 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap