Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PerlIO binary open check
#!/bin/bash
perl -MPerlIO -e 'open($fh, ">", "/dev/null"); print "default = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -MPerlIO -e 'open($fh, ">:raw", "/dev/null"); print ":raw = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -MPerlIO -e 'open($fh, ">", "/dev/null"); binmode $fh; print "binmode = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment