in reply to Re^2: split a file to several smaller file
in thread split a file to several smaller file

Thanks for the explaination of file handler.. it make sense.. i did specified a fh_in. but i'm still not sure what does fh_out do? we have $base and $ext to work out the file name of the output so what does fh_out do?
  • Comment on Re^3: split a file to several smaller file

Replies are listed 'Best First'.
Re^4: split a file to several smaller file
by graff (Chancellor) on Dec 31, 2007 at 02:36 UTC
    Just as '$fh_in' is the file handle for input, '$fh_out' is the file handle for output. The print function checks its first argument (the first thing that comes after the word "print"), and if this arg turns out to be a file handle, then the rest of the args are printed to that file; if the first arg after "print" is not a file handle, then print assumes 'STDOUT' (the default output file handle) and prints all its args to that "file" (which is usually your terminal window).