perl -MO=Deparse try.pl > try2.pl
perl try2.pl
####
perl try.pl
####
#!perl
use strict;
use warnings;
use Data::Dumper;
s/foo/bar/ for (my $d = 'Shakespear is the food');
print "$d\n";
####
Shakespear is the bard
####
use Data::Dumper;
BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU"}
use strict 'refs';
foreach $_ (my $d = 'Shakespear is the food') {
s/foo/bar/;
}
print "$d\n";
####
Name "main::d" used only once: possible typo at try2.pl line 7.
Use of uninitialized value in concatenation (.) or string at try2.pl line 7.
####
(my $d = 'Shakespear is the food') =~ s/foo/bar/;
####
/foo/ and $_ .= '1' for (my $d = 'Shakespear is the foo');