On Jun 7, 10:53 am, [EMAIL PROTECTED] (Rodrick Brown) wrote:
> Is there a simple method to read data from scalar like a file handle?
Yes. Simpler than you might imagine. Just pass a reference to your
scalar to open(), rather than the name of a file.
#!/usr/bin/perl
use strict;
use warnings;
my $data = "lots of random\ntext including\newlines\n";
open my $fh, '<', \$data
or die "Cannot open data stream: $!";
print while <$fh>;
__END__
Paul Lalli
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/