in reply to Simulate file
You can also open a file handle directly against a reference to a HEREDOC as well as a scalar reference.
knoppix@Microknoppix:~$ perl -Mstrict -wE ' > open my $inFH, q{<}, \ <<EOD or die qq{open: <<HEREDOC: $!\n}; > some letters > this line also 99 has digits > this does not > EOD > > while ( <$inFH> ) > { > print if m{\d}; > } > > close $inFH or die qq{close: <<HEREDOC: $!\n};' this line also 99 has digits knoppix@Microknoppix:~$
I hope this is helpful.
Cheers,
JohnGG
|
|---|