Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

how to assign a vb 6.0 variable value to a perl variable

by puchku (Initiate)
on Jan 09, 2013 at 05:43 UTC ( #1012382=perlquestion: print w/ replies, xml ) Need Help??
puchku has asked for the wisdom of the Perl Monks concerning the following question:

i've been writing a vb 6.0 program and in it i need to have a text file created during runtime as follows:

dim fs,fname Set fs = New FileSystemObject Set fname = fs.CreateTextFile("D:\vb\perlprog.txt", True) fname.WriteLine ("#!/usr/bin/perl -w") fname.WriteLine ("use strict;") . . . fname.WriteLine ("my $t = Net::Telnet->new(Host => $ipad, PORT => '23' + , Timeout => 10 , Errmode => 'return');") . . .

in that vb program, i've taken data in a variable like this: IPAD = rec3("IPADDRESS")

i want to take this value(an ip address) from this variable to $ipad variable in the perl program...should i write it in perl or vb??if in perl, then how? thank you....

Comment on how to assign a vb 6.0 variable value to a perl variable
Download Code
Re: how to assign a vb 6.0 variable value to a perl variable
by LanX (Abbot) on Jan 09, 2013 at 06:01 UTC
    ( I won't start questioning this strategy!!! :)

    Technical answer:

    Include it as a literal string something like '124.55.222.1' (like you did with '23').

    Plz don't expect much help about VB's string concatenation¹ here to interpolate your variable, it's really off topic ( and I won't start googeling for you ;)

    Cheers Rolf

    ¹) + ?

      thank you for your response LanX

      actually the value of ip address changes everytime the entire program is run...but telnet port 23 is constant....so i cant put address in string!!

      can we pass this value using perl code??

Re: how to assign a vb 6.0 variable value to a perl variable
by NetWallah (Monsignor) on Jan 09, 2013 at 06:06 UTC
    VB uses "&" as a string-concat operator, so you could write VB code to convert that into a perl variable like this:
    fname.WriteLine ("my $ipad_ip ='" & rec3("IPADDRESS") & "';")

                 "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius

      thank you NetWallah.....:)
      its what i was asking for......:) :) thank you againn.....:)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1012382]
Approved by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-04-20 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls