Re: remove duplicate lines

2007-01-09 Thread beast
Owen Cook wrote: my %data_hash; while(){ chomp; # Get rid of line feeds my @bits = split; $data_hash{$bits[0]} = $bits[1]; } It will only remove duplicate key. Is this still acceptable in perl (its very ugly =( while (<>) { chomp; my ($k, $v) = split /,/; my $tmp_key =

Re: remove duplicate lines

2007-01-09 Thread Owen Cook
On Wed, Jan 10, 2007 at 12:47:25PM +0700, beast wrote: > I have these following data: > > a 100 > a 102 > c 100 > a 102 > b 111 > c 100 > c 102 > c 100 > c 100 > a 102 > ... > > I would like to have a list (either array or hash) with unique line . > Any help would appreciated. > Thanks. > 1.

Re: remove duplicate lines

2007-01-09 Thread beast
Mathew Snyder wrote: The way I would do it is to place the initial data instance into a hash if it doesn't already exist. Just do a next if it does. It will remove duplicate key, not line. my %hash=(); while (<>) { chomp; my ($key, $val) = split /,/; $hash{$key} = $val; } while ( m

Re: remove duplicate lines

2007-01-09 Thread Mathew Snyder
beast wrote: > I have these following data: > > a 100 > a 102 > c 100 > a 102 > b 111 > c 100 > c 102 > c 100 > c 100 > a 102 > ... > > I would like to have a list (either array or hash) with unique line . > Any help would appreciated. > Thanks. > > > The way I would do it is to place the init

remove duplicate lines

2007-01-09 Thread beast
I have these following data: a 100 a 102 c 100 a 102 b 111 c 100 c 102 c 100 c 100 a 102 ... I would like to have a list (either array or hash) with unique line . Any help would appreciated. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Re: Reading a files in a folder

2007-01-09 Thread John W. Krahn
Geetha Weerasooriya wrote: > Hi , Hello, > I have data files which are in different folders. I want to run the same > program on all the data files. For example I have 12 folders for 12 > months of the year and each folder contains the files for each day of > the month. So one file contains 30 or

Reading a files in a folder

2007-01-09 Thread Geetha Weerasooriya
Hi , I have data files which are in different folders. I want to run the same program on all the data files. For example I have 12 folders for 12 months of the year and each folder contains the files for each day of the month. So one file contains 30 or 31 files. Can some one kindly guide me t

Re: HoHoH

2007-01-09 Thread John W. Krahn
Dave Gray wrote: > > Yup, three loops. I'll get you started: > > for my $name (keys %dub_hash) { >for my $uid (keys %{$dub_hash{$name}}) { > # do stuff, note the %{...} above to force precedence Parentheses () are used for precedence, %{} dereferences the reference contained in $dub_ha

Re: HoHoH

2007-01-09 Thread oryann9
> my question is how do I access and print all values? I am trying: > > foreach (keys %dub_hash) { > print %{$dub_hash->{$name}->{$uid}->{%gid}->{$gecos} }; > } > > Do I need three loops? What am I doing wrong? Yup, three loops. I'll get you started: for my $name (keys %dub_hash) { for my $u

Re: HoHoH

2007-01-09 Thread John W. Krahn
oryann9 wrote: > I have a HoHoH structure that looks like after running print Dumper (\%hash); > > 'prlhNSSA' => { > '1499' => { > 'gecos' => 'First Name Last Name,CIS,location, > 'host' => '/var/tmp/passwd.tgpdrpp1.hpux', > 'gid' => '205' >

Re: HoHoH

2007-01-09 Thread Dave Gray
On 1/9/07, oryann9 <[EMAIL PROTECTED]> wrote: I have a HoHoH structure that looks like after running print Dumper (\%hash); 'prlhNSSA' => { '1499' => { 'gecos' => 'First Name Last Name,CIS,location,

Re: % installing question

2007-01-09 Thread Jorge Almeida
On Tue, 9 Jan 2007, David Gama Rodriguez wrote: Reading all the thread, I'd like to comment that maybe Jaime problem is that he must uninstall the perl version that came with gentoo: That would probably be a bad idea, as Perl is essential to gentoo. And I don't think there is a problem with h

Re: %Re: installing question

2007-01-09 Thread Jorge Almeida
On Tue, 9 Jan 2007, Mathew wrote: regarding it. I think the Windows comment though was a simply a clever retort to a pointless post. Yes, it was a simple sarcasm. It seems that both the sarcasm and the irony preceeding it were lost on the intended destinatary. Let's forget it. Still, I apolog

HoHoH

2007-01-09 Thread oryann9
I have a HoHoH structure that looks like after running print Dumper (\%hash); 'prlhNSSA' => { '1499' => { 'gecos' => 'First Name Last Name,CIS,location, 'host' => '/var/tmp/passwd.

Re: Checking for infinite loops

2007-01-09 Thread Dave Gray
On 1/8/07, hOURS <[EMAIL PROTECTED]> wrote: Hi everyone, Jay offered me the following code to help with something. I don't undertand it, but tried to use it anyway to see if it would work. The computer told me there was a syntax error in the area I highlighted in color. I can't find it

Re: Video and perl

2007-01-09 Thread Herman Gerritsen
I have been looking on the ffmpeg website and found the FFmpeg perl module. I think it is a good option. I presume the FFmpeg module gives me a faster interface than if I call the ffmpeg with the system command? Thanks for the fast responses Herman On 1/9/07, Mike Martin <[EMAIL PROTECTED]> wro

% installing question

2007-01-09 Thread David Gama Rodriguez
Ok ok, Reading all the thread, I'd like to comment that maybe Jaime problem is that he must uninstall the perl version that came with gentoo: emerge --unmerge perl and then install perl with his own configuration maybe that will work Greetings El mar, 09-01-2007 a las 10:14 -0500, Mathew e

Re: regex to split whitespace-separated values

2007-01-09 Thread Ovid
--- Rob Dixon <[EMAIL PROTECTED]> wrote: > The default behaviour can be invoked explicitly by using a single > space as the > separator parameter for split. So > > my @array = split ' ', $line; > > has the desired effect. Ah, thank you. I didn't know that :) Cheers, Ovid -- Buy the book --

Re: %Re: installing question

2007-01-09 Thread Mathew
I don't know anything about Gentoo nor do I care about a debate regarding it. I think the Windows comment though was a simply a clever retort to a pointless post. Mathew David Gama Rodriguez wrote: > Hi all, > > I read this post and I'm concern. > why are you saying gentoo is a bad distributio

%Re: installing question

2007-01-09 Thread David Gama Rodriguez
Hi all, I read this post and I'm concern. why are you saying gentoo is a bad distribution, I dont want to start a fight to know which distribution is the best that is not the point. I just want to know why this: "has a whole history of open source distrobuters who boycot it. Check out 'gaim' for

Re: Checking for infinite loops

2007-01-09 Thread hOURS
Thanks. I did change the longRunningModule part. The syntax error was in the line: if ($@) { apparently at the end of the line, which I believe usually means opening brackets without closing brackets or vice versa. Fred Jay Savage <[EMAIL PROTECTED]> wrote: On 1/8/07, hOURS wrote: >

Re: regex to split whitespace-separated values

2007-01-09 Thread Rob Dixon
Ovid wrote: > --- Bram Kuijper <[EMAIL PROTECTED]> wrote: > >> I have a single line of whitespace separated values, e.g.: >> >>50 100 >> 150 200 300 50 >> >> Now I want to split these values into an array using split, li

Re: installing question

2007-01-09 Thread Arvind Autar
debian. Gentoo has a whole history of open source distrobuters who boycot it. Check out 'gaim' for example. 2007/1/9, Jorge Almeida <[EMAIL PROTECTED]>: On Tue, 9 Jan 2007, Arvind Autar wrote: > gentoo is a bad distrobution you should remove it and install a sane > distrobution. > I will foll

Re: installing question

2007-01-09 Thread Matt
And this answers his question exactly how? Mathew Arvind Autar <[EMAIL PROTECTED]> wrote: gentoo is a bad distrobution you should remove it and install a sane distrobution. Yours truly 2007/1/9, Jorge Almeida : > > I just installed Perl from source. My distribution (gentoo linux) > supports

Re: installing question

2007-01-09 Thread Jorge Almeida
On Tue, 9 Jan 2007, Arvind Autar wrote: gentoo is a bad distrobution you should remove it and install a sane distrobution. I will follow your suggestion, of course. What brand of Windows do you favor? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: test

2007-01-09 Thread Matt Richards
On Tue, 2007-01-09 at 18:45 +0800, Sayed, Irfan (Irfan) wrote: > test it works :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: test

2007-01-09 Thread Matt Richards
On Tue, 2007-01-09 at 18:45 +0800, Sayed, Irfan (Irfan) wrote: > test it works :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: installing question

2007-01-09 Thread Arvind Autar
gentoo is a bad distrobution you should remove it and install a sane distrobution. Yours truly 2007/1/9, Jorge Almeida <[EMAIL PROTECTED]>: I just installed Perl from source. My distribution (gentoo linux) supports Perl, of course, but not every module is supported, and I didn't want to end

Re: regex to split whitespace-separated values

2007-01-09 Thread Ovid
--- Bram Kuijper <[EMAIL PROTECTED]> wrote: > I have a single line of whitespace separated values, e.g.: > >50 100 > 150 200 300 50 > > Now I want to split these values into an array using split, like: > > my @array

test

2007-01-09 Thread Sayed, Irfan \(Irfan\)
test

regex to split whitespace-separated values

2007-01-09 Thread Bram Kuijper
Hi all, this is a real beginner question, but I don't seem to find a good solution: I have a single line of whitespace separated values, e.g.: 50 100 150 200 300 50 Now I want to split these values into an array usin

installing question

2007-01-09 Thread Jorge Almeida
I just installed Perl from source. My distribution (gentoo linux) supports Perl, of course, but not every module is supported, and I didn't want to end up with a mixture of supported/hand-compiled modules. So, I chose /usr/local/opt/perl to keep all Perl things. When using ./Configure, I chose th

perl and network connection

2007-01-09 Thread Tatiana Lloret Iglesias
Hi all, i'm developping a perl script which uses WWW-Mechanize and performs a big number of submit_form I've noticed that because of the execution of this script network connection fails intermitently ... how can i avoid this? Thanks T.

Video and perl

2007-01-09 Thread Herman Gerritsen
Hi there, This is my first post on any perl mailinglist. I have been learning perl lately using Oreilly's "Learning Perl 4th edition" I am now going through "Intermediate perl". for my graduation I am trying to write a progam that will read data from the serial port (/dev/ttyS*). This data is co

Re: run command in a particular dir

2007-01-09 Thread Mumia W.
On 01/09/2007 12:49 AM, [EMAIL PROTECTED] wrote: Hi, I need to run a particular command "cleartool des " from a partiuclar folder. For example: I need to get into directory m: cd \ Arun_Main and then run cleartool des $temp . I wrote the following code for this foreach $temp(@vob2) { qx(m: cd