Created
March 7, 2013 14:06
-
-
Save diegok/5108275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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