Re: binmode and <>

jl_post@xxxxxxxxxxx schreef:

Running the following perl one-liner:

perl -ne "BEGIN{binmode(ARGV)} print length" blah.txt

prints "1", meaning that it didn't properly read the two bytes as two
separate characters, since the binmode(ARGV) didn't "take."

With "warnings" activated:

$ perl -wne "BEGIN{binmode ARGV} 1" < /dev/null
binmode() on unopened filehandle ARGV at -e line 1.

Affijn, Ruud

"Gewoon is een tijger."

Relevant Pages

  • Re: Encrypt a file, was Re: Encrpt a file
    ... On Mon, 18 Apr 2005, Anish Kumar K wrote: ... Check out the perl stuff on this site. ... though I've been meaning to look at it. ... solely for the use of the addressee. ...
  • Re: Checkbox - database checkbox, if checked gives value of 1 .. how to sum ?
    ... (reference "Use an effective followup style" section) ... And if you don't have a _specific_ question about programming in Perl ... (meaning, something _you_ wrote, not some application you downloaded ...
  • Re: Oh Flippineck
    ... Did you have a good OF party? ... something I have been meaning to ask you. ... What does "schreef ... in bericht" mean? ...
  • Re: Best way to handle using a report template for non-programmers..
    ... > I would rather it be more readable to someone who does not know perl. ... > formatting would not handle starting a variable at a certain position ... Not sure if this would help you, but you could try using 'pack' to ... meaning, you have to adjust for spaces between columns of information. ...
  • Re: Which language to use....
    ... affects the meaning of the code is something I haven't gotten use to. ... Otherwise, even new python programmers usually see the indentation as a big plus of the language, for several reasons (readability, vertical space savings, etc). ... Coming from perl, I've seen that regular expressions are much less used in python. ...