Could someone explain to me what causes this behaviour ?
#!/usr/bin/perl -w use strict; my @subs = ("_iata_city"); foreach my $sub(@subs) { $sub =~ s/^_//g; print $sub;; } foreach my $sub(qw/_iata_city/) { $sub =~ s/^_//g; print $sub;; }
1) First loop = iata_city
2) Second loop = Modification of a read-only value attempted
I am assuming it has something to do with the _ in the qw// but am not sure why ?
In reply to Modification of a read-only value attempted by ropey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |