[system] / trunk / webwork / system / lib / PGtranslator.pm Repository:
ViewVC logotype

Diff of /trunk/webwork/system/lib/PGtranslator.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 99 Revision 100
1495sub PG_restricted_eval { 1495sub PG_restricted_eval {
1496 local($string) = shift; # local seems to be essential to make sure that the right version of $string is evaluated 1496 local($string) = shift; # local seems to be essential to make sure that the right version of $string is evaluated
1497 # Using my, things would work unless the contents of $string contained '$string' 1497 # Using my, things would work unless the contents of $string contained '$string'
1498 # Wheeeeeeeeeeee!!!!!! 1498 # Wheeeeeeeeeeee!!!!!!
1499 my ($pck,$file,$line) = caller; 1499 my ($pck,$file,$line) = caller;
1500 my $save_SIG_warn_trap = $SIG{__WARN__}; 1500 my $save_SIG_warn_trap = $SIG{__WARN__}; # this change doesn't seem to make any difference in how problem warnings are propagated.
1501 $SIG{__WARN__} = sub { CORE::die @_}; 1501 $SIG{__WARN__} = sub { CORE::die @_};
1502 my $save_SIG_die_trap = $SIG{__DIE__}; 1502 my $save_SIG_die_trap = $SIG{__DIE__};
1503 $SIG{__DIE__}= sub {CORE::die @_}; 1503 $SIG{__DIE__}= sub {CORE::die @_};
1504 no strict; 1504 no strict;
1505 my $out = eval ("package main; " . $string ); 1505 my $out = eval ("package main; " . $string );
1508 . $errors . 1508 . $errors .
1509 "The calling package is $pck\n" if defined($errors) && $errors =~/\S/; 1509 "The calling package is $pck\n" if defined($errors) && $errors =~/\S/;
1510 use strict; 1510 use strict;
1511 $SIG{__DIE__} = $save_SIG_die_trap; 1511 $SIG{__DIE__} = $save_SIG_die_trap;
1512 $SIG{__WARN__} = $save_SIG_warn_trap; 1512 $SIG{__WARN__} = $save_SIG_warn_trap;
1513
1513 return (wantarray) ? ($out, $errors,$full_error_report) : $out; 1514 return (wantarray) ? ($out, $errors,$full_error_report) : $out;
1514} 1515}
1515 1516
1516=head2 PG_answer_eval 1517=head2 PG_answer_eval
1517 1518
1547 my $save_SIG_warn_trap = $SIG{__WARN__}; 1548 my $save_SIG_warn_trap = $SIG{__WARN__};
1548 $SIG{__WARN__} = sub { CORE::die @_}; 1549 $SIG{__WARN__} = sub { CORE::die @_};
1549 my $save_SIG_die_trap = $SIG{__DIE__}; 1550 my $save_SIG_die_trap = $SIG{__DIE__};
1550 $SIG{__DIE__}= sub {CORE::die @_}; 1551 $SIG{__DIE__}= sub {CORE::die @_};
1551 my $save_SIG_FPE_trap= $SIG{'FPE'}; 1552 my $save_SIG_FPE_trap= $SIG{'FPE'};
1552 $SIG{'FPE'} = \&main::PG_floating_point_exception_handler; 1553 $SIG{'FPE'} = \&Global::PG_floating_point_exception_handler;
1553 $SIG{'FPE'} = sub {exit(0)}; 1554 #$SIG{'FPE'} = sub {exit(0)}; ## is this ok to comment this out?
1554 no strict; 1555 no strict;
1555 my $out = eval('package main;'.$string); 1556 my $out = eval('package main;'.$string);
1556 $out = '' unless defined($out); 1557 $out = '' unless defined($out);
1557 $errors .=$@; 1558 $errors .=$@;
1558 1559

Legend:
Removed from v.99  
changed lines
  Added in v.100

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9