Re: How does grep command compare a hash element with an array ofhash references?

2010-09-26 Thread Dr.Ruud
On 2010-09-25 13:07, John W. Krahn wrote: Dr.Ruud wrote: On 2010-09-25 01:57, Vaishnavi Saba wrote: My query: In the code shown below, How does *grep* compare a scalar( * $seen{$_}* ) with an array of hash references ( *...@_* ). = @common = inter( \%foo, \%bar, \%joe ); sub inter

Re: How does grep command compare a hash element with an array of hash references?

2010-09-25 Thread Dr.Ruud
On 2010-09-25 01:57, Vaishnavi Saba wrote: My query: In the code shown below, How does *grep* compare a scalar( * $seen{$_}* ) with an array of hash references ( *...@_* ). = @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href ( @_ ) { while

Re: How does grep command compare a hash element with an array of hash references?

2010-09-25 Thread John W. Krahn
Dr.Ruud wrote: On 2010-09-25 01:57, Vaishnavi Saba wrote: My query: In the code shown below, How does *grep* compare a scalar( * $seen{$_}* ) with an array of hash references ( *...@_* ). = @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href ( @_ ) { while (my

How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread Vaishnavi Saba
Hi, My query: In the code shown below, How does *grep* compare a scalar( * $seen{$_}* ) with an array of hash references ( *...@_* ). = @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href (@_) { while (my $k = each %$href ) { $seen{$k

Re: How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread John W. Krahn
Vaishnavi Saba wrote: Hi, Hello, My query: In the code shown below, How does *grep* compare a scalar( * $seen{$_}* ) with an array of hash references ( *...@_* ). An array in scalar context returns the number of elements in the array and @_ (which is an alias to @common) contains 3

Re: How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread Erez Schatz
On 09/25/2010 01:57 AM, Vaishnavi Saba wrote: @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href (@_) { while (my $k = each %$href ) { $seen{$k}++; } } return grep { $seen{$_} == @_ } keys %seen; } Usually not a good

How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread benbart
Hi all, Please note the Perl script that am trying to write at end the of this email, after the dashes. I have two files that contains thousands and millions of records of two database tables that are supposed to be replicated and same similar amount of records but, unfortunately, they're not.

Re: How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread Mumia W.
On 08/23/2006 05:09 PM, [EMAIL PROTECTED] wrote: [...] Am guessing that I have to take out the array bit and just modify this line here: @match=grep{/$lookfor/[EMAIL PROTECTED]; But I am not sure how or what I should change it to. How do I tell grep to search from a file instead of from an

Re: How to grep $string from a file? How to run sed-like commands fromPerl?

2006-08-23 Thread Dr.Ruud
benbart schreef: [I see no direct relation of the Subject to the question.] I have two files that contains thousands and millions of records of two database tables that are supposed to be replicated and same similar amount of records but, unfortunately, they're not. If the files are sorted,

RE: How to grep out contnts of a column

2005-07-11 Thread Nazary, David
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zentara Sent: Saturday, July 02, 2005 8:35 AM To: beginners-cgi@perl.org Subject: Re: How to grep out contnts of a column On Sat, 02 Jul 2005 11:29:08 -0400, zentara [EMAIL PROTECTED] wrote: Sorry, I had

RE: How to grep out contnts of a column

2005-07-11 Thread Ovid
--- Nazary, David [EMAIL PROTECTED] wrote: Can't locate Filter/Util/Call.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/lib/Inline/Files.pm line 6. BEGIN failed--compilation aborted at C:/Perl/lib/Inline/Files.pm line 6. snip I guess I am missing a Filter module, but

How to grep out contnts of a column

2005-07-01 Thread Nazary, David
Hi everyone; One of our tools provides following output: cut LICENSES: Max-Users Expires Password [status] 62 none 3abbc829.67e2685f.02 [Valid] Maximum active users allowed: 62 Current active users: 17 ACTIVE users: User Priority

How to grep

2002-09-18 Thread Javeed SAR
Hi All, I have a output as follows: I like to grep first two lines(it should be in loop) ==Line 1 ==Line 2 Oplog IDs for row ERL_ComEPR_Project_Management ( eh20417c): ==Line 1 oid:9534a99c.142611d4.a2d5.00:90:27:cc:b7:c8=5467