in reply to Write to and read from scalar
use strict; use warnings; my $str; open my $fOut, '>', \$str; print $fOut "Hello World\n"; close $fOut; open my $fIn, '<', \$str; my $inStr = <$fIn>; close $fIn; print $inStr;
Prints:
Hello World
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Write to and read from scalar
by wwe (Friar) on Mar 23, 2012 at 08:49 UTC | |
by tobyink (Canon) on Mar 23, 2012 at 09:49 UTC | |
|
Re^2: Write to and read from scalar
by flexvault (Monsignor) on Mar 23, 2012 at 13:02 UTC | |
by GrandFather (Saint) on Mar 23, 2012 at 22:56 UTC |