For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > May 2004 > Passing variables from Perl to other programs









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing variables from Perl to other programs
Efialtis

2004-05-18, 2:32 pm

I have a fun situation using a testing tool with VBA. However, to do
some of the things in VBA it would take too long, and it wouldn't work
right with this particular application...

I am passing in to perl, a chunck of HTML. VBA has a really easy
command for this "getHTML"...

In perl, I am parsing out some necessary items from the
HTML...standard, easy, and working.

What I don't know how to do is pass the results back out to VBA
without using a TEMP file, which will not work with this
application...

Is there a way to pass out a string from perl back into vba?
Stuart Moore

2004-05-18, 3:42 pm

Efialtis wrote:

> I have a fun situation using a testing tool with VBA. However, to do
> some of the things in VBA it would take too long, and it wouldn't work
> right with this particular application...
>
> I am passing in to perl, a chunck of HTML. VBA has a really easy
> command for this "getHTML"...
>
> In perl, I am parsing out some necessary items from the
> HTML...standard, easy, and working.
>
> What I don't know how to do is pass the results back out to VBA
> without using a TEMP file, which will not work with this
> application...
>
> Is there a way to pass out a string from perl back into vba?


How are you running perl from vba? Can you track perl's output and parse
it in vba? Otherwise I've used sockets to communicate between Perl and
another process quite sucesfully.

Stuart
Efialtis

2004-05-18, 7:31 pm

I am using this like to call Perl from VBA

Shell ("perl.exe -d C:\TaskComplete.pl --TASK=EnterBorrowerData
--URL=QA")

The perl goes through and does a lot of things, and at the end, I end
up with a string that VBA needs to continue.

I have tried outputting this string into a TXT file, but because of
the application of the VBA and the program we are working with, it
will not work to go this rout.
John Bokma

2004-05-19, 1:31 am



Efialtis wrote:

> I am using this like to call Perl from VBA
>
> Shell ("perl.exe -d C:\TaskComplete.pl --TASK=EnterBorrowerData
> --URL=QA")
>
> The perl goes through and does a lot of things, and at the end, I end
> up with a string that VBA needs to continue.
>
> I have tried outputting this string into a TXT file, but because of
> the application of the VBA and the program we are working with, it
> will not work to go this rout.


VBA as in Visual Basic for applications? Why not call the program using
COM from Perl? (The other way around)? I have called Excel from Perl
several times in the past.

If VBA calls Perl, it is IMHO possible to talk back to Excel using COM.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com