Hi Folks,
I am trying to connect to a server where i want to create a file or read a
existing file.
This is my code.
#!/usr/bin/perl
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/] $/');
# My prompt will be looking after telnet session like this "[
I got your problem.
Pass the parameters like below,
&replace_txt('\$a', '$b');
It will work fine.
In this line, $line =~ s/$old/$new/g;
$old should have \$a, in order to match a variable name.
If u pass '$a' alone - &replace_txt('$a', '$b');
$old will have $a and it will search for the value of
HI
Pass the parameters in double quotes or simply $a, $b. Like below
&replace_txt("$a", "$b");
&replace_txt($a, $b);
Single quotes doesn't interpolate the variables.
Thanks,
Suresh
<>
Hello,
I want to replace text in file.
So, I wrote subroutine like this:
sub replace_txt {
my ($ol
Thank you very much for your help.
This satisfies my requirement.
Thanks
suresh
On Thu, Feb 12, 2009 at 4:27 PM, Rob Dixon wrote:
> suresh kumar wrote:
> >
> > This is my code :
> >
> > $::dev2->getvalue($x,$y);
> > $::dev3->getvalue($x,$y);
> > $:
Hi all
>
> This is my code :
>
> $::dev2->getvalue($x,$y);
> $::dev3->getvalue($x,$y);
> $::dev4->getvalue($x,$y);
> $::dev5->getvalue($x,$y);
> $::dev6->getvalue($x,$y);
> $::dev7->getvalue($x,$y);
> $::dev8->getvalue($x,$y);
> $::dev9->getvalue($x,$y);
> $::dev10->getvalue($x,$y);
> $::dev11->get
Thanks for the response.
but is there anyother way to do this?
On Mon, Nov 24, 2008 at 6:40 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]>wrote:
> On Mon, 2008-11-24 at 16:11 +0530, suresh kumar wrote:
> > Hi,
> >
> > Here is the sample code:
> >
> > sub
Hi,
Here is the sample code:
sub a {
print "i am a\n";
return 0;
}
sub b {
print "i am b\n";
return 1;
}
if (a() && b()) {
print "yes\n";
} else {
print "no\n";
}
I want both the subroutine to be executed, and then i want print some
statements depending upon both the results.
here if a() ret
Hi,
This is my part of the script,
if (($#ARGV == 1) && ($ARGV[0] eq "-f")) {
..
if ($ARGV[0] ne "-f" ) {
..
if i run my script i am seeing this kind of warnings.
Use of uninitialized value in string eq