regex

Note to self...

Leaving keys at work and car at the train station, and walking home, means leaving time to walk to the train in the morning, too. Just an FYI. You know, for those days when I walk out to my car with 15 minutes to get to the train and realize I have a 20 minute walk instead.
regex

That reminds me of a quote by Chuck Palahniuk...

"Centuries ago, sailors on long voyages used to leave a pair of pigs on every deserted island. Or they'd leave a pair of goats. Either way, on any future visit, the island would be a source of meat. These islands, they were pristine. These were home to breeds of birds with no natural predators. Breeds of birds that lived nowhere else on earth. The plants there, without enemies they evolved without thorns or poisons. Without predators and enemies, these islands, they were paradise. The sailors, the next time they visited these islands, the only things still there would be herds of goats or pigs. .... Does this remind you of anything? Maybe the ol' Adam and Eve story? .... You ever wonder when God's coming back with a lot of barbecue sauce?"
regex

Where to seder in Bangkok?

I want to get a hotel near to wherever I'm going to for Passover seder. And since I don't know any better about where to have seder, how about picking where I want to get a hotel, and then going to which ever seder is closer by?

Collapse )

Please to someone knowing something about which of these is in an interesting part of Bangkok!
regex

Handling exit within an eval

So I’ve run into a problem with mod_perlite, and it’s that I cannot just override Perl’s exit function with a straight perl_destruct call, a longjmp back to the Apache handler, or anything else at all.

Here’s my favorite…

bar.pl:

 exit;

Foo.pm:

package Foo;

sub new {
return bless { };
}

sub DESTROY {
print "Foo is destroyed\n";
}

1;

foo.pl:

use Foo;

my $foo = Foo->new;

print "I have a foo!\n";

BEGIN { *CORE::GLOBAL::exit = sub { goto EXIT; }; }

eval {
bar("bar.pl");
}; if ($@) {
print "$@ happens\n";
}

print "And I'm still here\n";

sub bar {
eval require $_[0];
EXIT:
print "Exiting!\n";
goto REALLY_EXIT;
}

REALLY_EXIT:

Yep, that actually works!

I have a foo!
Exiting!
Foo is destroyed.

Originally published at HydricAcid. You can comment here or there.