Better Regrex

2011-03-23 Thread Mike Blezien
Hello, I'm working on a simple regrex issue which I got to work but I think there's a better way to do this. This is what I have right now. I need to simply remove the string section in red. my($marker); my $message = "Why are we here? To bless, inspire and uplift one another. #TRB #inspirati

Re: Better Regrex

2011-03-23 Thread Brian Fraser
Regex, or maybe regexp, but not regrex.. That doesn't make any sense : p I have no idea what you mean with "section in red." However, there's a few things wrong with your code: What is $mark? Don't you mean $marker? As it stands, your snipped would die under strict, and in non-strict $mark would b

Re: Better Regrex

2011-03-23 Thread Chas. Owens
On Wed, Mar 23, 2011 at 09:05, Mike Blezien wrote: > Hello, > > I'm working on a simple regrex issue which I got to work but I think there's > a better way to do this. This is what I have right now. I need to simply > remove the string section in red. > > my($marker); > my $message = "Why are we

Re: Better Regrex

2011-03-23 Thread Mike Blezien
- Original Message - From: "Chas. Owens" To: "Mike Blezien" Cc: "Perl List" Sent: Wednesday, March 23, 2011 8:42 AM Subject: Re: Better Regrex On Wed, Mar 23, 2011 at 09:05, Mike Blezien wrote: Hello, I'm working on a simple regrex issue which I got to work but I think there's a

Need Help. .Issue with format statement

2011-03-23 Thread Sudhir
My work environment recently shifted from perl v5.6 to perl v5.10 I found one issue with perl format statement in latest version v5.10 sample code: #!/bin/env perl use strict; &genRep(); sub genRep { format DURATION_TOP = @<<< "This is TOP" -

Perl packet tracking module

2011-03-23 Thread Parag Kalra
Hi, Does Perl have any packet tracking module equivalent to tcpdump, snoop, tshark or tethereal TIA ~Parag

Re: Perl packet tracking module

2011-03-23 Thread Olof Johansson
On 2011-03-23 09:05 -0700, Parag Kalra wrote: > Hi, > > Does Perl have any packet tracking module equivalent to tcpdump, snoop, > tshark or tethereal Check out Net::Pcap... -- - Olof Johansson - www: http://www.stdlib.se/ - {mail,xmpp}: o...@ethup.se - irc: zibri on Freeno

Re: Need Help. .Issue with format statement

2011-03-23 Thread Chas. Owens
On Wed, Mar 23, 2011 at 08:47, Sudhir wrote: > My work environment recently shifted from perl v5.6 to perl v5.10 > > I found one issue with perl format statement in latest version v5.10 > > sample code: > > #!/bin/env perl > use strict; > > &genRep(); > > sub genRep > { > format DURATION_TOP = > @

RE: foreach loop

2011-03-23 Thread Chris Stinemetz
Thanks Jim, I am still unable to sum up the field $rlptxat. The error I am getting is below: Scalar found where operator expected at ./jim.pl line 52, near "$sum" (Missing semicolon on previous line?) "my" variable %sum masks earlier declaration in same scope at ./jim.pl line 54. "my" va

Re: foreach loop

2011-03-23 Thread Jim Gibson
On 3/23/11 Wed Mar 23, 2011 10:02 AM, "Chris Stinemetz" scribbled: > Thanks Jim, > > I am still unable to sum up the field $rlptxat. > > The error I am getting is below: > > Scalar found where operator expected at ./jim.pl line 52, near "$sum" > (Missing semicolon on previous line?)

Re: foreach loop

2011-03-23 Thread Chas. Owens
On Mon, Mar 21, 2011 at 01:46, Mike McClain wrote: snip >> > my @report = map >> > "$_->{cell}\t$_->{sect}\t$_->{carr}\t$_->{chan}\t$_->{dist}\n" , @sorted; >> > print @report ; >> >> This map will consume a lot of memory, better do it using a foreach loop. > > In what way will the use of map here

Re: foreach loop

2011-03-23 Thread Jim Gibson
On 3/23/11 Wed Mar 23, 2011 10:02 AM, "Chris Stinemetz" scribbled: In addition to the missing semicolon, the declaration of %sum must appear before it is used, i.e. before the while() loop. The line adding values of $rlptxat1 to the sum must appear inside the while loop, not after it. Run this

RE: foreach loop

2011-03-23 Thread Chris Stinemetz
That worked! Thanks Jim. Chris -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: shift oo

2011-03-23 Thread Brandon McCaig
You still seem a bit confused so lets try to start over straight to the point: On Fri, Mar 18, 2011 at 4:31 PM, shawn wilson wrote: > i ran across a peace of interesting code: > > my $writer = shift->( >  [ 200, [ "Content-type" => "text/plain" ], $s ] > ); To understand just this piece of code,

RE: foreach loop

2011-03-23 Thread Chris Stinemetz
Jim, I have another question. How do I sort the results so it is from smallest to largest starting with $cell,$sect,$carr? Thanks again for all you help. I am gaining a much better understanding. This is what I got: #!/usr/bin/perl use warnings; use strict; #my $filepath = 'C:/temp/PCMD';

Re: shift oo

2011-03-23 Thread Brandon McCaig
On Fri, Mar 18, 2011 at 5:34 PM, shawn wilson wrote: > sorry, i don't know how to do any better in gmail (and does it different on > the gmail app on my android too - sorta messed up). should i color replies > differently or something? Quoting is typically done by prefixing each line of the quote

Twisting Text

2011-03-23 Thread Emeka
Hello All, I have a file containing dictionary of words ... I would like to play with the file in this way. Say I pick a word "Heaves" . I would like to find other words that could be derive from "Heaves" Have, Haves, eave , eaves, Has, see, eves and so on. I would not want to use brute force ,

Re: Re:must 'x' in g^x be a prime number

2011-03-23 Thread fakessh @
i paste a discussion to openssl-users how to implement this attack in perl Le mercredi 23 mars 2011 à 09:13 +0800, Ziyu Liu a écrit : > 1)The exponent x in DH can be any number.It should be big enough to > bear attack.The source in DH told us what exponent x can be. > ref:dh_key.c > if (ge

Re: Twisting Text

2011-03-23 Thread Greg J
Emeka, What you are looking for is a word stemmer. You might want to take a look at something like Porter Stemmer. -Greg On Wed, Mar 23, 2011 at 5:35 PM, Emeka wrote: > Hello All, > > I have a file containing dictionary of words ... I would like to play with > the file in this way. Say I pi

Re: Twisting Text

2011-03-23 Thread John W. Krahn
Emeka wrote: Hello All, Hello, I have a file containing dictionary of words ... I would like to play with the file in this way. Say I pick a word "Heaves" . I would like to find other words that could be derive from "Heaves" Have, Haves, eave , eaves, Has, see, eves and so on. I would not w

Re: foreach loop

2011-03-23 Thread Jim Gibson
On 3/23/11 Wed Mar 23, 2011 12:49 PM, "Chris Stinemetz" scribbled: > Jim, > > I have another question. > > How do I sort the results so it is from smallest to largest starting with > $cell,$sect,$carr? It is difficult to sort a multi-level, nested hash. I would transfer the values to an arra

Re: shift oo

2011-03-23 Thread Peter Scott
On Tue, 22 Mar 2011 13:41:59 -0700, Randal L. Schwartz wrote: >> "Peter" == Peter Scott writes: > >>> my $s = Streamer->new; >>> my $app = sub { >>> return sub { >>> $s->open_fh; >>> my $writer = shift->( >>> [ 200, [ "Content-type" => "text/plain" ], $s ] ); >>> }; >>> }; > > Peter> As it