noname has asked for the wisdom of the Perl Monks concerning the following question:
so basically I create an empty static html page which refreshes itself each 5 secondsany '/run' => sub { my $dest = '/var/local/testp/public/results'; my ($fh,$filename) = tempfile(); my $command = "/usr/bin/R -q --slave --vanilla < /var/local/te +stp/data/code.R > $filename && mv $filename $dest/${filename}\.html"; my $proc1 = Proc::Background->new($command); my $htmlfile = "$dest" . "$filename" . '.html'; open (my $hfh,">>",$htmlfile) or die "can\'t open file $htmlfi +le: $!\n"; print $hfh "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"5; URL=/res +ults/${filename}\.html\">"; print $hfh "waiting for \<a href=\"/results/${filename}\.html\ +"> results</a>"; close $hfh; unlink ($fh); return redirect "/results/${filename}\.html"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cgi,wait for long running external prog
by bpmedley (Initiate) on Feb 13, 2014 at 22:45 UTC | |
by noname (Sexton) on Feb 14, 2014 at 07:01 UTC | |
by Anonymous Monk on Jan 20, 2016 at 14:49 UTC | |
by Anonymous Monk on Jan 20, 2016 at 22:02 UTC | |
|
Re: cgi,wait for long running external prog
by kschwab (Vicar) on Feb 13, 2014 at 18:50 UTC | |
by noname (Sexton) on Feb 14, 2014 at 06:52 UTC | |
|
Re: cgi,wait for long running external prog
by locked_user sundialsvc4 (Abbot) on Feb 14, 2014 at 02:18 UTC |