Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Perl- Print Output of array

Status
Not open for further replies.

dshaw21369

Programmer
Jul 8, 2002
64
0
0
When I tried to print the output of the array I can't see it. Im compiling on the server and dont know where to look for the output from this file. Can someone please help.
Thanks!
Here is the code:

#!/usr/local/bin/perl


unless (open (XML_EXAMPLE,&quot;</export/home/egate/Perl_Development/XML_IN_PERL.txt&quot;))
{
print &quot;That file does not exist\n&quot;;
exit(1);
}

my (@array)=<XML_EXAMPLE>;
close(XML_EXAMPLE);

my $join_xml = join(&quot;\n&quot;,@array);

open (XML_EXAMPLE,&quot;</export/home/egate/Perl_Development/XML_IN_PERL.txt&quot;) || die;
print XML_EXAMPLE $join_xml,&quot;\n&quot;;
close(XML_EXAMPLE);
 
Hi,
First try to print the array to the standard output and check if you have got the contents right.try

open(XML_EXAMPLE,&quot;+>/export/home/egate/Perl_Development/XML_IN_PERL.txt&quot;);

VGG

 
Hi,

Standard Output goes to your monitor.

Cheers.
PC
 
I got it!
print XML_EXAMPLE $join_xml,&quot;\n&quot;;
my syntax was incorrect...

Thanks so much for your answers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top