in reply to How do I treat a string like a filehandle?
To clarify, the format NSANS was defined, but when used, the scalar $ns_holder is opened to write to. Once the write is done, the scalar $ns_holder contains the NSANS-formatted structure.require 5.8.0; ## in order to write NSANS format to a scalar use strict; foreach $ns_answer (@ns_answer) { open(NSANS,">", \$ns_holder) or die("bla..\n"); write NSANS; print OFILE $ns_holder; close(NSANS); } format OFILE= ## for the disk file report @<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<<<< $adr, $ptr_answer . format NSANS= ## written to handle, then to scalar, then printed t +o OFILE @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<<<< $ns_answer .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How do I treat a string like a filehandle?
by zentara (Cardinal) on Mar 09, 2004 at 15:59 UTC |