#!c:/perl/bin/perl -w $|++; use strict; use Inline::Files; open my $fh, '>', 'foo.txt' or die "open failed: $!"; print $fh do { local $/; (, ) }; close $fh; __FOO__ foo here __BAR__ bar here #### #!c:/perl/bin/perl -w $|++; use strict; CHECK { no strict 'refs'; my %fh = ( do { local $/; } =~ m#^__(.+?)__\n(.*?)\n?(?=\n?__|\z)#msg ); open *{$_}, '<', \$fh{$_} or die "inline open failed: $!" for keys %fh; } use vars qw(*FOO *BAR); open my $fh, '>', 'foo.txt' or die "open failed: $!"; print $fh do { local $/; (, ) }; close $fh; __DATA__ __FOO__ foo here __BAR__ bar here