Interesting.  I think I might
be completely mistaken exec or eval exec in
tcl with the power of backtick operator
in perl.

Let's say my perl script is

------------
$a=`$a`;
print $a
---------- 
Then tcl $data variable gets not only
$a but also that error message

However I change perl to
-------
$a=`$a`;
print $a;
exit 0
-------
Then tcl $data variable only gets the
error message.

I must not "exit 0"!  Or else I will
get nothing.

Perhaps the correct way to do is 
to actually learn tcl to do what
perl is doing now but I would prefer
to stick with perl.




On Mon, Aug 27, 2001 at 10:14:39AM -0500, Len Morgan wrote:
> Have you tried running a "dummy" script that just returns say a number to
> see if you get the same error?  If I'm not mistaken, the return value from
> "exec" in Tcl is the return value from the command you execute (i.e., 0 if
> successful, etc).  While you can "print" from the program, I'm not sure you
> can capture just that value.  You might also want to make sure that you are
> doing a real "exit" from your script and not just letting it "fall through"
> 
> len morgan
> 
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "Len Morgan" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, August 27, 2001 10:43 AM
> Subject: Re: [GENERAL] is it tcl problem or pg problem?
> 
> 
> > On Mon, Aug 27, 2001 at 09:07:34AM -0500, Len Morgan wrote:
> > > Try:
> > >
> > > catch { eval exec $NEW($1)} data
> > >
> > > I'm not sure that this will solve the problem but executing commands
> from
> >
> > It did not :(
> >
> > > commands?  Perhaps your "date" example was just an example (because you
> can
> > > use now()::date from within Postgres).
> >
> > What I really want to do is run something like
> > at -f file 13:10 8/31/2001
> > and then capture "at" job number.
> >
> > What I really want to get is "at" job number
> > and because I know perl better I am actually
> > going call a perl script from tcl.  Perl
> > will call "at" and parse job number and
> > print it.  Tcl will catch the number and
> > put in a database column
> >

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to