SSH equivalent to Net::Telnet::Cisco?

2008-10-07 Thread Paul
I've searched CPAN, but have not found an equivalent module such as Net::Telnet::Cisco for SSH (SSH2). Is there one somewhere out there? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: data from file

2008-10-07 Thread [EMAIL PROTECTED]
On Oct 6, 11:26 am, [EMAIL PROTECTED] (Jeff Pang) wrote: > > Message du 06/10/08 17:03 > > De : "[EMAIL PROTECTED]" > > A : [EMAIL PROTECTED] > > Copie à : > > Objet : data from file > > > Hi, > > > I have large file in following format: > > > ID | Time | IP | Code > > > Now I want to write script

best way to search in a file

2008-10-07 Thread [EMAIL PROTECTED]
What is the easiest method to search in a file for a particular term, and output a desired field. For example, in awk, I would simply do: awk '/searchterm/ {print $2}' input.txt to get my result. But in Perl, the shortest way I could find achieve the same result was: $inputfile=input.txt; open(

Use lib

2008-10-07 Thread Dermot
Hi, I have seen the following is a book use strict; use warnings; use FindBin qw($Bin); use Path::Class; use lib dir ($Bin,'..','lib')->stringify; An adopted it into a script of my own. I understand that this FindBin will allow the code to be ported between OS's. That's isn't massively importa

Re: Use lib

2008-10-07 Thread Mr. Shawn H. Corey
On Tue, 2008-10-07 at 12:36 +0100, Dermot wrote: > Hi, > > I have seen the following is a book > > > use strict; > use warnings; > use FindBin qw($Bin); > use Path::Class; > use lib dir ($Bin,'..','lib')->stringify; > > > An adopted it into a script of my own. I understand that this FindBin >

Re: combinations

2008-10-07 Thread Paul Johnson
On Mon, Oct 06, 2008 at 08:32:22PM -0400, Stephen Gallagher wrote: > I can come up with one example where this might be interesting. Imagine you > are a software tester and were tasked with identifying all potential > variable combinations that needed to be covered/tested. Risk mitigation, > don

Perl IDE

2008-10-07 Thread Vyacheslav Karamov
Hi All! I've found interesting comparison table of Perl editors and IDE http://www.perlmonks.org/?node=Perl%20Development%20Tools -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Bug in Perl

2008-10-07 Thread Rob Coops
On Tue, Oct 7, 2008 at 2:45 PM, <[EMAIL PROTECTED]> wrote: > Hi All, i found this as a Bug in Perl > > consider >for($i=0;$i<0.4;$i=$i+0.1) > { >print "$i\n"; >} > > > here you wiil get output as expected... > 0 to 0.3 > it work fine till test is $i<0.7...UPTO HERE EV

Re: Bug in Perl

2008-10-07 Thread Paul Johnson
On Tue, Oct 07, 2008 at 03:07:17PM +0200, Rob Coops wrote: > On Tue, Oct 7, 2008 at 2:45 PM, <[EMAIL PROTECTED]> wrote: > > > Hi All, i found this as a Bug in Perl > > isn't it a Joke > Is that a bug in Perl really? Or is it just that floating point operations > are never exact and this deviatio

Re: best way to search in a file

2008-10-07 Thread Mr. Shawn H. Corey
On Mon, 2008-10-06 at 14:26 -0700, [EMAIL PROTECTED] wrote: > This one-liner does pretty much what I would want but I do not know > how to convert it to a script. > > perl -lane 'print $F[2] if /searchterm/' input.txt See `perldoc perlrun` and look up -a and -n under "Command Switches". -- Jus

Re: combinations

2008-10-07 Thread Stephen Gallagher
- Original Message - From: "Jason Trebilcock" <[EMAIL PROTECTED]> To: "Perl Beginners" Sent: Monday, October 6, 2008 7:57:23 PM GMT -05:00 US/Canada Eastern Subject: RE: combinations -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 12:

Re: certification for perl

2008-10-07 Thread Raja Vadlamudi
On Mon, Oct 6, 2008 at 8:32 AM, Rob Coops <[EMAIL PROTECTED]> wrote: > On Mon, Oct 6, 2008 at 2:16 PM, Praveena Vittal <[EMAIL PROTECTED] > >wrote: > > > Hi All, > > > > I like to do some certification in perl,but i could not get any > information > > about the available certifications in perl . >

Bug in Perl

2008-10-07 Thread anilfunde
Hi All, i found this as a Bug in Perl consider for($i=0;$i<0.4;$i=$i+0.1) { print "$i\n"; } here you wiil get output as expected... 0 to 0.3 it work fine till test is $i<0.7...UPTO HERE EVERYTHING IS GOING RIGHT BUT magic starts here for($i=0;$i<0.8;$i=$i+0.1)

Re: Bug in Perl

2008-10-07 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > Hi All, i found this as a Bug in Perl > > consider > for($i=0;$i<0.4;$i=$i+0.1) > { > print "$i\n"; > } > > > here you wiil get output as expected... > 0 to 0.3 > it work fine till test is $i<0.7...UPTO HERE EVERYTHING IS GOING > RIGHT >

Re: combinations

2008-10-07 Thread Jenda Krynicky
From: Ryan <[EMAIL PROTECTED]> > While I agree that it would be a good homework assignment it's not. > What I have is a logic look up table for health records using an EAV > model (in an SQL table): > > rowID - key - value > > From a web form I select some keys and values. When subm

Re: certification for perl

2008-10-07 Thread Randal L. Schwartz
> "Raymond" == Raymond Wan <[EMAIL PROTECTED]> writes: Raymond> I don't know if libraries purchase books from publishers so that in Raymond> somewhat compensates for the number of people who use it (i.e., do Raymond> they pay a higher price). But surely better than piracy and Raymond> "free".

Re: certification for perl

2008-10-07 Thread Raymond Wan
Hi Randal, Randal L. Schwartz wrote: "Raymond" == Raymond Wan <[EMAIL PROTECTED]> writes: Raymond> I don't know if libraries purchase books from publishers so that in Raymond> somewhat compensates for the number of people who use it (i.e., do Raymond> they pay a higher price).

Re: Bug in Perl

2008-10-07 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > Hi All, i found this as a Bug in Perl > > consider > for($i=0;$i<0.4;$i=$i+0.1) > { > print "$i\n"; > } > > > here you wiil get output as expected... > 0 to 0.3 > it work fine till test is $i<0.7...UPTO HERE EVERYTHING IS GOING > RIGHT

Re: Use lib

2008-10-07 Thread Rob Dixon
Dermot wrote: > > I have seen the following is a book > > > use strict; > use warnings; > use FindBin qw($Bin); > use Path::Class; > use lib dir ($Bin,'..','lib')->stringify; > > > An adopted it into a script of my own. I understand that this FindBin > will allow the code to be ported between

Re: best way to search in a file

2008-10-07 Thread John W. Krahn
[EMAIL PROTECTED] wrote: What is the easiest method to search in a file for a particular term, and output a desired field. For example, in awk, I would simply do: awk '/searchterm/ {print $2}' input.txt to get my result. But in Perl, the shortest way I could find achieve the same result was:

Re: best way to search in a file

2008-10-07 Thread Paul Johnson
On Tue, Oct 07, 2008 at 10:07:21AM -0700, John W. Krahn wrote: > [EMAIL PROTECTED] wrote: >> This one-liner does pretty much what I would want but I do not know >> how to convert it to a script. >> perl -lane 'print $F[2] if /searchterm/' input.txt > > #!/usr/bin/perl > $\ = "\n"; > while ( <> ) {

Re: How to check empty hash value properly?

2008-10-07 Thread Rob Dixon
loody wrote: >> if( exists $data{$key} ){ >>print "\t\$data{$key} exists\n"; > > thanks for your kind help. > Could I get the conclusion that exists is only used for determining > the element of hash and arrays? > appreciate your help, Consider this program. use strict; use warnings;

Re: certification for perl

2008-10-07 Thread Rob Dixon
Jeff Pang wrote: >> Message du 06/10/08 14:22 De : "Praveena Vittal" >> >> I like to do some certification in perl,but i could not get any >> information about the available certifications in perl . > > Who asked you for that? Ok you say you have read all the books below, that > will be enough for

Re: How to check empty hash value properly?

2008-10-07 Thread John W. Krahn
Rob Dixon wrote: loody wrote: if( exists $data{$key} ){ print "\t\$data{$key} exists\n"; thanks for your kind help. Could I get the conclusion that exists is only used for determining the element of hash and arrays? appreciate your help, Consider this program. use strict; use warning

Re: How to check empty hash value properly?

2008-10-07 Thread Rob Dixon
John W. Krahn wrote: > Rob Dixon wrote: >> loody wrote: if( exists $data{$key} ){ print "\t\$data{$key} exists\n"; >>> thanks for your kind help. >>> Could I get the conclusion that exists is only used for determining >>> the element of hash and arrays? >>> appreciate your help, >> Co

Re: data from file

2008-10-07 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > On Oct 6, 11:26 am, [EMAIL PROTECTED] (Jeff Pang) wrote: >> [EMAIL PROTECTED] wrote: >>> >>> I have large file in following format: >>> ID | Time | IP | Code >>> >>> Now I want to write script that will cluster data by IP addr. and >>> count total number of IDs for corres

Re: Regular expression question

2008-10-07 Thread Rob Dixon
irata wrote: > > can someone explain me, why this short regex don't give the result I > expect: > > perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) > \)\s+(\d+)/ )' > > I supposed that the output is "[7][32]", but the output is "[][]". I > don't know why... Your regular e

Re: How to check empty hash value properly?

2008-10-07 Thread Mr. Shawn H. Corey
On Tue, 2008-10-07 at 21:09 +0100, Rob Dixon wrote: > Incorrect, delete does not remove array elements: > > > > $ perl -le'use Data::Dumper; my @a = "a".."d"; delete $a[1]; print > > Dumper [EMAIL PROTECTED]' > > $VAR1 = [ > >'a', > >undef, > >'c', > >

Re: How to check empty hash value properly?

2008-10-07 Thread Jay Savage
On Tue, Oct 7, 2008 at 4:09 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > John W. Krahn wrote: [snip] >> Incorrect, delete does not remove array elements: >> >> $ perl -le'use Data::Dumper; my @a = "a".."d"; delete $a[1]; print >> Dumper [EMAIL PROTECTED]' >> $VAR1 = [ >>'a', >>

Re: How to check empty hash value properly?

2008-10-07 Thread Mr. Shawn H. Corey
On Tue, 2008-10-07 at 22:01 -0400, Jay Savage wrote: > On Tue, Oct 7, 2008 at 4:09 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > John W. Krahn wrote: > [snip] > >> Incorrect, delete does not remove array elements: > >> > >> $ perl -le'use Data::Dumper; my @a = "a".."d"; delete $a[1]; print > >> Dump