Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^7: passing data structures from java to perl

by exussum0 (Vicar)
on Jul 29, 2010 at 00:02 UTC ( #851827=note: print w/replies, xml ) Need Help??

in reply to Re^6: passing data structures from java to perl
in thread passing data structures from java to perl

One instance of using the Java API incorrectly is probably fine. Sure, there's lots of clever things you can do such as insert the same 2 items into a HashSet and get the same result every single time if you iterate over them and expect an order. (You're achieving the same state)

You can serialize a singleton, and deserialize it to get 2 copies.

I can also do 86400 seconds in a day, which is innacurate twice a year, but most of the time it's fine.

Sure, in perl I can do... new Foo instead of Foo->new.

Yeah, in the end it all may work out. In the IO case, java is validating the output as it's writing it and if someone does do Unicode->Latin1 because of that exact pattern, even if it works for this instance, you're teaching people a bad habit that can yield errors if they rubber stamp it all over the place.

You seem convinced to do this anyhow in your code. That's fine. Don't be surprised if other java devs don't look at it and go.. yeah, that looks wrong.

  • Comment on Re^7: passing data structures from java to perl

Replies are listed 'Best First'.
Re^8: passing data structures from java to perl
by almut (Canon) on Jul 29, 2010 at 00:14 UTC

    And what has all this got to do with creating UTF-8 output?  I was explicitly talking about UTF-8, not Latin-1.

    If you think there's something wrong with what I suggested, please provide a compilable, self-contained sample that demonstrates an UnmappableCharacterException when encoding a unicode string to UTF-8.  Otherwise this is plain FUD.

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2020-09-27 16:07 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (142 votes). Check out past polls.