<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Jason A. Crome</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/jason_a_crome/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/jason_a_crome/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/jason_a_crome//712</id>
    <updated>2012-04-12T19:51:17Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Simple HipChat notifier</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/jason_a_crome/2012/04/simple-hipchat-notifier.html" />
    <id>tag:blogs.perl.org,2012:/users/jason_a_crome//712.3096</id>

    <published>2012-04-12T19:36:56Z</published>
    <updated>2012-04-12T19:51:17Z</updated>

    <summary>We needed a simple way of sending messages to HipChat (great online chat software, BTW), so I cooked up this: #!/usr/bin/env perl use strict; use warnings; use WWW::Mechanize; # See https://www.hipchat.com/docs/api/method/rooms/message for info my $url = &apos;https://api.hipchat.com/v1/rooms/message&apos;; my $api_key =...</summary>
    <author>
        <name>Jason A. Crome</name>
        <uri>http://www.devnetinc.com</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/jason_a_crome/">
        <![CDATA[<p>We needed a simple way of sending messages to <a href="http://www.hipchat.com">HipChat</a> (great online chat software, BTW), so I cooked up this:</p>

<p><code><br />
#!/usr/bin/env perl</p>

<p>use strict;<br />
use warnings;<br />
use WWW::Mechanize;</p>

<p># See https://www.hipchat.com/docs/api/method/rooms/message for info<br />
my $url     = 'https://api.hipchat.com/v1/rooms/message';<br />
my $api_key = 'your-api-key';<br />
my $from    = 'User-to-post-as';<br />
my $room    = 'room-to-post-to';<br />
my $message = $ARGV[0];<br />
my $color   = $ARGV[1];</p>

<p>my $mech = WWW::Mechanize->new;<br />
$mech->post( $url, {<br />
    room_id    => $room,<br />
    from       => $from,<br />
    color      => $color,<br />
    message    => $message,<br />
    auth_token => $api_key,<br />
});<br />
</code></p>

<p>Quick and dirty - no error checking.  Works well for the situations we are using it in, but you may wish to make something more robust before doing anything serious with it.</p>

<p>Enjoy!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Compiling mod_perl 2 on OS X Lion</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/jason_a_crome/2012/04/compiling-mod-perl-2-on-os-x-lion.html" />
    <id>tag:blogs.perl.org,2012:/users/jason_a_crome//712.3032</id>

    <published>2012-04-03T16:20:30Z</published>
    <updated>2012-04-03T16:34:35Z</updated>

    <summary>Since updating to the latest XCode on OS X Lion, we&apos;ve been unable to build or use mod_perl 2 on our development machines. If we ignore the test failures and make install anyhow, we get this error message when trying...</summary>
    <author>
        <name>Jason A. Crome</name>
        <uri>http://www.devnetinc.com</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/jason_a_crome/">
        <![CDATA[<p>Since updating to the latest XCode on OS X Lion, we've been unable to build or use mod_perl 2 on our development machines.  If we ignore the test failures and make install anyhow, we get this error message when trying to start Apache:<br />
<code><br />
Cannot load /opt/local/apache2/modules/mod_perl.so into server: dlopen(/opt/local/apache2/modules/mod_perl.so, 10): Symbol not found: _modperl_handler_anon_add<br />
</code></p>

<p>One of our developers discovered this morning that llvm/clang on OS X defaults to C99, but mod_perl expects the 89 "standard".  As a result of <a href="http://clang.llvm.org/compatibility.html#inline">this thread</a>, we compiled mod_perl in the following manner:<br />
<code><br />
perl Makefile.PL MP_APXS=/path/to/apache/bin/apxs MP_CCOPTS=-std=gnu89<br />
make<br />
make test<br />
make install<br />
</code></p>

<p>And voila, we have a working mod_perl 2 on Lion.</p>

<p>Come to find out, while researching this blog post, the macports people have already run into this:<br />
<ul><br />
	<li><a href="http://echelog.com/logs/browse/macports/1325631600">Discussion</a></li><br />
<li><a href="http://lists.macosforge.org/pipermail/macports-changes/2012-January/072037.html">Fix</a></li><br />
<li><a href="https://trac.macports.org/ticket/32200">Ticket</a> and accompanying <a href="http://old.nabble.com/Re%3A--MacPorts---32200%3A-Symbol-not-found%3A-_modperl_handler_anon_add-failing-apache2-startup-td33075793.html">email thread</a></li><br />
</ul></p>

<p>Hope this saves you the grief it caused us.</p>]]>
        
    </content>
</entry>

</feed>
