in reply to Problem Declaring a hash
You didn't show the whole (reduced) program, but my guess is that in line 25, your are missing a semicolon. When I have the following program:
#line 25 my $x = '123' = my %OCN_PFX_To_TDir=( 3085220111379778 => '3085220111379788_Rexx', 3085220334620644 => '3085220334620644_Spare', 3085220346432582 => '3085220346432582_Rexx2', 3085220352420034 => '3085220352420034_Algol' );
I get the error output
Can't modify constant item in scalar assignment at tmp.pl line 31, nea +r ");" Execution of tmp.pl aborted due to compilation errors.
So maybe your problem is some lines earlier.
If you can't spot it, copy the file and start removing lines until the error goes away. Then, if you still can't spot it, post the smallest version of your file that still reproduces the error. See also https://www.sscce.org/ - "smallest, self-contained example".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem Declaring a hash
by The_Evil_One (Initiate) on Nov 07, 2025 at 02:09 UTC | |
by soonix (Chancellor) on Nov 07, 2025 at 08:33 UTC |