|
|
Up |
|
|
  |
Author: Lars EighnerLars Eighner
Date: Apr 30, 2008 22:12
Will perl 6 be usable as a procedure language?
|
| |
|
| |
66 Comments |
|
  |
Author: Cosmic CruizerCosmic Cruizer
Date: Apr 30, 2008 19:15
I've been able to reduce my dataset by 75%%, but it still leaves me with a
file of 47 gigs. I'm trying to find the frequency of each line using:
open(TEMP, "< $tempfile") || die "cannot open file $tempfile:
$!";
foreach () {
$seen{$_}++;
}
close(TEMP) || die "cannot close file
$tempfile: $!";
My program keeps aborting after a few minutes because the computer runs out
of memory. I have four gigs of ram and the total paging files is 10 megs,
but Perl does not appear to be using it.
How can I find the frequency of each line using such a large dataset? I
tried to have two output files where I kept moving the databack and forth
each time I grabbed the next line from TEMP instead of using $seen{$_}++,
but I did not have much success.
|
| |
|
| |
19 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Apr 30, 2008 18:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.10: Is there an IDE or Windows Perl Editor?
Perl programs are just plain text, so any editor will do.
If you're on Unix, you already have an IDE--Unix itself. The UNIX
philosophy is the philosophy of several small tools that each do one
thing and do it well. It's like a carpenter's toolbox.
If you want an IDE, check the following (in alphabetical order, not
order of preference):
Eclipse
http://e-p-i-c.sf.net/
The Eclipse Perl Integration Project integrates Perl
editing/debugging with Eclipse.
Enginsite
http://www.enginsite.com/
|
| Show full article (7.71Kb) |
|
no comments
|
|
  |
Author: AndyAndy
Date: Apr 30, 2008 14:15
Hiya Guys
Well I am new, and still trying to learn perl...while at work on 10
different things....sheesh is there ever enough time to learn
something..
Needless to say
I need to accomplish the following.
Data Below
|
| Show full article (0.86Kb) |
|
2 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Apr 30, 2008 12:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.15: How can I make my Perl program run faster?
The best way to do this is to come up with a better algorithm. This can
often make a dramatic difference. Jon Bentley's book *Programming
Pearls* (that's not a misspelling!) has some good tips on optimization,
too. Advice on benchmarking boils down to: benchmark and profile to make
sure you're optimizing the right part, look for better algorithms
instead of microtuning your code, and when all else fails consider just
buying faster hardware. You will probably want to read the answer to the
earlier question "How do I profile my Perl programs?" if you haven't
done so already.
|
| Show full article (2.68Kb) |
|
no comments
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Apr 30, 2008 06:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.6: How do I profile my Perl programs?
You should get the Devel::DProf module from the standard distribution
(or separately on CPAN) and also use Benchmark.pm from the standard
distribution. The Benchmark module lets you time specific portions of
your code, while Devel::DProf gives detailed breakdowns of where your
code spends its time.
Here's a sample use of Benchmark:
use Benchmark;
@junk = `cat /etc/motd`;
$count = 10_000;
|
| Show full article (2.28Kb) |
|
no comments
|
|
  |
Author: whumannwhumann
Date: Apr 30, 2008 05:51
I'm trying to do some profiling on DBM::Deep. I started with
Devel::DProf and Devel::Profile but for some subs I had no idea *why*
they took long, so I tried Devel::SmallProf for additional detail.
Much of what I see makes sense but results like this puzzle me (these
are the subs that do the low-level disc read and write):
count wall tm cpu time line
0 0.00000 0.00000 103:sub print_at {
314000 0.96161 3.67000 104: my $self = shift;
314000 0.88398 3.34000 105: my $loc = shift;
...
|
| Show full article (2.50Kb) |
|
9 Comments |
|
  |
Author: ElaEla
Date: Apr 30, 2008 01:05
After testing different parameters, I'm still unable to obtain 2 transparent
circles. Could anybody tell me what's wrong in the following codes?
#!/usr/bin/perl
use GD;
$im = new GD::Image(550,450);
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocateAlpha(255,0,0,119);
$blue = $im->colorAllocateAlpha(0,0,255,119);
$im->transparent($white);
$im->alphaBlending(1);
$im->setStyle($black);
$im->filledArc(460,380,95,75,0,360,$red);
$im->filledArc(500,380,95,75,0,360,$blue);
open(IMG, ">test.png");
binmode IMG;
print IMG $im->png;
close IMG;
|
| |
|
3 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Apr 30, 2008 00:03
This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
3.9: Is there a ctags for Perl?
(contributed by brian d foy)
Ctags uses an index to quickly find things in source code, and many
popular editors support ctags for several different languages, including
Perl.
Exuberent ctags supports Perl: http://ctags.sourceforge.net/
You might also try pltags: http://www.mscha.com/pltags.zip
--------------------------------------------------------------------
|
| Show full article (1.33Kb) |
|
no comments
|
|
  |
|
|
  |
|
|
|
|
|
|
|