Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: open via

by repellent (Priest)
on Oct 30, 2011 at 21:50 UTC ( [id://934781]=note: print w/replies, xml ) Need Help??


in reply to open via

Something like useopen IN => ':via(File::BOM)' will do.
use strict; use warnings; use Encode; use File::BOM qw(:all); use open IN => ':via(File::BOM)'; my $enc = "UCS-2"; my $str = "\x{ABCD} a b c d"; my $buf = $enc2bom{$enc} . encode($enc, $str); open(my $FH, "<", \$buf) or die $!; my $read = <$FH>; print($read eq $str ? "match" : "no match", "\n"); __END__ match

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://934781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found