Aha! Got something, finally.
I tried using the
unless (system(...) == 0) {die...} construct suggested by
sauoq above, and finally got an error message, albeit one that doesn't make much sense to me(at least initially). If I use $!, I get a message that says "not enough space"... which suggests that "sort" doesn't have enough room to create its temporary files. But I monitored /var/tmp (which is where it normally happens on this server) as I was running the script, and it never got above 33%.
So maybe something or someone changed "sort" so that it doesn't use /var/tmp anymore? That is, of course, a question for the Unix admins. I just tried the script with "sort -T" to direct the temporary files to a place where I know there is room, and it still failed with the same message. And then I tried a separate script that does nothing but the system call with the "sort -T", and it worked. Hmmmmm.... so the error message points to a space problem, but the behavior of the script points to a memory problem. I'm still confused, but it's a starting point, at least.
Thanks to all for the help, especially sauoq for the method of catching errors from a system("...") call. This has been kicking me in the head for two days now. I'm pretty sure the problem lies in the server environment, and now at least I've got something more substantial to take to the Unix admins.
Thanks....
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.