bluray has asked for the wisdom of the Perl Monks concerning the following question:
I am getting the message "use of uninitialized value $freq in concatenation (.) or string at ... line 15, <$FILE1> line 1". Though, the output is correct, I am having hard time in resolving this error message. I am trying to replace ">" in the first column by "@". My code is below. Any thoughts?
#!usr/bin/perl use strict; use warnings; my $input_file="filetag1.csv"; open my $FILE1, "<", $input_file or die "Cannot open $input_file .$!"; my $output_file="file1tagmod.csv"; open my $FILE2, ">", $output_file or die "Cannot open $output_file .$! +"; while (my $line=<$FILE1>){ chomp $line; my($header,$tag,$freq)=split(' ', $line); $header=~ tr/>/@/d; print $FILE2 "$header\t$tag\t$freq\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error message "Use of uninit"
by jethro (Monsignor) on Nov 21, 2011 at 18:39 UTC | |
by bluray (Sexton) on Nov 21, 2011 at 19:28 UTC | |
|
Re: Error message "Use of uninit"
by jdrago999 (Pilgrim) on Nov 21, 2011 at 18:44 UTC | |
|
Re: Error message "Use of uninit"
by Not_a_Number (Prior) on Nov 21, 2011 at 19:33 UTC | |
by bluray (Sexton) on Nov 21, 2011 at 22:08 UTC |