Re: batching and threads

2011-03-12 Thread Shlomi Fish
Hi "Unknown User", On Saturday 12 Mar 2011 16:27:27 Unknown User wrote: > I am looking for a module that will enable easy batching with perl > threads, somewhat like Parallel::ForkManager for forking in batches. > Does anybody know of such a module? Please see this previous thread in this list:

Re: How to kill child process running in background

2011-03-12 Thread Shlomi Fish
Hi Narasimha, first of all, if your code is not confidential or anything like that, then please include it here, or alternatively using a paste site such as http://pastie.org/ or http://paste.debian.net/ (the latter is useful for other things beside Debian) or maybe something like http://bitbuc

Re: Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Alan Haggai Alavi
Hello Parag, Vern Nice. Completely impressed. But I thought Perl might have some internal variable at least for Kernel version. But anyways this work for me too. `Config` module's `config_re` function can be used: =pod code use Config 'config_re'; my ($os_version) = config_re('^osvers'); $o

Re: Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Parag Kalra
perl -MConfig -e 'print "$Config{perlpath}:$^V\n$ENV{SHELL}:" . qx{ bash > --version | head -1 } . "/kernel/$^O:" . qx{ uname -r }' > Vern Nice. Completely impressed. But I thought Perl might have some internal variable at least for Kernel version. But anyways this work for me too. ~Parag

Re: Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Alan Haggai Alavi
Hello Parag, perl -MConfig -le 'print "$Config{perlpath}:$^V\n$ENV{SHELL}: \n/kernel/$^O:"' =pod code perl -MConfig -e 'print "$Config{perlpath}:$^V\n$ENV{SHELL}:" . qx{ bash --version | head -1 } . "/kernel/$^O:" . qx{ uname -r }' =cut Regards, Alan Haggai Alavi. -- The difference makes th

Re: how can I get the file header size of tiff images?

2011-03-12 Thread leaf falling
On Mar 13, 1:44 am, rob.di...@gmx.com (Rob Dixon) wrote: > On 12/03/2011 02:53, leaf falling wrote: > > > > > how can I get the file header size of tiff images? Thanks a lot. > > What exactly do you mean? The TIFF specification at > >    

Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Parag Kalra
Hi, Wanted to have suggestions to modify below 1 liner so that it can also print Shell (preferably Bash) version and along with Operating System Kernel version. Currently I am just printing the place holders for Shell and Kernel version numbers. perl -MConfig -le 'print "$Config{perlpath}:$^V\n$

Re: help with array elements

2011-03-12 Thread Paul Johnson
On Sat, Mar 12, 2011 at 01:35:31PM -0500, Shawn H Corey wrote: > On 11-03-12 10:56 AM, kurtz le pirate wrote: > >quick write, not tested > > I suggest you test it. Is this general advice or do you see a problem with the code? If it is the former, I agree. If it is the latter, please point out t

Re: help with array elements

2011-03-12 Thread Paul Johnson
On Sat, Mar 12, 2011 at 05:31:06PM +, Rob Dixon wrote: > On 12/03/2011 15:41, ashwin ts wrote: > > > >Thank you all for the support.It helped me a lot.i tried working with arrays > >as well as with hash.Both the approaches works fine in the case of a small > >array with few elements. > >When i

Re: help with array elements

2011-03-12 Thread John Delacour
At 03:14 -0500 12/03/2011, Uri Guttman wrote: this replaces the entire if/else statement: $hash{$item}++ ; ...it is a standard perl idiom you need to know so you don't waste code like that. Nice! so #!/usr/local/bin/perl use strict; my %hash; my @array = split //, 12342312111467; f

Re: help with array elements

2011-03-12 Thread Shawn H Corey
On 11-03-12 10:56 AM, kurtz le pirate wrote: quick write, not tested I suggest you test it. -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and communication as it is about coding. The secret to gr

Re: help with array elements

2011-03-12 Thread kurtz le pirate
In article , ashwint...@gmail.com (ashwin ts) wrote: > Hi, > > I am a newbie to perl. > I have an array which has few elements like '1,2,3,4,2,3,1,2,1,1,1,4,6,7' > i need to know how many times each element has occurred in the same array. > for example 1-5 times > 2-3 times...

Re: how can I get the file header size of tiff images?

2011-03-12 Thread Rob Dixon
On 12/03/2011 02:53, leaf falling wrote: how can I get the file header size of tiff images? Thanks a lot. What exactly do you mean? The TIFF specification at say "A TIFF file begins with an 8-byte image file header...". So perh

Re: help with array elements

2011-03-12 Thread Rob Dixon
On 12/03/2011 15:41, ashwin ts wrote: Thank you all for the support.It helped me a lot.i tried working with arrays as well as with hash.Both the approaches works fine in the case of a small array with few elements. When i tried the same for a large array , i started getting "out of memory" error

Re: help with array elements

2011-03-12 Thread ashwin ts
Hi, Thank you all for the support.It helped me a lot.i tried working with arrays as well as with hash.Both the approaches works fine in the case of a small array with few elements. When i tried the same for a large array , i started getting "out of memory" error. Any suggestions would be of great

batching and threads

2011-03-12 Thread Unknown User
I am looking for a module that will enable easy batching with perl threads, somewhat like Parallel::ForkManager for forking in batches. Does anybody know of such a module? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://lea

Re: help with array elements

2011-03-12 Thread Paul Johnson
On Sat, Mar 12, 2011 at 09:20:01AM +0100, mag...@trapd00r.se wrote: > On 2011-03-12 13:17, ashwin ts wrote: > > >I have an array which has few elements like '1,2,3,4,2,3,1,2,1,1,1,4,6,7' > >i need to know how many times each element has occurred in the same array. > >for example 1-5 times > >

how can I get the file header size of tiff images?

2011-03-12 Thread leaf falling
how can I get the file header size of tiff images? Thanks a lot. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: help with array elements

2011-03-12 Thread magnus
On 2011-03-12 13:17, ashwin ts wrote: Hi, Hello, I have an array which has few elements like '1,2,3,4,2,3,1,2,1,1,1,4,6,7' i need to know how many times each element has occurred in the same array. for example 1-5 times 2-3 times... Use a hash. #!/usr/bin/perl use

Re: help with array elements

2011-03-12 Thread Uri Guttman
> "PK" == Parag Kalra writes: PK> my @array = (1,2,3,4,2,3,1,2,1,1,1,4,6,7); PK> my %hash; PK> foreach my $item (@array){ PK> if (exists $hash{$item}) { PK> $hash{$item} = $hash{$item} + 1; PK> } else { PK> $hash{$item} = 1; PK> } PK> } this repl

Re: help with array elements

2011-03-12 Thread Alan Haggai Alavi
Hello Ashwin, I have an array which has few elements like '1,2,3,4,2,3,1,2,1,1,1,4,6,7' i need to know how many times each element has occurred in the same array. for example 1-5 times 2-3 times... could some one throw some light on how i can do this. Store the array contents into a hash, upda

Re: help with array elements

2011-03-12 Thread Parag Kalra
> > > could some one throw some light on how i can do this. > thanks in advance.. > use strict; use warnings; my @array = (1,2,3,4,2,3,1,2,1,1,1,4,6,7); my %hash; foreach my $item (@array){ if (exists $hash{$item}) { $hash{$item} = $hash{$item} + 1; } else { $hash{$item} =