claes's Journal claes's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:13:51+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 claes's Journal NPW 2008 - Website online and registration is open <p>The ACT website for Nordic Perl Workshop 2008 is now online at and registration is open. You need an ACT account to register but if you've been to any YAPC or local workshop the past few years chances are good that you already have one. If not, signing up for one is easy peasy.</p><p>Oh, and don't forget to submit talk proposals if you want to give a presentation!</p><p>Hope to see you in Stockholm,<br>Claes Jakobsson and the NPW2008 organizer team</p> claes 2008-04-15T15:01:46+00:00 journal Nordic Perl Workshop 2008 - Call for Papers &amp; Participation Stockholm Perl Mongers and its fellow Nordic Perl Mongers arranges the annual Nordic Perl Workshop in Stockholm, Sweden on the 24th and 25th of May (over a weekend). This is the second time the workshop is arranged in Stockholm and the 6th time in total. The venue for this years workshop is located right next to Vasaparken near Odenplan, in the heart of Stockholm. During summertime this is a green oasis where one can chill in the grass, watch people or take a break in some of the park's coffee-shops. Odenplan also offers a wide range of restaurants and pubs in it's vicinity.<br><br>Nordic Perl Workshop is a workshop for the community by the community and we want you to submit interesting and inspiring presentations in order to make the workshop successful. Talk lengths are the usual 20 and 40 minutes but we might consider longer ones if motivated. Any subject is welcome as long as it's related to Perl somehow - from algorithms for social graphing and web-technologies to Perl5 core optimizations and language implementation targeting the Parrot VM. To submit a talk either do it online on the workshop website[1] or to If submitting via email please prefix the subject with [NPW]. Please submit talks no later than Friday 2nd of May. Accepted speakers will be notified Monday 5th of May.<br><br>Apart from speakers the workshop also requires eager participants. Workshop fee is 500 SEK (~ 55 EUR) and there's a reduced fee at 250 SEK (~ 28 EUR) for students. This includes admission to the workshop and coffee. Registration is done via the website[1] which uses ACT so if you have attended a previous workshop registration is dead simple.<br><br>[1] Website is not online yet but we're working on it really hard. The URL is as always<br><br>Important dates to remember:<br><br> &nbsp; &nbsp; &nbsp; &nbsp; May 2nd - Deadline for talk submission<br> &nbsp; &nbsp; &nbsp; &nbsp; May 5th - Speakers will be notified<br> &nbsp; &nbsp; &nbsp; &nbsp; May 16th - Registration closes<br> &nbsp; &nbsp; &nbsp; &nbsp; May 23th - Pre-work gathering for early arrivals<br> &nbsp; &nbsp; &nbsp; &nbsp; May 24-25th - Nordic Perl Workshop 2008<br><br>Hope to see you in Stockholm.<br><br>Claes Jakobsson on behalf of the Nordic Perl Workshop 2008 organization team. claes 2008-03-29T09:02:35+00:00 events Life updates and the return to <p>So it's quite a while since I last wrote in my journal here. I moved temporarily to LJ but the Perl community really is where my heart is so I'll return here from now on.</p><p>Now? what's happened since my last entry on 29th sept. 2006?</p><p>1) Winter 2005 just after NPW2005 I got burnt out and that has had quite a few implications to my life. In late october 2006 I was diagnosed with anxiety disorder and social fobia. But thanks to drugs and therapy I feel a lot better now and I'm starting to rebuild my social life.</p><p>2) I quit my job at the Swedish Premium Pension Authority to start my own business in order to develop a software that's been on my mind for quite some time. More about that further down.</p><p>3) Altho I officialy started the company in early 2007 I didn't feel up to nor was a able to do any work until late 2007 when I started to feel better. Really a bummer since I had to live off my savings but taking almost a year off was not so bad after all. It sure has gotten me more eager to invest time and energy into building something like a business and continue to be active in the Perl community.</p><p>So what does the future hold?</p><p> <b>Business - client projects</b> <br> Try to find more customers and especially those who want to open source what I do for them. One of my customers, <a href="">Linserv AB</a>, suggested themselves to release it on CPAN (<a href="">M3::ServerView</a>). Companies like that rock. </p><p> <b>Business - own projects</b> <br> The reason I decided to start my own was so I could transform my thoughts about software comprehension and visualisation into a product. Several years ago I wrote CPANXR, a cross-referencing tool which worked not quite so well. This new system which I call OpenGrasp will eventually be released as open source. Currently my focus lies on the core database which stores the software model which basically is a typed directed graph. This graph has to be searchable, traversable and transformable. I'll be posting more about OpenGrasp as it develops.</p><p> <b>Nordic Perl Workshop 2008</b> <br> I went to NPW2007 in Copenhagen and it was excellent. Now as you may know YAPC::EU will be hosted by Copenhagen Perl Mongers this year so they weren't capable of organizing NPW. So I took it upon me and planning is starting really soon. We're aiming for late may, probably a friday + saturday. My hope is that I'll be able to arrange a free introduction course to Perl at the university here in stockholm a few days before NPW so we can get some fresh blood interested in the community. We'll also hopefully be able to get a well-known Perl author to do a one-day class just before NPW for those who are interested (this will not be free tho).</p><p> <b>YAPC::Europe 2008</b> <br> I'm definitely going. Copenhagen is also really close to Sk&#229;ne where my family has a summer house so it's just a short trip over the bridge. mmm... bridge... gaaaaah.</p><p> <b>Social life</b> <br> Big step.. due to reasons given earlier I haven't been able to go out for quite some time. I'm working on this by exposing me to situations I don't like. CBT++</p><p>Now if only a cute sweet girl who understands the life of a hacker would cross my path =)</p><p> Happy 2008<br><nobr> <wbr></nobr>/Claes</p> claes 2008-01-23T15:13:35+00:00 journal now self-employed So today was my last day at the Swedish Premium Pension Authority. I've really enjoyed working there for the past 4 years but everything has to end sooner or later.<br> <br> As of today I'm self-employed. My company is named Versed Solutions and it has a website at <a href=""></a>. I'll be working on a development tool I've been thinking of for a couple of years now which will probablly be released as OSS. If it becomes a smashing hit I hope I'll be able to employ some good Perl developers (which unfortunately are pretty rare in Sweden). <br> <br> I've also moved my blog to LiveJournal here -&gt; <a href=""></a>.<br> <br> Happy hacking,<br> Claes claes 2006-09-29T20:04:11+00:00 journal New toy - MacBook <p>After getting more and more aggrevated at the speed of my current mac I finally threw in the towel and bought myself a MacBook.</p><p>I went for the low-end version (1.83 GHz) because I couldn't justify the extra 2000 SEK (~ $280) Apple wants for a slightly faster CPU and a SuperDrive. Now I just have to order myself 2GB RAM and I'll be all set.</p><p>I'm also on the hunt for an external display so I can use extended desktop. I'm considering the <a href=";productId=200W6CS_00_GB_CONSUMER&amp;activeCategory=MONITORS_PC_PERIPHERALS_GR_GB_CONSUMER&amp;fredhopperpage=detail.jsp&amp;language=en&amp;country=GB&amp;catalogType=CONSUMER&amp;proxybuster=FNQACQOYJ3103J0RMRCSHP3HKFSESI5P"> Philips 200W6CS/00</a>.</p><p>However if someone has another recommendation please leave me a comment. I want at least 1440x900 pixel resolution and it should be too pricy (sorry Apple).</p> claes 2006-07-08T13:52:18+00:00 journal NPW 2005 report #2 <p>The workshop is now only a month away. Here is the latest dirt:</p><blockquote><div><p> <b>Date of event</b> <br> Since we have booked a venue we now know that the workshop will be the 22nd and 23rd of October so you can book that in your calendar. </p><p> <b>Talks</b> <br> A few more proposals has been submitted but there are still slots to fill. So if you're interested in <a href="">giving a talk</a> submit a proposal to <a href=""></a> now.</p><p> <b>Wiki</b> <br> The <a href="">wiki</a> is up and running. There isn't much there yet. </p><p> <b>Registration</b> <br> The website and online registration will open soon. The cost for this event will be 50 Euros. </p></div> </blockquote> claes 2005-09-23T18:40:48+00:00 journal NPW 2005 report #1 <p> Good ideas are worth stealing (thanks <a href="">Cog</a>).<br> <br> Here is a first report on the progress of Nordic Perl Workshop 2005. </p><blockquote><div><p> <b>Talks</b> <br> Since the <a href="">call-for-papers</a> came out almost a week ago we have received proposals for five ordinary talks and one lightning-talk. With the non-submitted ones that we know about we're already up to seven talks.<br> <br> Keep 'em coming! </p><p> <b>Venue</b> <br> Today we booked the venue where NPW 2005 will be. It's located in the central parts of Stockholm a two-minute walk from Odenplan. <a href=",18.049217&amp;spn=0.002879,0.007389&amp;t=k&amp;hl=en">Google maps!</a> </p><p> <b>Pricing</b> <br> Pricing has not yet been decided but expect it to be around the price for previous NPWs which is around 50 EUR. </p><p> <b>Call-for-participants</b> <br> As we now have final dates for the workshop this one is due out really soon. </p></div> </blockquote><p> That's all for now. </p><p><nobr> <wbr></nobr><i>/Claes</i></p> claes 2005-09-15T18:56:58+00:00 journal TAP 1 - JUnit 0 <p>In an effort to unify testing at work I've now created a JUnit runner that outputs results in TAP.</p><p>Let the sweet things begin!</p> claes 2005-08-23T14:49:47+00:00 journal Distribution versioning on CPAN? I've been thinking lately about how authors version their distributions and what managers think of using software with &lt; 1.00 version numbers.<p> I, like probably most other Perl developers, trust that a distribution on CPAN with a version number below 1.00 is still usable and considered safe.</p><p> But, if I was a non Perl-programming manager who had to make the decisions I would be more skeptical on relying on software that didn't have a "stable" version number. "stable" in this context meaning 1.0 or later. I believe that the fact that there are so many distributions on CPAN with a version below 1.0 (some of mine included) could scare the decision makers off and instead of embrace and extend just go on developing their own internal modules that does the same thing.</p><p> The problem that we are seeing this is because h2xs sets 0.01 as the initial version of the module it creates and many authors are just too lazy to even bother thinking about if this should be considered stable. Are there any guidelines in the Perl community when a distribution should receive a &gt;= 1.00 version number?</p><p> So my question to all of you is:</p><p> <b>How do you version your distributions and why?</b></p> claes 2004-04-04T17:08:15+00:00 journal NPW day #1 Day #1 of the Nordic Perl Workshop is comming to an end (presentation wise).<p> I've done my presentation about "CPANXR - Odds and ends of Perl cross-referencing" and it felt like it went good.</p><p> Tommorow looks like an interesting day with some really advanced talks.</p><p> Soon it is time to head out for some food and beer.</p><p> Til then,<br> Claes</p> claes 2004-03-27T15:55:36+00:00 journal tech-evening on 12th Feb. On the 20th of February it's one year since we rebooted Stockholm Perl Mongers. To celebrate this we're having a tech-meeting on the 12th of February. More information <a href="">here</a> (in swedish).<p> If you happen to be in Stockholm at that time and speak or understand (some) swedish you're welcome to join us. Cheers, Claes</p> claes 2004-01-13T16:11:02+00:00 journal Basic class-browser available Being bored sometimes produces fun features. I've added a very simple class-browser to CPANXR.<p> Go <a href="">HERE</a> and click on a package name.</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-09-29T21:35:38+00:00 journal CPANXR progress report Alright, as promised earlier this week a new version of CPANXR is now installed on the public demo.<p> Highlights in this release are:</p><ul> <li> <b>Visualization of files</b> using GraphViz. An example can be seen <a href="">here</a></li> <li>Search page is now actually there and working (no case-insensitive search yet tho)</li> <li>Better display of search and symbol results</li> <li>Probablly some more stuff I can't remember now</li> </ul><p> I have fun with it, so should you!</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-09-27T22:09:46+00:00 journal CPANXR! now with GraphViz An update of the CPANXR public demo site is still a few days away, but the new version contains lots of fixes and a number of new features.<p> Probablly the coolest one is visualization of a file (packages, subrountines, IS-A, includes). <a href="">Screenshot (132 KB)</a>.</p><p> Happy hacking!</p><p><nobr> <wbr></nobr>/claes</p> claes 2003-09-20T13:13:48+00:00 journal It took some time, but I've finally updated my homepage and put in some content. No more "comming soon..." message =)<p> <a href=""></a> </p><p><nobr> <wbr></nobr>/claes</p> claes 2003-09-19T09:44:16+00:00 journal Sweden in grief Due to this morning events, I and the rest of Sweden is in grief.<p> Our foreing minister Anna Lindh died at 5.29 a.m CEST from the wounds caused by yesterdays attack at the upscale NK (Nordiska Kompaniet) store in Stockholm by an undefined man.</p><p> My condoleances to her family and friends.</p><p> <a href="">CNN</a> </p><p> <a href="">BBC</a></p> claes 2003-09-11T10:51:32+00:00 journal CPANXR 0.05 installed CPANXR 0.05 is now installed at the public demo site (<a href=""></a>). This release consists mostly of updates to the web-interface. Be sure to check it out!.<p> There are a lot more distributions in the database now. I've indexed most to all of AI-, Acme-, BSD-, Cache-, Data-, Exception-, File-, Games-, HTML- and POE- distributions. It only took about 1 1/2 hour to run the indexer. Here are some stats:</p><p> <code> File information:<br> <br> Type, Count, LOC<br> ---------------<br><nobr> <wbr></nobr>.xs, 35, 8830<br><nobr> <wbr></nobr>.pm, 1169, 442111<br> <br> <br> Reference information:<br> <br> Type, Count<br> ----------<br> Barewords, 11323<br> Packages, 1295<br> Declarations, 12963<br> Connections, 40964<br> </code> <br> Let me know what you think and be gentle to the server. MySQL seems to be a bit unstable on OpenBSD.</p><p><nobr> <wbr></nobr>/claes</p> claes 2003-08-27T22:49:48+00:00 journal Whiteboard development model Despite it might increase my level of geekiness, I've finally purchased a whiteboard for my home. It's one of those analog thingies that you write with pens on. I thought I didn't need one as a 21st century digital boy, but keeping track of my CPANXR todo-list on it is a lot easier than keeping a file somewhere on the disks.<p> I also bought 4 pens in different colors, so I use a very simple scheme to track what I've done and what is left. The color scheme looks like this:</p><p> <code> <b>Red</b> = in progress<br> <b>Green</b> = finished<br> <b>Blue</b> = undecided<br> <b>Black</b> = dependencies (drawn as arrows between items) </code> </p><p> I can recommend the whiteboard approach of project management. It sure has helped me.</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-08-26T14:42:39+00:00 journal Progress report - CPANXR My project CPANXR (the CPAN Cross Reference) is moving forward fast. The access_log reports 66 unique visitors since I posted the URL =)<p> New stuff:</p><ul> <li>Parser has been rewritten to use <a href="">PPI</a> instead of regular expressions. It now does a much better job finding function and method calls.</li> <li>The linker now keeps track of what package a subroutine is defined in. This means stuff like <code>use Module qw(function);</code> will associate <b>function</b> with package <b>Module</b> when indexing and that will increment the change of actually finding the correct declaration when following the symbol.</li> <li>I wrote a very simple plug-in for Bot::BasicBot::Pluggable so CPANXR can be accessed via IRC.</li> <li>Search page is on the way, I still need to know what you users want.</li> </ul><p> Also, some ideas:</p><ul> <li>SOAP interface to CPANXR</li> <li>"Modulize" the file viewer</li> </ul><p> Ideas, comments, critisism, feature requests or whatever to <a href=""></a> please.</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-08-20T20:16:57+00:00 journal CPAN Cross Reference update I've put a CPAN Cross Reference installation online for public demonstration. It has serious issues and bugs and is laking a lot of functionality, but it might be interesting anyway.<p> The PRE-ALPHA can be found on this address:</p><p> <a href=""></a> </p><p> Enjoy,<br><nobr> <wbr></nobr>/Claes</p> claes 2003-08-18T22:00:58+00:00 journal cross reference of entire CPAN A couple of weeks ago I spent some time in London after YAPC::Europe. At an emergency social meeting we had a few drinks and then <a href="">Sky</a> started handing out projects to us who had nothing to do.<br> <br> I got assigned the fun task of cross-referencing CPAN!<br> <br> Basiclly, it analyses source code - finding what other packages it uses or requires, what subroutines it declares, what functions and methods it calls and what packages it defines. From this information a database is built holding references.<br> <br> In the web-interface, you can browse the distribution and if a file is indexed you can have a look at the source. When it lists the source, each connection (like a use, call etc) are linked and if you click that link you'll end up in the symbol page. This is where it's getting interesting. The symbol display page shows in what file(s) the symbol is define as a package, declared as a subroutine or called.<br> <br> You can also search for symbols which is great if you know the name of a function but you don't know in what distribution/module it is declared in.<br> <br> Anyway, doing source analysis of Perl-code is extremlly difficult, and it won't handle some of special things one can do. I wish I had a better way to do it than with regular expressions. <b>Only perl can parse Perl!</b> <br> <br> I plan to have a public demo site up today or later this week. The URL will be posted in my journal.<br> <br> Hopefully, you guys will find this useful.<br> <br><nobr> <wbr></nobr>/Claes claes 2003-08-18T13:25:30+00:00 journal Travel report I'm finally back in Stockholm after 10 days of conference/vacation. YAPC::Europe was great, huge amount of credits to the Paris Perl Mongers. I'm already looking forward to next years YAPC::Europe in Belfast.<p> After Paris, I took the EuroStar up to London. It was supposed to take 2 1/2 hours, but ofcourse the train going to Paris broke down at Ashford International so they had to take our train back to Paris and we had to wait while they fixed their train to take us to London. Atleast I didn't have to wait 4 hours as some of the London Perl Mongers did.</p><p> Once in London, a friend met me at Waterloo Station and we took a cab up to a swedish pub. Once there, we found it was occupied by a private party (Bummer), so off to McDonalds for some dinner. It is without doubt the most expensive BigMac &amp; Co I've ever eaten. Later that night we went to a pub in Chelsea.</p><p> On monday, I went to stay with sky in his apartment and do some sightseeing. Took the bus from Old Street down to Waterloo to catch Matrix Reloded on IMAX, but they only screen it in the evenings. So I walked over to Tate Modern, cross the millenium bridge and up in St. Paul's Cathedral. 600 stairs makes me really tired. After some random walking in London, I went to see sky again.</p><p> On tuesday, more random tourist activities.</p><p> On wednesday evening, there was a emergency social meeting because I and R. Geoffrey Avery were in town. Lots of beer and booze and sky managed to hand out homework for those who had little to do.</p><p> Thursday and it was time to fly back home. Took the train from Paddington out to the airport and got lost in the terminals. Managed to find my way to the SAS check-in after a while. After going thru security check and not beeing searched I was kinda suprsised, because I thought they had tighten up security. But when entering the gate, they randomly (yeah right, eat my shorts) selected me for a security check. Two people who had checked-in didn't board the aircraft, so they had to unload all luggage and remove theirs so we were an hour late away from London.</p><p> Well, that's about what I've been up to.. now it's time to do some programming (and play SimCity 4 ofcourse).</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-08-01T13:51:26+00:00 journal YAPC::Europe talks Sweeeeet, both of my submitted talks for YAPC::Europe 2003 got accepted.<p> I'll be doing two presentations this year, <i>Making Applications scriptable</i> and <i>Filter development for Imager</i>.</p><p> However, I need a wacky idea on what the Imager plug-in should actually do. I have some ideas of my own, but yours are probably better. </p><p> If you have one, please either send it to <a href=""></a> or post a comment to this journal entry.</p><p> See you in Paris,<br> Claes</p> claes 2003-06-19T09:01:28+00:00 journal Stag party Last night we arranged a stag party for sky, it was lots of fun.<p> Me, kane, sky and 6 other friends cruised in a limo to the climbing place where sky climbed some walls. Then we headed home for a three course dinner I prepeared, and afterwards we had cigars &amp; booze. Later in the evening we ended up drinking beer &amp; vodka in their sauna.</p><p> I hope everyone is more or less alive today.</p> claes 2003-05-16T10:38:23+00:00 journal Tales from the crypt It's sunny and kinda warm outside here in Stockholm, wtf am I doing at work?<p> Anyhow, I installed SquirrelMail on my mailserver yesterday because I wanted a web-interface to my mail. It's nice and all that, except it's written in PHP and really slow with lots of mail in the inbox. Are there any nice mod_perl based web-mail solutions or will I have to write one myself?</p><p> Next thing I want is an Apache module for publishing my Keynote slides like the HTML export feature in Microsoft PowerPoint. I wrote some code to objectify the presentation.apxl file, it could probablly end up in something useful. This could, ofcourse, be used for other things as well, like rendering each slide with Imager or like.</p><p> My implementation of the li/rpc protocol (<a href=""></a>) is comming along fine. I've renamed it to li/rpc-e (e for enhanced) since it adds a number of features not found in li/rpc. Hopefully, I can post it on CPAN sometimes next week.</p><p> Oh, and I need to learn python and tcl.</p><p><nobr> <wbr></nobr>/Claes</p> claes 2003-05-13T12:07:58+00:00 journal on Net::Java::RMI and Serialization Several people have told me the past days that I'm basiclly nuts. I dunno why, but since I can't find any arguments to prove them wrong they are probablly right.<br> <br> Well, I think it all comes down to my fascination of doing serialization. So, I've listed my top six libraries/frameworks/technologies (note, some of these do not do cross-platform or cross-language communication).<br> <br> 1: <b>use Storable qw(freeze thaw)</b> <br> What can we say? Storable is reasonably fast and creates pretty compact binaries.<br> <br> 2. <b>YAML</b> <br> Compact readable dumps, easy to debug, easy to handcraft.<br> <br> 3. <b>NSCoding protocol in Cocoa/GNUstep</b> <br> I actually like this, it gives me full control of what to serialize. And I'm a big fan of Objective-C too.<br> <br> 4. <b>XML</b> <br> Can be compact and nice, can be huge and ugly. It's what you make of it.<br> <br> 5. <b>Roll your own binary</b> <br> Not a bad alternative. Autogenerating XS code from XML is fun.<br> <br> 9999: <b>JAVA built-in</b> <br>,, and says it all. Backwards-compability is a biatch. Doing it in Perl is even more a biatch, but it can be done.<br> <br> Well, that list pretty much sums it up, don't we think?<br> <br> Cheers, Claes claes 2003-03-04T23:30:31+00:00 journal Java/Perl RMI <p>I've been investigating Java RMI lately... expect wicked stuff.</p> claes 2003-01-27T21:23:59+00:00 java Perl - Java - Perl and stuff like that <p>During the last few days, i've been doing some heavy programming incorporating execution of Java code inside our Content Management System. Except the possiblity to run Perl and JavaScript in the webpages the system creates, the marketing people also wanted native Java support. At first, this sounded like an "almost" impossible task (since i had 3.5 working days to fix it). But nothing is impossible =)</p><p>Inline::Java fixes the problem to run java inside perl, but once you want java code to call perl subrutines (or methods) things get harder. So i realised it was time to dig into JNI (Java Native Interface) and mix that with perl API calls. Inline::Java is really really nice, but didn't really do what i wanted so i ended up using which is just an interface to JNI Invokation Interface. We wanted to wrap our perl classes inside Java and that was the problem. This is basiclly what i ended up with:</p><p>----------------------------------------</p><p># Wrapper Java class<br>public class FooWrapper {<br> &nbsp; &nbsp; int _SVaddr = 0;</p><p> &nbsp; &nbsp; static { System.loadLibrary("FooWrapper") }</p><p> &nbsp; &nbsp; public FooWrapper(int ptr) {<br> &nbsp; &nbsp; &nbsp; &nbsp; _SVaddr = ptr;<br> &nbsp; &nbsp; }</p><p> &nbsp; &nbsp; public native void printID();<br>}</p><p># Some JNI code, compiles to needed for System.loadLibrary</p><p>SV *get_sv_reflect(JNIEnv *env, jobject obj) {<br> &nbsp; &nbsp; SV *reflect_sv;<br> &nbsp; &nbsp; jclass class_ref;<br> &nbsp; &nbsp; jfieldID addr_field_ref;<br> &nbsp; &nbsp; jint addr;</p><p> &nbsp; &nbsp; class_ref = (*env)-&gt;GetObjectClass(env, obj);<br> &nbsp; &nbsp; if(!class_ref) return NULL;</p><p> &nbsp; &nbsp; addr_field_ref = (*env)-&gt;GetFieldID(env, class_ref, "_SVaddr", "I");<br> &nbsp; &nbsp; if(!addr_field_ref) return NULL;<br> &nbsp; &nbsp; addr = (*env)-&gt;GetIntField(env, obj, addr_field_ref);<br> &nbsp; &nbsp; if(!addr) return NULL;</p><p> &nbsp; &nbsp; reflect_sv = (SV *) addr;<br> &nbsp; &nbsp; return reflect_sv;<br>}</p><p>JNIEXPORT void JNICALL Java_FooWrapper_printID(JNIEnv *env, jobject obj) {<br> &nbsp; &nbsp; dSP;<br> &nbsp; &nbsp; SV *ref;<br> &nbsp; &nbsp; ref = get_sv_reflect(env, obj);</p><p> &nbsp; &nbsp; if(ref) {<br> &nbsp; &nbsp; &nbsp; &nbsp; ENTER; SAVETMPS; PUSHMARK(SP);<br> &nbsp; &nbsp; &nbsp; &nbsp; XPUSHs(ref);<br> &nbsp; &nbsp; &nbsp; &nbsp; PUTBACK;</p><p> &nbsp; &nbsp; &nbsp; &nbsp; call_pv("Foo::printID", G_VOID);</p><p> &nbsp; &nbsp; &nbsp; &nbsp; FREETMPS;<br> &nbsp; &nbsp; &nbsp; &nbsp; LEAVE;<br> &nbsp; &nbsp; }<br>}</p><p># Our java code<br>public class Party {<br> &nbsp; &nbsp; public Party {<br> &nbsp; &nbsp; }</p><p> &nbsp; &nbsp; public void run(FooWrapper foo) {<br> &nbsp; &nbsp; &nbsp; &nbsp; foo.printID();<br> &nbsp; &nbsp; }<br>}</p><p># Some perl code<br>package Foo;</p><p>sub new {<br> &nbsp; &nbsp; my $class = shift;<br> &nbsp; &nbsp; my $id = shift;</p><p> &nbsp; &nbsp; return bless { id =&gt; $id }, $class;<br>}</p><p>sub printID {<br> &nbsp; &nbsp; my $self = shift;<br> &nbsp; &nbsp; print "ID is: $self-&gt;{id}\n"<br>}</p><p>package main;</p><p>use Inline ( C =&gt; "int get_sv_addr (SV *var) { return (int) var; }" );</p><p>use Jvm;</p><p>my $party = new Jvm("Party", "()V");<br>my $foo = new Foo(10);</p><p>my $foow = new Jvm("FooWrapper", "(I)V", get_sv_addr($foo));</p><p>$party-&gt;run("(LFooWrapper;)V", $foow);</p><p>----------------------------------------</p><p>The real code i wrote throws Java Exceptions if the perl subrutine/method dies =)</p><p>Magic =)<nobr> <wbr></nobr>/claes</p> claes 2001-09-05T15:23:06+00:00 journal Going to Amsterdam <p>Tomorrow at 4 am, I'll be on my way to Amsterdam and Yapc::Europe, woohooh!<nobr> <wbr></nobr>/claes</p> claes 2001-07-29T17:10:20+00:00 journal make dist It's been a while since my last journal but i've been busy fixing up for release to CPAN and writing both docs and my speech for YAPC::Europe.<br> <br> After many late nights, i finally did a 'make dist' this morning. So, i promise, it will be uploaded today.<br> <br> If anyone cares to read documentation, there is one over at <a href=""></a> <br> <br> Enjoy it, i do =)<br> <br><nobr> <wbr></nobr>/c claes 2001-07-25T08:19:21+00:00 journal