Net::SNMP session creating problem

2004-09-06 Thread Geetha B
Hi , I'm using NET::SNMP perl package to send do SNMP operations. This requires establishing snmp session. upon calling create session , I'm getting error "ERROR: Unknown error creating socket." The code which gives the above error is given below. *

Re: sub routine syntax

2004-09-06 Thread Randy W. Sims
Mike Blezien wrote: Hello All, We've been revamping alot of our older perl scripts and a question came up that I wasn't a 100% clear on. When calling sub routines, is there a significate difference in these formats: 1) some_subroutine(); 2) &some_subroutine; This syntax has the special property

Re: sub routine syntax

2004-09-06 Thread Ing. Branislav Gerzo
Mike Blezien [MB], on Monday, September 06, 2004 at 15:40 (-0500) has on mind: MB> 1) some_subroutine(); use this one. MB> is one a more prefered or more effecient to use then the other(s)?? I think is a more prefered, about eficienty it is same. &sub() is good only when it has the same name as

sub routine syntax

2004-09-06 Thread Mike Blezien
Hello All, We've been revamping alot of our older perl scripts and a question came up that I wasn't a 100% clear on. When calling sub routines, is there a significate difference in these formats: 1) some_subroutine(); 2) &some_subroutine; 3) &some_subroutine(); is one a more prefered or more eff

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, John W. Krahn said: >> map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; > >Very good Gunnar! But the regexp may not work in all cases. > >my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1(?:\D|$)/, keys %myhash; That regex can also be written as /^1(?!\d)/, which r

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Edward WIJAYA wrote: Just thought whether it is possible to do it with "map" function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; Very good Gunnar! But the regexp may not work in all cases. my %myNEW

Re: A regex problem.

2004-09-06 Thread Ing. Branislav Gerzo
Denham Eva [DE], on Monday, September 6, 2004 at 14:41 (+0200) typed: DE> my $filedate =~ s/(\d+)//g; DE> ** DATA DE> C:/directory/MSISExport_20040814.csv DE> C:/directory/MSISExport_20040813.csv DE> Can someone help me with that regex? I am having a frustrating time of I hop

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Gunnar Hjalmarsson
Edward WIJAYA wrote: Just thought whether it is possible to do it with "map" function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [

Re: Splicing Hash problem - possible with "map"?

2004-09-06 Thread Edward WIJAYA
Hi, Thanks so much for the replies. If you literally mean "starts with '1'", i.e., you don't know any more about the key, Yes I literally mean "1" not "10", "100", etc. Just thought whether it is possible to do it with "map" function? Make it into one-liner? then first you must find the key, or us

Re: A regex problem.

2004-09-06 Thread Gunnar Hjalmarsson
Jaffer Shaik wrote: Try in this way. Just remove "my", you will get it. What kind of stupid advice is that? $filedate = "C:/directory/MSISExport_20040814.csv"; ($filedate) =~ s/(\_\d+)//g; Left aside that the parentheses are redundant, that does the opposite of what the OP asked for. -- Gunnar Hj

RE: Splicing Hash problem

2004-09-06 Thread Thomas Bätzler
Edward WIJAYA <[EMAIL PROTECTED]> asked: > How can I take out/splice(?) the element of that hash that > start with '1' and store it into another hash. So in the end > I will have two hashes: Off the top of my head, I'd say my @temp = grep /^1/, keys %myhash; my %myNEWhash; foreach my $k (@temp)

Re: Splicing Hash problem

2004-09-06 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Edward WIJAYA) writes: >Hi, > >If I have this hash: > >%myhash = { > '4 atc' => 'TGCGCatcGA', > '5 ctg' => 'AGctgTGTTT', > '3 NO MOTIF' => 'TCCGTGCGCT', > '1 NO MOTIF' => 'ATGGTTAGGG', #need to splice this >

Re: Splicing Hash problem

2004-09-06 Thread Remo Sanges
On Sep 7, 2004, at 3:15 AM, Edward WIJAYA wrote: How can I take out/splice(?) the element of that hash that start with '1' and store it into another hash. So in the end I will have two hashes: %myNEWhash = { '1 NO MOTIF' => 'ATGGTTAGGG'}; and the current becomes: %myhash = { '4 atc' => '

Splicing Hash problem

2004-09-06 Thread Edward WIJAYA
Hi, If I have this hash: %myhash = { '4 atc' => 'TGCGCatcGA', '5 ctg' => 'AGctgTGTTT', '3 NO MOTIF' => 'TCCGTGCGCT', '1 NO MOTIF' => 'ATGGTTAGGG', #need to splice this '2 caa' => 'GAAGcaaGGC' }; How can I take out/splice(?) the element of th

Re: A regex problem.

2004-09-06 Thread Flemming Greve Skovengaard
Denham Eva wrote: Hello Gurus, In a script I have a piece of code as such:- * snip** my $filedate =~ s/(\d+)//g; Try this instead: my $filedate; if( $var_with_file_name =~ m/(\d+)\.csv$/ ) { $filedate = $1; } print "$filename\n"; * snip end **

RE: A regex problem.

2004-09-06 Thread Jaffer Shaik
Hi, Try in this way. Just remove "my", you will get it. $filedate = "C:/directory/MSISExport_20040814.csv"; ($filedate) =~ s/(\_\d+)//g; print "$filedate\n"; Thank you jaffer -Original Message- From: Denham Eva [mailto:[EMAIL PROTECTED] Sent: Monday, September 06, 2004 6:11 PM To: [EMAI

A regex problem.

2004-09-06 Thread Denham Eva
Hello Gurus, In a script I have a piece of code as such:- * snip** my $filedate =~ s/(\d+)//g; * snip end *** The data I am parsing looks as such :- ** DATA C:/directory/MSISExport_20040814.csv C:/directory/MSISE