ARGV array regarding

2008-07-31 Thread suresh kumar
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

Regarding conditional statement

2008-11-24 Thread suresh kumar
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

Re: Regarding conditional statement

2008-11-24 Thread suresh kumar
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

Re: objects regarding

2009-02-12 Thread suresh kumar
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

Re: objects regarding

2009-02-13 Thread suresh kumar
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); > > $:

RE: How to use scalar value in substitution pattern?

2009-12-30 Thread suresh kumar
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

Re: How to use scalar value in substitution pattern?

2009-12-30 Thread suresh kumar
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

telnet session to read or write a file

2010-02-20 Thread suresh kumar
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 "[