11:29am, Ramprasad A Padmanabhan wrote:

> > > 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
> > >

> > 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
>

Do is to Perl as source (or '.') is to the shell--i.e. it reads the code in
the referenced file into the current program. It's the poor cousin of 'use'
and 'require'.

Paul

PS. Ram, I don't think your .sig file is long enough--where's your bio and
list of top 25 movies, man? 8-)


> 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
> ----------------------------------------------------------------
>
>

------------------------------------------------------------------------
I just saw this headline today (1/3/00) in the Houston Chronicle online:

"Death row prisoners launch hunger strike"

Is it just me or is this not a problem?
------------------------------------------------------------------------

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to