- {
- local $DiePattern = '^Modification of a read-only value attempted';
- local $Message = 'Elements of @- and @+ are read-only';
- must_die '$+[0] = 13';
- must_die '$-[0] = 13';
- must_die '@+ = (7, 6, 5)';
- must_die '@- = qw (foo bar)';
+ foreach ('$+[0] = 13', '$-[0] = 13', '@+ = (7, 6, 5)', '@- = qw (foo bar)') {
+ must_die($_, qr/^Modification of a read-only value attempted/,
+ 'Elements of @- and @+ are read-only');