develooper Front page | perl.beginners | Postings from February 2002

RE: Perl calling Visual Basic

Thread Previous | Thread Next
Dean Theophilou
February 22, 2002 14:32
RE: Perl calling Visual Basic
Message ID:
Of course, you can always have VB output the results to a text file and then
have Perl read it.  I think that would probably be the simplest way to do it.

Dean Theophilou

-----Original Message-----
From: []On
Behalf Of Chris Ball
Sent: Friday, February 22, 2002 8:27 AM
To: Chris
Subject: Re: Perl calling Visual Basic

>>>>> "chris" == chris  <> writes:

    chris> @result = `myCompiledVBApp AnyArgs`;
    chris> Anyone think I have lost my mind, or did I get one right???

Close.  I don't see why you're passing the return to an array rather
than scalar (@ rather than $), since it should just be an integer.
You're also capturing the output of the program when you use backticks,
rather than the return code, which is captured using system().

To execute and capture the return code of a program, I'd use:

      $return_code = system('program');

.... but that assumes that the 'program' is something that can be entirely
executed from the command line and returns a useful return code - I
don't have familiarity with VB, but my short experiences seem to suggest
that this would be rare.

*awaits correction from Japhy*  :-)

- Chris.
$a=""; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
         "In the beginning there was nothing, which exploded."

To unsubscribe, e-mail:
For additional commands, e-mail:

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About