in reply to File Handling problem
"when i do perl1.pl filename.txt i get the error ...."
What exactly are you "do"ing... and what it your current working directory when you do it?
Assuming from what you've provided that you're using some version of Windows, we still don't know for sure where and how you're executing the script:
In that last case, $ARGV[0] will almost certainly be undef and might, therefore, account for something somewhat similar to the error message you've cited.
The error you quote in your narrative appears to be inexact (or the script you posted is incomplete). There is no line 10 in the script you posted and unless you saved your script and the router file to the desktop (BAAAAD idea), the error message bears no obvious relationship to the rest of the information you've provided.
IOW, we'll be better able to offer reasonable help if you tell us what's really in the code and what's really happening.
As to what you did to solve " the problem by using"
open (FH_SECOND,"<",\$second_file) or die $!;
Update: Fixed my errors in the pseudo-CLI list.
|
|---|