Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with a Perl script

  1. Nov 27, 2013 #1


    User Avatar

    Staff: Mentor

    Disclaimer: the only thing I know about Perl is the language name.

    Raspbian on Pi (512 MB RAM).

    I have a Perl script that I want to use. And it works - sort of.

    Problem is, it works OK for small data sets, but it fails for large ones. When it works, it works for some time and then it spits out the result. In case of known errors (like a wrong file name) it displays an error message (while I don't know Perl I see these are coded in the script). When it doesn't work - it initially works, then just ends, without any messages.

    My first odea was that it is limited by the memory. For a large set of data I see it (with top) using 98% of CPU and allocating more and more memory, but when it stops it is at 3% RAM, so just about 15 MB, not that much.

    Any ideas what I can do? Is there a way of checking why it crashes? Can it be related to some memory limit per process? Or is there some limit set to amount of memory available for Perl?

    I did some blind googling but all I see seems to be suggesting memory should not be a problem here.
  2. jcsd
  3. Nov 27, 2013 #2


    User Avatar

    Staff: Mentor

    OK, for now ignore my message.

    I did some more checks and it looks like the problem can't be memory related. Data sets are just list of words. Script works for a fairly short data set that I entered manually, but it never works for a more complicated ones, prepared by other script (we are talking 3 words vs 84 words). It means there must be some other problem.
  4. Nov 27, 2013 #3


    User Avatar

    Staff: Mentor

    Sigh. CRLF vs just LF.

    Case closed.
  5. Nov 27, 2013 #4


    User Avatar
    Science Advisor

    can you post the script and the dataset?

    Edit: Just saw that you solved your problem.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Problem with a Perl script
  1. Perl & Apache (Replies: 6)

  2. Perl problems (Replies: 4)