Skip to content

Instantly share code, notes, and snippets.

@diegok
Created March 7, 2013 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegok/5108275 to your computer and use it in GitHub Desktop.
Save diegok/5108275 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use v5.10;
use Class::Load qw(load_class);
#use Mojo::UserAgent; # works when pre-loading
if ( my $pid = fork() ) {
waitpid( $pid, 0 );
say "Forked child($pid) exited with status $?";
}
else {
$0 = "child child child";
load_class('Mojo::UserAgent');
my $ua = Mojo::UserAgent->new;
say $ua->get('http://mojolicio.us/')->res->code;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment