Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Convert perl script to global

Quote Reply
Convert perl script to global
I have a perl script:
Code:
use strict ;
use Date::Manip ;
$main::TZ='GMT' ; ##set this to your time zone
&Date_Init("DateFormat=US"); ##enforce mm/dd format for all dates.
sub calc_wrk ($$) {
print &UnixDate(Date_NextWorkDay(@_),do{$_[1]>0? "$_[1] working days from today would be":"Today is"}. " %A, the %E of %B, %Y\n") ;
}
my ($d,$m,$y)=(localtime)[3,4,5] ;
my $date=join '/',($m+1,$d,$y+1900) ;
calc_wrk($date,0) ;
calc_wrk($date,10) ;
calc_wrk($date,15) ;
I set up a global called 'workdays' and cut and paste this code surrounded by sub {}. However, when I did a static build with the page containing the global the output acutally appeared in the build script not on the page as inteneded. What do I need to change to make the output show on my html page?

Many Thanks.
Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Subject Author Views Date
Thread Convert perl script to global IndigoClothing 5000 Feb 19, 2006, 5:06 AM
Thread Re: [IndigoClothing] Convert perl script to global
tandat 4879 Feb 19, 2006, 5:16 AM
Thread Re: [tandat] Convert perl script to global
IndigoClothing 4869 Feb 19, 2006, 5:42 AM
Thread Re: [IndigoClothing] Convert perl script to global
tandat 4895 Feb 19, 2006, 6:20 AM
Thread Re: [tandat] Convert perl script to global
IndigoClothing 4865 Feb 19, 2006, 7:36 AM
Thread Re: [IndigoClothing] Convert perl script to global
tandat 4862 Feb 19, 2006, 8:00 AM
Thread Re: [tandat] Convert perl script to global
IndigoClothing 4902 Feb 19, 2006, 8:30 AM
Post Re: [IndigoClothing] Convert perl script to global
tandat 4838 Feb 19, 2006, 8:35 AM