Hi , I am trying to use the Net::Telnet module after installing in my solaris 2.8 machine. But I am unable to get the output.
There is no error messages either.The program just exists. Could you help me out on this please... #!/usr/bin/perl -w use Net::Telnet (); $t = new Net::Telnet (Timeout => 1000, Port => 8667); $t->open("ss-ps.demon.net"); @output = $t->cmd("01244530112"); print @output; ---------------------------------------------------------------------------- ---------------- regards, Ajitpal Singh, Wipro Technologies. Finchley,London. Tel:044 208 495 6317 Mobile:07900534143 -----Original Message----- From: Jenda Krynicky [mailto:[EMAIL PROTECTED] Sent: 20 January 2004 10:43 To: [EMAIL PROTECTED] Subject: Re: Saying an item is empty From: "Trina Espinoza" <[EMAIL PROTECTED]> > I would like to know how I would say if $item equals $tempitem OR if > $item is empty(the variable is a placeholder that has nothing in it), > execute command. I'd revert the tests. First see whether it's empty, then whether it equals something: if (!defined $item or $item eq $tempitem) { do something > Are either of these saying the above statement > because I don't seem to be getting the expected results. > > If ($item =~ /^(\D+)(\d+)/ {) > If ($1 eq !$tempitem) { I guess the capital "I"s were introduced by your mail client (I know some programs think they know better:-} Anyway the $1 eq !$tempitem doesn't really make sense. If you want to say "$1 does not equal to $tempitem" it should be either $1 ne $tempitem or !($1 eq $tempitem) or not ($1 eq $tempitem) In your version you first LOGICALY negate the $tempitem (which means that if $tempitem is 0, 0.0, "0", "" or undef you get 1, in all other cases you get an undef. And then you compare the 1 or undef with the $1. Not likely to be what you meant. > do an action; > }else{ > do some other action; > undef $tempitem; > > or > > If ($item =~ /^(\D+)(\d+)/ {) > If ($1 eq defined(!$tempitem)) { This is even more crazy :-) > do an action; > }else{ > do some other action; > undef $tempitem; Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>