On 4/18/18 at 5:25 PM, [email protected] (Andy Kohler) wrote:
Do I have to write the XML to a file, then read it in again to convert it?
Or am I just missing something obvious?
Perl lets you open a reference to a scalar variable as a file.
#!/usr/bin/perl
use strict;
use warnings;
my $string = "line 1\nline 2\nline 3\n";
open my $fh, "<", \$string;
while (<$fh>) {
print "Printing $_";
}
close $fh;
# Printing line 1
# Printing line 2
# Printing line 3
$fh is a filehandle like any other. Can you use that?
HTH
--
- Bruce
_bruce__van_allen__santa_cruz__ca_