1#!/usr/bin/perl -w 2 3use strict; 4use warnings; 5 6use Test::More 'no_plan'; 7 8{ 9 package Stuff; 10 11 use Test::More; 12 use Method::Signatures; 13 14 method echo($arg is ro) { 15 return $arg; 16 } 17 18#line 19 19 method naughty($arg is ro) { 20 $arg++ 21 } 22 23 is( Stuff->echo(42), 42 ); 24 ok !eval { Stuff->naughty(23) }; 25 like $@, qr/^Modification of a read-only value attempted at \Q$0\E line 20/; 26} 27