On 6/14/06, Mazhar <[EMAIL PROTECTED]> wrote:
Hello, I am writing perl on windows installing Activestate Perl and the code is reading a text file and processing it, the code what i use is... ################################## use strict; use warnings; my $file_name="XXXXXXXX.txt"; open(FILE,"$file_name") || die "Not been Accessed"; while (<FILE>) { print $_ "\n"; } ################################################ I get a wired output when i run the above code.. *Useless use of a constant in void context at gathercheck.pl line 9. Can't use string ("2006/06/11 00:00:02 (7):(4480) t") as a symbol ref while "str ict refs" in use at gathercheck.pl line 11, <FILE> line 1.* Some lines in the imput file is like the below, 2006/06/11 00:00:02 (7):(4480) tc1a-pgw-1m, Waiting for another gather on REPORTER_GATHER_MUTEX_FOR_TC1A_PGW_1M 2006/06/11 00:00:02 (7):(5852) tc1a-pgw-1m, Waiting for another gather on REPORTER_GATHER_MUTEX_FOR_TC1A_PGW_1M 2006/06/11 00:00:02 (7):(4492) tc1a-pgw-1m, Waiting for another gather on REPORTER_GATHER_MUTEX_FOR_TC1A_PGW_1M Please help me out on the above as i am not able to understand the error output.. Regards Mazhar
Hope this wil work (place a dot before \n(concatenation) in the print) #!/usr/bin/perl use strict; use warnings; my $file_name="XXXXXXX.txt"; open(FILE,"$file_name") || die "Not been Accessed"; while (<FILE>) { print $_."\n"; #place a dot before \n(concatenation) } -- Prabu M A