Hi all
In the following code I find an annoying space
which appears at the start of the 2nd and each
subsequent line both in the arrayfile.txt and the displayed
output of the array.
Does anyone know what is going on and how to
avoid this problem.
#!/bin/perl
$localtime= localtime;
#---------------------------------
$line0="$localtime|this is line 0\n";
$line1="$localtime|this is line number 1\n";
$line2="$localtime|this is line No 2\n";
@array=();
push (@array,$line0,$line1,$line2,);
print @array;
print $localtime;
#---------------------------------
$fname = "F:/webtest/test/cgi-bin/help3/arrayfile.txt";
open (ARRAYFILE, ">$fname");
print ARRAYFILE "@array\n";
close (ARRAYFILE);
In the following code I find an annoying space
which appears at the start of the 2nd and each
subsequent line both in the arrayfile.txt and the displayed
output of the array.
Does anyone know what is going on and how to
avoid this problem.
#!/bin/perl
$localtime= localtime;
#---------------------------------
$line0="$localtime|this is line 0\n";
$line1="$localtime|this is line number 1\n";
$line2="$localtime|this is line No 2\n";
@array=();
push (@array,$line0,$line1,$line2,);
print @array;
print $localtime;
#---------------------------------
$fname = "F:/webtest/test/cgi-bin/help3/arrayfile.txt";
open (ARRAYFILE, ">$fname");
print ARRAYFILE "@array\n";
close (ARRAYFILE);