Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > SB> my $results > SB> = timethese( 10, { > SB> 'rsync' => sub { `rsync -arc $directory $backup` }, > SB> 'perl-cp' => sub { dircopy( $directory, $backup ) }, > > to make this a proper b

Re: how to do a `cp` on millions of files

2009-09-28 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> my $results SB> = timethese( 10, { SB> 'rsync' => sub { `rsync -arc $directory $backup` }, SB> 'perl-cp' => sub { dircopy( $directory, $backup ) }, to make this a proper benchmark, you need to remove all t

Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > SB> Perhaps there is a Perl way to do it, but otherwise, for 250GB of data, > SB> research dump/restore, and test it out (after making a backup). > > SB> imho, you shouldn't use another layer of abstraction for managing such a >

Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
Jim Gibson wrote: > At 10:50 PM -0400 9/28/09, Steve Bertrand wrote: >> xufengnju wrote: >>> Hi all, >>> I have a storage server that holds one million of images with well >>> structured directory structure such as >>> >>> /data/user1/2008/09/12/image1.jpg >>> /data/user1/2008/09/12/image2.jpg

Re: how to do a `cp` on millions of files

2009-09-28 Thread Jim Gibson
At 10:50 PM -0400 9/28/09, Steve Bertrand wrote: xufengnju wrote: Hi all, I have a storage server that holds one million of images with well structured directory structure such as /data/user1/2008/09/12/image1.jpg /data/user1/2008/09/12/image2.jpg ... /data/user2/2009/01/01/image1.jpg

Re: how to do a `cp` on millions of files

2009-09-28 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> Perhaps there is a Perl way to do it, but otherwise, for 250GB of data, SB> research dump/restore, and test it out (after making a backup). SB> imho, you shouldn't use another layer of abstraction for managing such a SB> large volume of data, unle

Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
Steve Bertrand wrote: > xufengnju wrote: >> Hi all, >> I have a storage server that holds one million of images with well >> structured directory structure such as >> >> /data/user1/2008/09/12/image1.jpg >> /data/user1/2008/09/12/image2.jpg >> ... >> /data/user2/2009/01/01/image1.jpg >> ... >> >>

Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
Steve Bertrand wrote: > xufengnju wrote: >> Hi all, >> I have a storage server that holds one million of images with well >> structured directory structure such as >> >> /data/user1/2008/09/12/image1.jpg >> /data/user1/2008/09/12/image2.jpg >> ... >> /data/user2/2009/01/01/image1.jpg >> ... >> >>

Re: Installing Tie::CSV_File in PPM

2009-09-28 Thread Soham Das
From: Sisyphus To: Soham Das ; beginners@perl.org Sent: Tuesday, 29 September, 2009 3:45:41 AM Subject: Re: Installing Tie::CSV_File in PPM - Original Message - From: "Soham Das" To: Sent: Tuesday, September 29, 2009 4:51 AM Subject: Installing Tie

Re: how to do a `cp` on millions of files

2009-09-28 Thread Steve Bertrand
xufengnju wrote: > Hi all, > I have a storage server that holds one million of images with well structured > directory structure such as > > /data/user1/2008/09/12/image1.jpg > /data/user1/2008/09/12/image2.jpg > ... > /data/user2/2009/01/01/image1.jpg > ... > > I want to copy them to the /data2

how to do a `cp` on millions of files

2009-09-28 Thread xufengnju
Hi all, I have a storage server that holds one million of images with well structured directory structure such as /data/user1/2008/09/12/image1.jpg /data/user1/2008/09/12/image2.jpg ... /data/user2/2009/01/01/image1.jpg ... I want to copy them to the /data2 directory in the same server on anothe

GD::Text::Wrap

2009-09-28 Thread Jo for lists and groups
I originally started with GD $image->string(); which worked fine, except the text is too long. I then found text::wrap could be the solution, but I can't get it to work. I am trying to print red text on a black background. I am only getting the background. What am I missing or doing wrong? Jo

Re: Installing Tie::CSV_File in PPM

2009-09-28 Thread Sisyphus
- Original Message - From: "Soham Das" To: Sent: Tuesday, September 29, 2009 4:51 AM Subject: Installing Tie::CSV_File in PPM I am trying to install Tie::CSV_File through the ActivePerl PPM. But try as I might, I am not able to spot it. It also happens that CPAN repository is not

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
Soham Das wrote: My agenda actually is two pronged. I have read Beginning Perl and a bit of Intermediate Perl, though was able to solve individual problems, but I was not sure,if I can code myself out of a wet paperbag. So I thought, lets chuck theory. Its better to get hands dirty with some r

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
My agenda actually is two pronged. I have read Beginning Perl and a bit of Intermediate Perl, though was able to solve individual problems, but I was not sure,if I can code myself out of a wet paperbag. So I thought, lets chuck theory. Its better to get hands dirty with some real life code. Act

Installing Tie::CSV_File in PPM

2009-09-28 Thread Soham Das
I am trying to install Tie::CSV_File through the ActivePerl PPM. But try as I might, I am not able to spot it. It also happens that CPAN repository is not supported. Any ideas on how to install it will be great. I tried downloading it and running Makefile.pl but it got stuck when I executed t

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
Uri Guttman wrote: only for ++/-- and +=/-= will that work with no warnings. if he uses an undef value in another arithmetic expression it will warn. Also, undef values work in if/unless and while/until conditions. Usually when you see indexes used with arrays, it is because the programmer do

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> Soham Das wrote: >> a.. How do I initialise an array of a definite size with zero. Say the C equivalent of such a statement will be: >> int a[125]; >> for(i=0;i<125;i++)a[i]=0; SHC> Not needed. Perl assume zero if a non-ex

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Uri Guttman
> "JK" == Jenda Krynicky writes: >> > >> > a.. How do I initialise an array of a definite size with >> > zero. Say the C equivalent of such a statement will be: >> my @array; >> $array[$_] = 0 for 0..125; JK> my @array = (0) x 126; and a question for the OP is why do you need t

Re: variables and sql-statements within perlscripts

2009-09-28 Thread Lawrence Statton
On Sep 28, 2009, at 11:01 AM, Ruprecht Helms wrote: Hi, How have I to write the sql-statement if I want to use variables like this: Don't.http://xkcd.com/327/ The value of the variable can have the value of another recordsetloop or a value come from outsite the script. Regards,

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Thanks Shawn, yes hashes I guess will be the way to go forward. Soham - Original Message From: Shawn H Corey To: Soham Das Cc: beginners@perl.org Sent: Monday, 28 September, 2009 9:50:18 PM Subject: Re: Arrays, Dates, Indexing and Initialisation Soham Das wrote: > a.. How do I initi

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Wow! sweet! Hi Jenda, thanks for the help. And I guess, for the dates problem I have to use hashes, eh? Soham - Original Message From: Jenda Krynicky To: beginners@perl.org Sent: Monday, 28 September, 2009 9:50:40 PM Subject: Re: Arrays, Dates, Indexing and Initialisation Date sen

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
Soham Das wrote: a.. How do I initialise an array of a definite size with zero. Say the C equivalent of such a statement will be: int a[125]; for(i=0;i<125;i++) a[i]=0; Not needed. Perl assume zero if a non-existing element is u

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Jenda Krynicky
Date sent: Mon, 28 Sep 2009 09:11:02 -0700 Subject:Re: Arrays, Dates, Indexing and Initialisation From: r...@i.frys.com To: "Soham Das" Copies to: beginners@perl.org > Soham Das wrote: > > Hello All, > > > > I wanted

variables and sql-statements within perlscripts

2009-09-28 Thread Ruprecht Helms
Hi, How have I to write the sql-statement if I want to use variables like this: The value of the variable can have the value of another recordsetloop or a value come from outsite the script. Regards, Ruprecht Helms -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional comm

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread rkb
Soham Das wrote: > Hello All, > > I wanted some guidance with these questions of mine: > > a.. How do I initialise an array of a definite size with > zero. Say the C equivalent of such a statement will be: > >int a[125]; >for(i=0;i<125;i++) >

Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Hello All, I wanted some guidance with these questions of mine: a.. How do I initialise an array of a definite size with zero. Say the C equivalent of such a statement will be: int a[125]; for(i=0;i<125;i++) a[i]=0; b. Is it possi

Re: Argument "List::Util" isn't numeric

2009-09-28 Thread Chas. Owens
2009/9/28 Stanisław Findeisen : snip > use List::Util qw(sum); snip > my @lk  = (12, 3, 8); > my $lks = List::Util->sum(@lk); snip > What's wrong? snip The arrow operator passes the thing on the left to the function on the right, so CLASSNAME->method(); is the same as CLASSNAME::method("CLASSNA

Re: Argument "List::Util" isn't numeric

2009-09-28 Thread Shawn H Corey
Stanisław Findeisen wrote: This short program: #!/usr/bin/perl use warnings; use strict; use List::Util qw(sum); # The above statement imports the sum() sub my %h = (1 => 5, 2 => 7, 5 => 18); my $sk = List::Util->sum(keys %h); my $sv = List::Util->sum(values %h); # The two above stat

Re: Argument "List::Util" isn't numeric

2009-09-28 Thread Steve Bertrand
Stanis?aw Findeisen wrote: > This short program: > > #!/usr/bin/perl > > use warnings; > use strict; > > use List::Util qw(sum); > > my %h = (1 => 5, 2 => 7, 5 => 18); > my $sk = List::Util->sum(keys %h); > my $sv = List::Util->sum(values %h); > > print("Sum of keys: $sk\n"); > print("Sum

Re: Argument "List::Util" isn't numeric

2009-09-28 Thread Алексеев Александр
List::Util in your case is a module name, not an object. Use "::" istead of "->". my $sk = List::Util::sum(keys %h); -- With best regards Alexandr A Alexeev http://web20.su/ Stanisław Findeisen пишет: This short program: #!/usr/bin/perl use warnings; use strict; use List::Util qw(sum); m

Argument "List::Util" isn't numeric

2009-09-28 Thread Stanisław Findeisen
This short program: #!/usr/bin/perl use warnings; use strict; use List::Util qw(sum); my %h = (1 => 5, 2 => 7, 5 => 18); my $sk = List::Util->sum(keys %h); my $sv = List::Util->sum(values %h); print("Sum of keys: $sk\n"); print("Sum of values: $sv\n"); my @lk = (12, 3, 8); my $lks = Li

Re: [cpan Q] Failure to finish installing using cpan [File::ReadBackwards

2009-09-28 Thread Kevin Phair
Harry Putnam wrote: I wasn't able to figure out what is happening when cpan fails on File::ReadBackwards: I'm hoping someone will be able to see what the problem is. Installing /usr/local/lib/perl5/site_perl/5.8.8/File/ReadBackwards.pm Installing /usr/local/share/man/man3/File::ReadBackwards.3p