Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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....

Replies are listed 'Best First'.
Re: how to assign a vb 6.0 variable value to a perl variable
by NetWallah (Canon) 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.....:)
Re: how to assign a vb 6.0 variable value to a perl variable
by LanX (Bishop) 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 '' (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 i cant put address in string!!

      can we pass this value using perl code??

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1012382]
Approved by LanX
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2017-12-13 04:18 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (345 votes). Check out past polls.