in reply to comparing columns and printing a result
Not only haven't you declared $fh yet, you haven't opened the file at this point. That's something you do later. But when you open the files, you're not checking whether this succeeds.my $row = <$fh>;
What's the point of this? @col1 doesn't contain anything, so what you want to split? You're also declaring @col, but not using it.my (@col1,@col2); my @words = split(//,@col1);
No idea what you want to do, but on the LHS of a =~ you have to have a scalar, not a list or array. Furthermore, since you never put anything in @words, there will be nothing to match here. And even then, $_ is the line you're reading from the file; it probably doesn't contain a number.@col2 =~ m/$words[$_](\d+)/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparing columns and printing a result
by slartsa (Initiate) on Jan 26, 2009 at 13:03 UTC |