Just another perl hacker somewhere near Disneyland
I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.
I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.
I've been using Gearman a lot lately with Gearman::XS. In an effort to reduce boilerplate, I've released GearmanX::Starter to launch Gearman workers.
Other features of the module are signal handling, where if a worker gets a SIGTERM, it'll finish any current task before terminating. To get this to work, I had to use Perl::Unsafe::Signals, otherwise you could not terminate the process while the worker was waiting for a job. It would only terminate after getting a new task from the server (causing the task to fail).
I had an interesting issue converting a worker script to using my GX::S module though...One line had $job->send_complete(1); which tells gearman to send the result "1" and a status of "complete" to the client. However, I was getting an error of "gearman_con_flush:write:14" when the worker was trying to wait for the next job. This didn't happen before I started using GX::S, but it was fixed when I changed the code to $job->send_complete("1"); (with quotes). I can not come up with a simple test case, but just in case someone else has the same issue, here's the possible work around.
Update: This is with Gearman::XS 0.7. It doesn't seem to occur with 0.8, so perhaps it's time to upgrade
I haven't seen any recipe posts for quite a while (perhaps for good reason), so I'll go ahead and break that streak.
Ever been to a salad bar where you pay by the ounce (or whatever unit of weight your locality uses)? And then they also make you weigh the salad dressing with the rest of the salad, adding $0.50-$1.00 or more to the cost? Well, say no more! Just go over to the condiments, grab 4 packets of mayo, 2 packets of relish, and 2 packets of ketchup (adjust packets to taste), blend together w/your fork, and enjoy w/your salad.
I don't know how economical this is if they charge 5-10p (as they sometimes did last time I was in the UK) for condiment packets. And if they don't make you weigh the salad dressing, why are you putting it on before weighing it? 8-)
I'd really like to try out Strawberry Perl, but it'll have to wait 'till I get around to installing it at home, where I do a lot less perl than at work. 'Cuz you need admin rights to install strawberry, and they don't hand that out for work laptops.
ActiveState Perl, on the other hand, does install without admin privs, though with some caveats. ".pl" files don't get associated with Perl, and the global PATH does not get updated.
So, a few workarounds. I create a shortcut to "cmd.exe" that executes %SystemRoot%\system32\cmd.exe, which sets the path to all my favorite places before starting up "cmd.exe". And since you can't doubleclick on a ".pl" file to run it (file extension association, remember?), the pl2bat program becomes more useful, except that it doesn't work, because PATH is not set, so you have to add the path to perl.exe inside the pl2bat program. Last (though not due to admin issues), you need to set the HTTP_PROXY environment variable ('http://user:password@proxyhost', if it's authenticated, which it is for me) for ppm to work, except that it so happens that in my case, setting HTTP_PROXY interferes with Informatica, so I set it in a BEGIN block inside the ppm program itself.
It's been a while since I've used SSH...most companies I've worked at just use plain telnet. And SSH is one of those things that once set up, you forget about, so you keep having to relearn it. I got two logins set up with public key auth, but a third would only work with a password. I finally learned about the StrictModes setting in the sshd config...the permissions on my home directory were 777. Changed it to not be world-writable and now the public key auth works.
And I've set up my work provided Windows laptop with Perl (of course), Vim, MSYS, and Firefox. I wanted to automate some SFTP file transfers, and was not having any luck/progress with Net::SFTP or Net::SFTP::Foreign and their dependencies. Then a post on perlmonks directed me to Net::SSH2, which does ssh, scp, and sftp. Net::SSH2 is definitely the easiest to get working on Windows.
When you're able to re-create a bug in a 3rd party app, you may think that the hard part is over. Just submit your bug to support, along with a test case, and you're done.
Nope.
Now you need to get the first-level support to understand what the problem is, and is not. Then you need to explain to the 2nd level support what the problem is, and is not. Then you need to get them to actually follow the instructions in your test case. The test case involved perl. It was my mistake assuming that they actually know how to use perl. I'm pretty sure that they do use perl, but when they ask "Can you send us the DBI library", I have doubts. I'm still waiting for them to tell me that it's a feature, not a bug.
my $n = 2_000_000;
my $s = "hello";
my $t = deepref(\$s, $n);
print "Made ref: ";
my $p = scalar(<STDIN>);
sub deepref {
my ($s,$n) = @_;
my $r = \$s;
for (1..$n) {
my $t = $$r;
$r = \\$t;
}
return $r;
}
<SCRIPT language="javascript">
window.location.href="home/";
</SCRIPT>
Really, if you want to tell everyone how wonderful your company is, it should be at least just a little bit functional without JavaScript. I wonder if they'll care...
Update: I've decided the sub-title of this post is "I still don't want a pickle: s/motor/bi/"
It's about an 8 mile drive to work, and I decided that it was time to see about riding my bike instead. And there's all sorts of reasons for doing it, and people ask ("But what about...") about all sorts of reasons for not doing it. But the biggest reason is that instead of dreading the drive home and wondering if I should take the freeway or surface streets (and not caring much more about the trip to work), I actually look forward to the commute, each way, whether it's cold and foggy, or hot and sweltering (I'm not yet prepared for rain, so I'll drive if that's the case, 'cuz you know that in Southern California we're afraid of melting if it rains, even a little).
Once upon a time there was a marine base. And it was decommissioned. And there was some discussion over what to do with the space left by the decommissioned marine base. Some people wanted an airport, some people wanted a park. There was a vote. And the park people won.
And Arlo Guthrie played while a big orange balloon went up and down. And everyone who "thought that guy was dead"[1] got to hear Alice's Restaurant (for free!), and lots of other songs and stories, and it was funny, and entertaining, and a wonderful time was had by all. But we didn't get there early enough to get passes for the Orange Balloon
So a few weeks later, we went back earlier to get passes, rode the Orange Balloon, and listened to some more music (a "Wartime Radio Revue", which was cool, but not Arlo Guthrie...
[1] I called my wife Friday morning when I heard on the radio about the show:
The first thing he said onstage was "I bet some of you heard about this and said "I thought that guy was dead..."