Eradicatore has asked for the wisdom of the Perl Monks concerning the following question:
If I don't create a MainWindow, and just do a regular non gui perl script on windows, it works great to go get a web page in the background. See below. If you uncomment out the MainWindow creation line below though, it fails on the exit of the child and gives the error:
Attempt to free non-existent shared string at Widget.pm line 96 during global destruction
Here is the code:
Thanks for any help!!! Justin Eltoft#!/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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fork, tk, win32
by wog (Curate) on Jun 03, 2001 at 18:48 UTC | |
by Eradicatore (Monk) on Jun 03, 2001 at 19:08 UTC | |
by wog (Curate) on Jun 03, 2001 at 19:38 UTC |