On 1/19/07, Bertrand Baesjou <[EMAIL PROTECTED]> wrote:

While running my script it seems to use around a gigabyte of memory
(there is 1GB of RAM and 1GB of swap in the system), might this be the
problem?

If you're running low on memory, unless you're working on an
inherintly large problem, your algorithm is probably wasting some
memory.

foreach $line (<INFILE>) {
                $somestorage{$linecounter}=$value;
                $linecounter++;
}

Well, that builds a big hash for nothing. Unless you're trying to waste memory?

print $linecounter;

You should probably put a newline at the end of your output.

system("pwd") == 0 or die "system failed: $?";

5198365system failed: 0 at ./sample1.pl line 22.

You're trying to run the command "pwd", which seems to have failed.
The value of $? is zero though, which would normally indicate success.
Perhaps it's zero because the command couldn't be executed at all?
(Maybe low memory?) Does the "pwd" command normally work from
system()? (You're not comparing this "pwd" to the shell built-in, are
you?)

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to