I'm not sure how well this would work, but it seems as though you could implement some sort of "multi-pass compiler" type solution.
By that I mean, have your script go through the VB script a couple of times. The first pass does what (I think) stephen is suggesting, having your script try and determine what each variable type is on any given line (or, per statement, really) and returning the reply in some sort of unique markup language that is internal to your compiler. The second pass goes through and compares the VBscript to your newly generated first pass document, and makes sure the actual sigils $, @, %, etc
match what the vb script is actually doing at that point. (In fact, it might be a good idea to number each statement of the vb script as you go through it, and put the corresponding number at the beginning of the perl script line, to make sure that the compiler can determine which statements are supposed to correlate.) The third pass would go through the final perl script and clean up all of your internal stuff.
I'm certainly no expert on writing compilers/translators, so don't take my suggestion as gospel, but it sounds like it could work.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.