http://www.perlmonks.org?node_id=939306


in reply to Error message "Use of uninit"

Since, at least in your posted snippet, you don't use the variables $tag or $freq, perhaps the best way of avoiding the warning would be to change the line

my($header,$tag,$freq)=split(' ', $line);

to:

my ( $header, @rest ) = split ' ', $line;

Update (thanks AnomalousMonk): And of course you would have to change your output line to:

print $FILE2 "$header\t@rest\n";

Replies are listed 'Best First'.
Re^2: Error message "Use of uninit"
by bluray (Sexton) on Nov 21, 2011 at 22:08 UTC
    Hi,

    Thanks for the reply. Though it worked well in resolving the "uninitiated value", the output as I opened in spreadsheet have only 2 columns (2nd and 3rd column got crammed into the 2nd column separated by space).

    Anyway, I resolved the problem by changing the format of the heading line. Header,"Tag" "Frequency" was changed to "Header" "Tag" "Frequency"