From: ts Date: 2004-04-21T19:28:49+09:00 Subject: [OT] Re: binding - how to get current script? >>>>> "n" == nobu nokada writes: n> A local variable created in eval is only visible in eval. n> eval("name = 'Alice'") n> puts eval("name") Well, perhaps ruby can be changed to make it work like a P language svg% cat a.pl #!/usr/bin/perl -w use strict; { my $m; sub aa { eval '$m += 2' } sub bb { eval 'print "bb : $m\n"' } sub cc { $m += 3 } sub dd { print "dd : $m\n" } } for (0 .. 3) { aa(); bb(); cc(); dd(); } svg% svg% ./perl -v a.pl This is perl, v5.8.3 built for i686-linux Copyright 1987-2003, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. svg% svg% ./perl a.pl bb : 2 dd : 3 bb : 4 dd : 6 bb : 6 dd : 9 bb : 8 dd : 12 svg% nice, no :-))) Guy Decoux