Re: Perl Code

2012-08-31 Thread Peter Scott
On Sat, 01 Sep 2012 04:05:31 +, Peter Scott wrote: > On 2012-08-29, at 12:46 PM, Ashwin Rao T wrote: >> 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 >> using only return functions & regular expressions in Perl. > > /\b172\.125\.(\d+)\.((?>\d+))(??{(1<=$1 && $1<=24 && 0<

Re: Perl Code

2012-08-31 Thread Peter Scott
On 2012-08-29, at 12:46 PM, Ashwin Rao T wrote: > 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 > using only return functions & regular expressions in Perl. /\b172\.125\.(\d+)\.((?>\d+))(??{(1<=$1 && $1<=24 && 0<=$2 && $2<=255)|| ($1==25 && $2==0) ? "" : "(*FAIL)"})/ and say

Re: Perl Code

2012-08-31 Thread shawn wilson
of course it's homework. though if the student would be so kind to inform the list what the class's (and instructor's) best answer is to #3, i'll be able to inform them whether the class is worth staying in. seriously, it's a much harder question than it seems. also, the cool way of answering #1 w

Re: Perl Code

2012-08-31 Thread Paul Anderson
I smell homework:p Paul Anderson -- VE3HOP On 2012-08-29, at 12:46 PM, Ashwin Rao T wrote: > 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 using only > return functions & regular expressions in Perl. > 2)Check if the name is valid (has atleast 3 letters and one vo

Re: Perl Code

2012-08-31 Thread Chris Nehren
On Wed, Aug 29, 2012 at 09:59:22 -0700 , John SJ Anderson wrote: > On Wednesday, August 29, 2012 at 9:46 AM, Ashwin Rao T wrote: > > 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 using > > only > > return functions & regular expressions in Perl. > > 2)Check if the name is va

Re: Perl Code

2012-08-31 Thread Bill Stephenson
On Aug 29, 2012, at 11:59 AM, John SJ Anderson wrote: > On Wednesday, August 29, 2012 at 9:46 AM, Ashwin Rao T wrote: >> 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 using only >> return functions & regular expressions in Perl. >> 2)Check if the name is valid (has atleast

How can I use Net::SSH2 or Net::SSH::Perl in krb5 authen env?

2012-08-31 Thread chenlin rao
Hello all: I usually like to use Net::SSH2 or Net::SSH::Perl module to send commands to the cluster. But now, these servers change to be authenticated by kerberos5.When I kinit and try my old scripts, it failed! $ssh2->auth_list return "gssapi-keyex" and "gssapi-micpasswd", but nothing rela

Re: printf

2012-08-31 Thread Shawn H Corey
On Fri, 31 Aug 2012 15:28:38 +0300 "Octavian Rasnita" wrote: > From: "Torsten" > > > Hey, > > > > I found a strange behaviour for printf: If you do for example > > > > printf "%d",29/100*100 > > > > you get 28. But with > > > > printf "%d",29*100/100 > > > > it's 29. Seems to be related to

Re: printf

2012-08-31 Thread Octavian Rasnita
From: "Torsten" > Hey, > > I found a strange behaviour for printf: If you do for example > > printf "%d",29/100*100 > > you get 28. But with > > printf "%d",29*100/100 > > it's 29. Seems to be related to rounding. Yep use bignum; might help. Octavian -- To unsubscribe, e-mail: beginne

printf

2012-08-31 Thread Torsten
Hey, I found a strange behaviour for printf: If you do for example printf "%d",29/100*100 you get 28. But with printf "%d",29*100/100 it's 29. Seems to be related to rounding. The perl version is 5.10.1 on debian. Regards -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additio

Re: Can not run ssh command inside perl script !

2012-08-31 Thread Shlomi Fish
Hello Jack, On Fri, 31 Aug 2012 17:00:12 +0700 Jack Vo wrote: > Hello List, > > I'm trying to execute a script which retrieves swap usage memory in > remote host. So that I install Net::SSH::Perl module (from source > code) from CPAN website. > My script below : > > #!/usr/bin/perl -w > > use

Can not run ssh command inside perl script !

2012-08-31 Thread Jack Vo
Hello List, I'm trying to execute a script which retrieves swap usage memory in remote host. So that I install Net::SSH::Perl module (from source code) from CPAN website. My script below : #!/usr/bin/perl -w use strict; use Net::SSH::Perl; my $hostname = "192.168.7.5"; my $username = "abcd";