On Fri, 2003-07-18 at 22:34, Ming Deng wrote: > Ramprasad wrote: > > > else > > Instead in your main program call > > do "foo.pl args..." > > > > And in foo.pl set some scope defined variable like > > > > #foo.pl > > $dbh=connect(....) > > unless($dbh){ > > $GLOBAL::ERRORSTR="Couldnot connect to database $@"; > > exit 1 > > } > > > > > > And in the main program you can check > > > > if($GLOBAL::ERRORSTR) { > > # Hmm something went wrong > > ........... > > > > } > > > > > > But personally I consider this as dirty work though it works. Let me > > know If you get a better way > > > > Ram > > I don't understand how can perl pass variables across processes. Sort of > magic? > >
Did you try it. If it works perl is a wizard else I am just wasting my time I think it is just that when you do a 'do foo.pl' No new perl instance is forked. It is just that the perl interpreter instance that was running your main code now interprets the foo.pl. Since it shares the same 'process environment' I think maintaining any variable does not require any harry potter skills Ram ---------------------------------------------------------------- NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134 MailServ: Email, IM, Proxy, Firewall, Anti-Virus, LDAP Fleximail: Mail Storage, Management and Relaying http://netcore.co.in Emergic Freedom: Linux-based Thin Client-Thick Server Computing http://www.emergic.com BlogStreet: Top Blogs, Neighborhoods, Search and Utilities http://www.blogstreet.com Rajesh Jain's Weblog on Technology: http://www.emergic.org ----------------------------------------------------------------