Link to home
Start Free TrialLog in
Avatar of akohan
akohan

asked on

Can Perl refresh a page?

Hello,

I need to refresh a page from crontab. Can I use Perl if so then how?

Regards,
ak
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akohan
akohan

ASKER


Yes, it is the same quesiton and now I found you have answered it using JavaScript.  But I first rather go with this solution (perl) since I'm using index.php on a server which is pretty restricted and even some javascript methods are blocked.

One thing that I have never done Perl and I got the following message which I ran above code:

Can't locate HTML/Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at update.pl line 3.
BEGIN failed--compilation aborted at update.pl line 3.

Any idea where I went wrong?

Regards,
ak

The perl code will update the index.php file on the server - not cause the page to be refreshed in the browser.
The javascript in your other question will cause the page to be refreshed in the browser - not update the page on the server.

Which you use will depend on what you are trying to do.

The above error is telling you that the HTML::Template module is not installed.  If you want to have the perl script update the index.php page on the server, the code I gave is an example of a way to do that.  You will need to install the HTML::Template module.  From a prompt:  
    perl -MCPAN -e 'install HTML::Template'
Avatar of akohan

ASKER


Thanks for your help.