1 #!/usr/bin/perl 2 $a ="one"; 3 $b = "two"; 4 $_ = '$a $b'; 5 print "_ = $_\n\n"; 6 s/(\$\w+)/$1/ge; 7 print "After 's/(\$\w+)/$1/ge' _ = $_\n\n"; 8 s/(\$\w+)/$1/gee; 9 print "After 's/(\$\w+)/$1/gee' _ = $_\n\n";El resultado de la ejecución es:
> enested.pl _ = $a $b After 's/($w+)/$b/ge' _ = $a $b After 's/($w+)/$b/gee' _ = one two
Casiano Rodríguez León