Skip to content

Instantly share code, notes, and snippets.

View pjf's full-sized avatar

Paul Fenwick pjf

View GitHub Profile
Selecting all friends who are interested in a particular hobby should be easy, right?
Well, it is, provided you're happy to do subselects, and realise the hobbies come back as a giant string.
Luckily, all that hard work can be pushed off to the FQL server...
---
SELECT name
FROM user
WHERE uid IN (
SELECT uid2
@pjf
pjf / Example TZ conversion in Perl
Created July 31, 2009 03:08
Changing the timezone is as easy as ->set_time_zone()
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie;
use DateTime;
my $dt = DateTime->now;
foreach my $timezone ( qw( Australia/Sydney GMT America/Los_Angeles ) ) {
=head2 autodie and string eval
Due to the current implementation of C<autodie>, unexpected results
may be seen when used near or with the string version of eval.
I<None of these bugs exist when using block eval>.
Under Perl 5.8 only, C<autodie> I<does not> propagate into string C<eval>
statements, although it can be explicitly enabled inside a string
C<eval>.