From 773018d61cb50853288a77be2bcbb28e94623938 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 23 Jan 2006 23:47:10 +0000 Subject: [PATCH] catch read-onlye errors properly git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8533 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/perl5/variables/runme.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Examples/perl5/variables/runme.pl b/Examples/perl5/variables/runme.pl index c0420a828..76e3dc8bc 100644 --- a/Examples/perl5/variables/runme.pl +++ b/Examples/perl5/variables/runme.pl @@ -57,8 +57,17 @@ print "You should see the value", example::Point_print($example::ptptr), "\n"; print "\nNow I'm going to try and modify some read only variables\n"; -print " Tring to set 'path'\n"; -$example::path = "Whoa!"; print " Trying to set 'status'\n"; -$example::status = 0; +eval { $example::status = 0; }; +if (!$@) { + die("status"); +} +print " get error for 'status'\n"; + +print " Tring to set 'path'\n"; +eval { $example::path = "Whoa!";}; +if (!$@) { + die("path"); +} +print " get error for 'path'\n";