Re: regarding regular expression

2009-02-26 Thread John W. Krahn
Irfan Sayed wrote: Still i am not getting proper result. Here is my code. please help. $string = "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt"; $string = ( split /\D+/ )[ -1 ]; $string = ( split /\D+/, $string )[ -1 ]; print "$string\n"; John -- Those people who think they know everyt

Re: picking largest key by value..

2009-02-26 Thread Jim Gibson
On 2/26/09 Thu Feb 26, 2009 3:53 PM, "John W. Krahn" scribbled: > Rick wrote: >> trying out getting lasrgest key(by value) but below is not working... >> >> help please. >> >> my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", >> "forever" =>"11", "five" =>"5"}}; >>

Re: picking largest key by value..

2009-02-26 Thread John W. Krahn
Rick wrote: trying out getting lasrgest key(by value) but below is not working... help please. my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", "forever" =>"11", "five" =>"5"}}; my $max; print join(" ",keys %files),"\n"; =pod grep($max=($files{$_} > $max )? $_ : $

Re: picking largest key by value..

2009-02-26 Thread Gunnar Hjalmarsson
Rick wrote: trying out getting lasrgest key(by value) my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", "forever" =>"11", "five" =>"5"}}; Any special reason why you say my %files = %{{ ... }}; instead of simply my %files = ( ... ); ? While this sugge

Re: picking largest key by value..

2009-02-26 Thread rich . japh
Will try that once I get back --Original Message-- From: Owen To: beginners@perl.org Subject: Re: picking largest key by value.. Sent: Feb 26, 2009 3:53 PM On Thu, 26 Feb 2009 15:34:11 -0500 Rick wrote: > trying out getting lasrgest key(by value) but below is not working... > > help ple

Re: picking largest key by value..

2009-02-26 Thread Rick
Rick wrote: trying out getting lasrgest key(by value) but below is not working... help please. my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", "forever" =>"11", "five" =>"5"}}; my $max; print join(" ",keys %files),"\n"; =pod grep($max=($files{$_} > $max )? $_ : $

Re: picking largest key by value..

2009-02-26 Thread Owen
On Thu, 26 Feb 2009 15:34:11 -0500 Rick wrote: > trying out getting lasrgest key(by value) but below is not working... > > help please. > > my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" > =>"997", "forever" =>"11", "five" =>"5"}}; > my $max; > print join(" ",keys %files),"

Re: picking largest key by value..

2009-02-26 Thread Jim Gibson
On 2/26/09 Thu Feb 26, 2009 12:34 PM, "Rick" scribbled: > trying out getting lasrgest key(by value) but below is not working... > > help please. > > my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", > "forever" =>"11", "five" =>"5"}}; > my $max; > print join(" ",key

picking largest key by value..

2009-02-26 Thread Rick
trying out getting lasrgest key(by value) but below is not working... help please. my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", "forever" =>"11", "five" =>"5"}}; my $max; print join(" ",keys %files),"\n"; =pod grep($max=($files{$_} > $max )? $_ : $max,keys %fil

Re: connecting to multiple hosts using Net::SSH2

2009-02-26 Thread Rob Dixon
monnappa appaiah wrote: > Hi all, > > > I'm using windows machine and i'm using Net::SSH2 module to connect > to remote machine > > below is the code i'm using, its working fine if i'm connecting to one host > > #!/usr/bin/perl -w > use strict; > use Net::SSH2; > > > my $ssh2 = Net::S

Re: connecting to multiple hosts using Net::SSH2

2009-02-26 Thread Jim Gibson
On 2/26/09 Thu Feb 26, 2009 8:26 AM, "monnappa appaiah" scribbled: > Hi all, > > > I'm using windows machine and i'm using Net::SSH2 module to connect > to remote machine > How can i use the same piece of code to read a list of hosts from a text > file and then connect to all the hos

Re: regarding hash

2009-02-26 Thread Jim Gibson
On 2/26/09 Thu Feb 26, 2009 6:24 AM, "Irfan Sayed" scribbled: > Hi All, >   > I have sorted one array in ascending order. Now i want to store that sorted > output (key/value pair ) in new hash. How can i do that. By design, hashes do not have an order. Key/value pairs are stored randomly in th

Re: network program for copying file from a remote machine

2009-02-26 Thread Gunnar Hjalmarsson
Anirban Adhikary wrote: Yogesh Sawant wrote: On Thu, Feb 26, 2009 at 1:47 PM, Anirban Adhikary < anirban.adhik...@gmail.com> wrote: I want to write a program which can copy files from remote machine ( like scp) using perl network programming.Is it possible to create such program? how about us

Type and Size of the uploaded file

2009-02-26 Thread Gunnar Hjalmarsson
[ Please reply to the beginners list - I don't answer questions privately. ] Prasath wrote (to me privately): I am new in perl, i have to find the type and size of the uploaded file in perl. Send me the syntax to find With CGI::UploadEasy you can do: use CGI::UploadEasy; my $ue = CGI:

connecting to multiple hosts using Net::SSH2

2009-02-26 Thread monnappa appaiah
Hi all, I'm using windows machine and i'm using Net::SSH2 module to connect to remote machine below is the code i'm using, its working fine if i'm connecting to one host #!/usr/bin/perl -w use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect("hostname") or die "Unabl

Re: regarding regular expression

2009-02-26 Thread John W. Krahn
Irfan Sayed wrote: Hi All, Hello, I have a string like this "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt " now what i need is only all digits before .txt till first underscore. which means i need only output as 5678903 $ perl -le' $_ = "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt "; p

regarding regular expression

2009-02-26 Thread Irfan Sayed
Hi All,   I have a string like this "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt " now what i need is only all digits before .txt till first underscore.   which means i need only output as 5678903   please please help.   Regards Irfan.  

regarding hash

2009-02-26 Thread Irfan Sayed
Hi All,   I have sorted one array in ascending order. Now i want to store that sorted output (key/value pair ) in new hash. How can i do that. Secondly, i want to delete the first occurence of key/value pair.   Please help   Regards irf.

Re: Simplify a script which copies files

2009-02-26 Thread Lauri Nikkinen
Thank you for your reply. Yes, I was also thinking that, thanks. -L 2009/2/26 Yogesh Sawant : > > On Wed, Feb 25, 2009 at 6:14 PM, Lauri Nikkinen > wrote: >> >> Hi, >> >> I wrote a script which copies files in directory to an another >> directory based on user input. Any suggestions to simplify

Re: network program for copying file from a remote machine

2009-02-26 Thread Anirban Adhikary
I am not able to use any module . On Thu, Feb 26, 2009 at 2:05 PM, Yogesh Sawant wrote: > On Thu, Feb 26, 2009 at 1:47 PM, Anirban Adhikary < > anirban.adhik...@gmail.com> wrote: > >> Dear list >> I want to write a program which can copy files from remote machine

Re: Simplify a script which copies files

2009-02-26 Thread Yogesh Sawant
On Wed, Feb 25, 2009 at 6:14 PM, Lauri Nikkinen wrote: > Hi, > > I wrote a script which copies files in directory to an another > directory based on user input. Any suggestions to simplify or shorten > this? I'm using Win XP. > instead of accepting inputs from user, how about using command line a

Re: network program for copying file from a remote machine

2009-02-26 Thread Yogesh Sawant
On Thu, Feb 26, 2009 at 1:47 PM, Anirban Adhikary < anirban.adhik...@gmail.com> wrote: > Dear list > I want to write a program which can copy files from remote machine ( like > scp) using perl network programming.Is it possible to create such program? > how about using CPAN module Net::SCP - http

network program for copying file from a remote machine

2009-02-26 Thread Anirban Adhikary
Dear list I want to write a program which can copy files from remote machine ( like scp) using perl network programming.Is it possible to create such program? If yes then can you give me some examples or tutorials web site name from where I can proceed. Thanks & Regards Anirban Adhikary.