foreach loop problem
From: BigDaDDY (ihatespam_at_hotmail.com)
Date: 01/29/04
- Next message: Jeff Thies: "Re: printing sub results in heredocs"
- Previous message: Carsten Aulbert: "Re: How can I read file from end to first ?"
- Next in thread: Walter Roberson: "Re: foreach loop problem"
- Reply: Walter Roberson: "Re: foreach loop problem"
- Reply: Xaonon: "Re: foreach loop problem"
- Reply: Matija Papec: "Re: foreach loop problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 23:12:06 -0800
I am getting the following error with perl 5.6.1.
Modification of a read-only value attempted
However, I am not getting this error with earlier versions of Perl. Is
there a way to do the code below without raising an error?
foreach my $param (qw(E_p1 E_p2 E_p3 E_p4)){
$param =~ s/E_//g;
if ($default{"E_$param"}){
$E{$param} = $default{"E_$param"});
}
}
- Next message: Jeff Thies: "Re: printing sub results in heredocs"
- Previous message: Carsten Aulbert: "Re: How can I read file from end to first ?"
- Next in thread: Walter Roberson: "Re: foreach loop problem"
- Reply: Walter Roberson: "Re: foreach loop problem"
- Reply: Xaonon: "Re: foreach loop problem"
- Reply: Matija Papec: "Re: foreach loop problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]