removing duplicates

2008-02-05 Thread boll
I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the duplicate lines? 2. How can I fix it? Thanks for any advice, John --- #!/usr/bin/perl use warnings; use strict;

Hashes

2008-02-05 Thread t1279k
Hi i am not able to declare hases first i tried this * use strict my %familyname; $familyname{mark}=antony; and i get an error Global symbol %familyname requires explicit package name next i tried

Re: Hashes

2008-02-05 Thread Omega -1911
On Feb 4, 2008 10:05 PM, [EMAIL PROTECTED] wrote: Hi i am not able to declare hases first i tried this * use strict my %familyname; $familyname{mark}=antony; and i get an error Global symbol %familyname

Re: removing duplicates

2008-02-05 Thread 亂世貓熊
--- #!/usr/bin/perl use warnings; use strict; open ALLNAMES, emails.txt or die File: infile failed to open: $!\n; my @allnames = ALLNAMES; chomp @allnames ; # I don't know why, but seems you need this my %seen = (); my @unique = grep { ! $seen{ $_ }++ }

Substituting across lines using s///gs

2008-02-05 Thread R (Chandra) Chandrasekhar
Dear Folks, This is a question about s///sg across lines from a file slurped in file mode. I am trying to change occurrences of into amp;. As a minimal example, I used the contrived file below where single- and multi-line records are delimited by The only real-world text is a hyperlink

Re: removing duplicates

2008-02-05 Thread Rob Dixon
boll wrote: I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the duplicate lines? 2. How can I fix it? Thanks for any advice, John --- #!/usr/bin/perl use

Re: Substituting across lines using s///gs

2008-02-05 Thread John W. Krahn
R (Chandra) Chandrasekhar wrote: Dear Folks, Hello, This is a question about s///sg across lines from a file slurped in file mode. I am trying to change occurrences of into amp;. As a minimal example, I used the contrived file below where single- and multi-line records are delimited by

Re: removing duplicates

2008-02-05 Thread Chas. Owens
On Feb 5, 2008 1:18 AM, boll [EMAIL PROTECTED] wrote: I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the duplicate lines? snip Because that is what the code says to do. It says to print

Re: Substituting across lines using s///gs

2008-02-05 Thread Rob Dixon
R (Chandra) Chandrasekhar wrote: Dear Folks, This is a question about s///sg across lines from a file slurped in file mode. I am trying to change occurrences of into amp;. As a minimal example, I used the contrived file below where single- and multi-line records are delimited by The

Re: WWW::Mechanize's JS plugin

2008-02-05 Thread David Moreno
It says you should use the experimental method: The experimental version of WWW::Mechanize available at http://www-mechanize.googlecode.com/svn/branches/plugins/ D. On Fri, 2008-02-01 at 17:04 +0800, J. Peng wrote: I found this module on cpan:

Re: removing duplicates

2008-02-05 Thread obdulio santana
May be this helps perl -lne print if ++$D{$_} == 1 address.txt regards 2008/2/5, Rob Dixon [EMAIL PROTECTED]: boll wrote: I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the

parsing html question

2008-02-05 Thread isaac2004
hello, i am trying to parse an html document for links for output, my idea is to grab the URL from a form and send the URL to another file that does the actual parse process. i am aware that HTML:Parser has a built in for this, but i want to learn regex better. my plan after i get the file is to

Re: Substituting across lines using s///gs

2008-02-05 Thread Gunnar Hjalmarsson
R (Chandra) Chandrasekhar wrote: I am trying to change occurrences of into amp;. Are you sure that's what you want to do? In an HTML context, it's more common to do that only when is not already the beginning of a character entity, such as 'amp;' or 'quot;' or '#60;' etc.

Help on perl alarm

2008-02-05 Thread littlehelphere
I am using perl alarm within a script and having an issue. I want to access a host by first trying rsh and if that fails use ssh. I can get the command to run with only one of the commands but when I add both it fails. I must be missing something simple Here is the info: Part of script

Re: Help on perl alarm

2008-02-05 Thread Jay Savage
On Feb 5, 2008 10:22 AM, [EMAIL PROTECTED] wrote: I am using perl alarm within a script and having an issue. I want to access a host by first trying rsh and if that fails use ssh. I can get the command to run with only one of the commands but when I add both it fails. I must be missing

Re: removing duplicates

2008-02-05 Thread boll
Rob Dixon wrote: boll wrote: I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the duplicate lines? 2. How can I fix it? Thanks for any advice, John ---

Re: parsing html question

2008-02-05 Thread Tom Phoenix
On Feb 5, 2008 10:36 AM, isaac2004 [EMAIL PROTECTED] wrote: hello, i am trying to parse an html document for links for output, my idea is to grab the URL from a form and send the URL to another file that does the actual parse process. i am aware that HTML:Parser has a built in for this, but i

Re: Help on perl alarm

2008-02-05 Thread Rob Dixon
[EMAIL PROTECTED] wrote: I am using perl alarm within a script and having an issue. I want to access a host by first trying rsh and if that fails use ssh. I can get the command to run with only one of the commands but when I add both it fails. I must be missing something simple Here is the