#!/usr/local/bin/perl use POSIX; use POSIX ":sys_wait_h"; use Tk; use LWP::UserAgent; use URI::URL; my $ua = LWP::UserAgent->new; #my $mw = MainWindow->new(); if (!($pid = fork)) { $url = 'http://www.worldmusic.de/perl/dclpc-faq.html'; $file = 'web.txt'; my $req = HTTP::Request->new(GET => $url); $req->header('Accept' => 'text/html'); $res = $ua->request($req, $file); print "hi there, i'm a child about to exit\n"; POSIX::exit(0); } print "i'm the parent about to mainloop\n"; foreach $i (0..3) { sleep 4; print "i'm the parent about to mainloop\n"; } MainLoop;