Re: CGI - Email Forms

2005-12-08 Thread Bill Stephenson
On Dec 7, 2005, at 3:55 AM, David Dorward wrote: What tests must be in place in order to keep your perl scripts from being hijacked from spammers? Any help would be greatly appreciated. For forms that send email, you don't want to let the user enter a To, CC, or BCC address. Nor should

Re: CGI - Email Forms

2005-12-08 Thread David Dorward
On Wed, Dec 07, 2005 at 01:19:59PM -0600, Bill Stephenson wrote: Nor should you allow new lines ... $subject = User entered data with\nBCC: spam victim [EMAIL PROTECTED] I wasn't aware of that problem. I'm guessing that using CGI.pm to parse input helps solve that problem. Is this correct?

Re: CGI - Email Forms

2005-12-08 Thread David Dorward
On Thu, 2005-12-08 at 12:24 -0600, Bill Stephenson wrote: I tried your example and could not get it to send the email to the spammed address. It just stuck it in the subject line like it should have. I don't have anything special in the script to filter the newline. use

Re: CGI - Email Forms

2005-12-08 Thread Bill Stephenson
On Dec 8, 2005, at 3:27 AM, David Dorward wrote: On Wed, Dec 07, 2005 at 01:19:59PM -0600, Bill Stephenson wrote: Nor should you allow new lines ... $subject = User entered data with\nBCC: spam victim [EMAIL PROTECTED] I wasn't aware of that problem. I'm guessing that using CGI.pm to

Re: how to develop an editor in perl

2005-12-08 Thread Beau E. Cox
Hi Rajeev - At 2005-12-07, 20:55:59 you wrote: Hi, I got a doubt how to develop an editor that can be used to modify files and it has to provide movement of cursor from left to right or right. thanks and regards, Rajeev Kilaru First of all - why would you want to reinvent the wheel with so

Re: how to develop an editor in perl

2005-12-08 Thread John Doe
Beau E. Cox am Donnerstag, 8. Dezember 2005 09.09: Hi Rajeev - At 2005-12-07, 20:55:59 you wrote: Hi, I got a doubt how to develop an editor that can be used to modify files and it has to provide movement of cursor from left to right or right. thanks and regards, Rajeev Kilaru First

Re: How to promote the efficiency

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 9:37, Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:21016 ... and more than 4500 lines. Is the

Re: How to promote the efficiency

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 11:44, Xavier Noria wrote: On Dec 8, 2005, at 9:37, Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Sorry, the file is more than 900M, too large to download. I have run it for one day,and still have nothing to output.Crying... I think maybe some arithmetic is useful for me,and now I'm thinking over it. On 12/8/05, Xavier Noria [EMAIL PROTECTED] wrote: On Dec 8, 2005, at 9:37, Jennifer Garner

Re: How to promote the efficiency

2005-12-08 Thread Ing. Branislav Gerzo
Jennifer Garner [JG], on Thursday, December 8, 2005 at 19:21 (+0800) typed the following: JG Sorry, the file is more than 900M, too large to download. JG I have run it for one day,and still have nothing to output.Crying... JG I think maybe some arithmetic is useful for me,and now I'm thinking

RE: How to promote the efficiency

2005-12-08 Thread Charles K. Clarkson
Jennifer Garner mailto:[EMAIL PROTECTED] wrote: : open (FILE,$file) or die $!; : while(FILE) : { : next if /unknown/o; : next if /^192\.168\./o; : chomp; : my ($ip,$num) = split/:/,$_; : if ($ip =

Re: How to promote the efficiency

2005-12-08 Thread Shawn Corey
Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:21016 ... and more than 4500 lines. the part after : is no use for me,I

Re: How to promote the efficiency

2005-12-08 Thread John W. Krahn
Jennifer Garner wrote: hi,lists, Hello, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:21016 ... and more than 4500 lines. the part after

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Thank you for John.I think your method would be much faster than mine. Now I'm going to rewrite this program with C language,but I'll test it using all the ways given by everyone here.Thanks. On 12/8/05, John W. Krahn [EMAIL PROTECTED] wrote: Jennifer Garner wrote: hi,lists, Hello, I

Re: Parameterizing a module

2005-12-08 Thread vmalik
I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of our keyword. I have never understood it properly. Most books that I referred to say that it's a lexically-scoped global variable. What does that mean? I understand global variables to be the

chop/chomp/?

2005-12-08 Thread Frank Bax
What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *bsd system. -- To unsubscribe,

Re: chop/chomp/?

2005-12-08 Thread Shawn Corey
Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *bsd system.

Re: How to promote the efficiency

2005-12-08 Thread Dr.Ruud
Jennifer Garner schreef: I have a file which is so large,which looking as: 61.156.49.18:28360 222.187.124.4:21016 and more than 45,000,000 lines. the part after : is no use for me, I only need the IP. You could first convert the file to integers, so from 20 bytes per line down to 4 bytes

Re: How to promote the efficiency

2005-12-08 Thread Bob Showalter
John W. Krahn wrote: if ( $2 128 ) { $low{ $1 }++; } else { $high{ $1 }++; } $total{ $1 }++; Why track all three? You could just track (say) low and total, and derive high as (total - low) at print time. -- To unsubscribe, e-mail: [EMAIL

Re: The Difference Between my Globals and our Globals (WAS: Parameterizing a module)

2005-12-08 Thread Shawn Corey
[EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of our keyword. I have never understood it properly. Most books that I referred to say that it's a lexically-scoped global variable. What does that mean? I understand

Re: chop/chomp/?

2005-12-08 Thread Bob Showalter
Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *bsd system.

Re: Parameterizing a module

2005-12-08 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of our keyword. I have never understood it properly. Most books that I referred to say that it's a lexically-scoped global variable. What does that mean? I

Re: Parameterizing a module

2005-12-08 Thread Bob Showalter
[EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of our keyword. I have never understood it properly. Most books that I referred to say that it's a lexically-scoped global variable. What does that mean? I understand

Re: chop/chomp/?

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 16:35, Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm

Re: The Difference Between my Globals and our Globals (WAS: Parameterizing a module)

2005-12-08 Thread vmalik
Shawn, I ran the exmaple that you provided, and it expected as I had the predicted based on the knowledge provided by Wiggins and Bob. Thanks to all of you. Vishal Quoting Shawn Corey [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Hi,John I think you have understanded wrongly with my meaning. The result of $low{ $1 }++ is no use for me.I just want the frequency of IP exists. For example, if there are some IPs exists in '22.33.44.0' : 22.33.44.11 22.33.44.22 22.33.44.22 22.33.44.33 22.33.44.33 22.33.44.44 22.33.44.55

Re: How to promote the efficiency

2005-12-08 Thread Chris Devers
On Fri, 9 Dec 2005, Jennifer Garner wrote: I think you have understanded wrongly with my meaning. The result of $low{ $1 }++ is no use for me.I just want the frequency of IP exists. For example, if there are some IPs exists in '22.33.44.0' : 22.33.44.11 22.33.44.22 22.33.44.22

Re: How to promote the efficiency

2005-12-08 Thread John W. Krahn
Jennifer Garner wrote: Hi,John Hello, I think you have understanded wrongly with my meaning. The result of $low{ $1 }++ is no use for me.I just want the frequency of IP exists. For example, if there are some IPs exists in '22.33.44.0' : 22.33.44.11 22.33.44.22 22.33.44.22

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Now I have resolved this problem,still using perl. Just a little modification to that code,shown as below: foreach my $file (@files) { open (FILE,$file) or die $!; while(FILE) { next if /unknown/o; next if /^192\.168\./o; next