D
Dave
I was able to find a few references to similar dilemmas by searching
Google Groups, but none of them fully satisfied my question.
When processing one or more files that have been passed to one's Perl
program from the command line, how does one achieve an effect equivalent
to calling "binmode(FH, ":layer")"? Using "binmode(ARGV)" does not seem
to work for this purpose, because binmode() cannot be called before the
file is open.
As a practical matter, I can use the "C" option on the command line to
workaround this limitation in my present situation, but I would like to
know how to manipulate the layers on the files in @ARGV from within my
program. In addition, the "C" option only controls some of Perl's
Unicode behavior, so it will not always be a viable workaround,
depending on what I'm doing.
I realize that I can of course explicitly open the files myself, but I
can't help but to think that there must exist a more elegant solution
than that.
Dave
Google Groups, but none of them fully satisfied my question.
When processing one or more files that have been passed to one's Perl
program from the command line, how does one achieve an effect equivalent
to calling "binmode(FH, ":layer")"? Using "binmode(ARGV)" does not seem
to work for this purpose, because binmode() cannot be called before the
file is open.
As a practical matter, I can use the "C" option on the command line to
workaround this limitation in my present situation, but I would like to
know how to manipulate the layers on the files in @ARGV from within my
program. In addition, the "C" option only controls some of Perl's
Unicode behavior, so it will not always be a viable workaround,
depending on what I'm doing.
I realize that I can of course explicitly open the files myself, but I
can't help but to think that there must exist a more elegant solution
than that.
Dave