in reply to Error message "Use of uninit"

You are using split() to split a line into three parts. The error message tells you that $freq has the undefined value, which is what happens if there are not enough parts to split the line into. The error message also tells you that this happens with line 1 (i.e. the first line) of the file you are reading. So presumably line 1 of the file has only one ' ' and therefore only two parts.

When something like this happens, it is useful to add a line "use Data::Dumper;" to the beginning of your script and a line like "print Dumper(\$line,\$header,\$tag,\$freq);" inside your loop. Start the script and look at the first line. This will help you in debugging even more complicated bugs

Replies are listed 'Best First'.
Re^2: Error message "Use of uninit"
by bluray (Sexton) on Nov 21, 2011 at 19:28 UTC
    Thanks. You are right. The header line had some aberrant format. The first two entries were separated by "," and the next by ' '; I changed the header and it is solved.