Hi guys and thanks,

I've tried your suggestions and still have the problem. Am now using use strict; use warnings; $!=1;

The return codes with $? >> 8, $? & 127 and $? & 128 are always 0.
I get error messages running date via backticks and open(), which seems to indicate that there is no result from the command. (See below).

BUT - if I reduce the array size then all runs OK!
Reducing the array to about 5881 x 2562 then my demo script runs OK.
2562 is not 100% repeatable - seems to depend on what other programs are running.
Also - it isn't symmetrical. This means that 5881 x 2562 may work, but then 2562 x 5881 doesn't.

Further suggestions welcomed.

Cheers, Peter

Bad results snippet:

#Finished setup of two arrays 5761 x 2801 #After - using system("date");: #exited with value ($? >> 8) = 0 # #signal number ($? & 127) = 0 # #dumped core ($? & 128) = 0 Use of uninitialized value $cmd in print at ./xpt3.pl line 67. #After - using backticks: readline() on closed filehandle CMD at ./xpt +3.pl line 71. Use of uninitialized value $result in concatenation (.) or string at . +/xpt3.pl line 72. #After - using open: #End
Good results snippet:
#Finished setup of two arrays 5761 x 2001 #After - using system("date");: Wed Feb 17 13:13:24 GMT 2010 #exited with value ($? >> 8) = 0 # Wed Feb 17 13:13:24 GMT 2010 #signal number ($? & 127) = 0 # Wed Feb 17 13:13:24 GMT 2010 #dumped core ($? & 128) = 0 #After - using backticks: Wed Feb 17 13:13:24 GMT 2010 #After - using open: Wed Feb 17 13:13:24 GMT 2010 #End

Code snippet:

print "#Finished setup of two arrays $i x $j\n"; #Using system() print '#After - using system("date");: '; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #exited with value (\$? >> 8) = ",($? >> 8),"\n"; } print "# "; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #signal number (\$? & 127) = ",($? & 127),"\n"; } print "# "; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #dumped core (\$? & 128) = ",($? & 128),"\n"; } #Using backticks $cmd = `date 2>&1`; print "#After - using backticks: ",$cmd; #Using open() open(CMD, "date 2>&1 |"); $result = <CMD>; print "#After - using open: $result\n"; close(CMD); print "\n#End\n"; exit;

In reply to Re^3: system command - OK on 32 bit, fails on 64 bit Linux - why? by geep999
in thread system command - OK on 32 bit, fails on 64 bit Linux - why? by geep999

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.