A couple things to get this to work:
- you don't need to split the line on anything. But if you had you would need to change the /n to \n. Since you have not messed with $/, you will only be reading one line time from the file anyhow. If the purpose of this line (the one with split in it), was to put something in $line you would be better of just using: while (my $line = <IN>) { ... }
If on the other hand the purpose was to remove the newline at the end of the string, well chomp has already done that for you.
- You need to add a closing brace between the print line and the close line.
If nothing else though Perl should have told you about the missing closing curly bracket, and should have also warned that
split //n/ is invalid, the first time you attempted to run your program.
Anyhow, hope this helps. Though seriously, if you had problems with this you might want to head over to learn.perl.org, browse the online library there, or pick up a copy of the Learning Perl (aka The Llama), and also there are some fine Tutorials around here.
-enlil