in reply to Modification of a read-only value

I doubt that the error points to that line ( but as Aristotle points out I am wrong :-( ) Perl's error messages are on occasion out by a line or two. I highly recommend checking the return value of your opens ie:

open(PIPE, "$CommandToExecute|") or die "Can't get pipe open to $Comma +ndToExecute: $!\n";

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Modification of a read-only value
by Aristotle (Chancellor) on Aug 21, 2004 at 15:43 UTC

    Sound advice, but unrelated to the problem. That omission would yield an intermittent readline() on closed filehandle, not the error the OP is seeing.

    Makeshifts last the longest.

      I read your reply below. It is an error I have never encountered myself but it does look like the issue:

      for ( qw( This is new to me ) ) { print "$_\n"; open(PIPE, "dir|") or die $!; while (<PIPE>) { # <--- This is the line that the error points to print $_; } } __DATA__ This Modification of a read-only value attempted at script line 4.

      Learn something every day. Thanks!

      cheers

      tachyon