Gossamer Forum
Home : General : Perl Programming :

change variable ever x-day

Quote Reply
change variable ever x-day
Hey everbody,

I tried to write a script which changes the value of a variable every x-day.
like this

$laugh = "0";
$change1 = "hahaha";
$change2 = "huhuhu";
$change3 = "hihihi";
now the script runs every day one time (cron) and each time when it runs
$laugh should get one of the three values.
I tried it but I only got a lolution like on monday $laugh=$change1, on tuesday $laugh=$change2 on wednesday $laugh=$change3 etc. but I've 3 variables and the week has seven days - that does not work Smile
So what I wanted to ask Wink is how every value of the variables could appear in $laugh every third day Smile
Would be cool if you can help me.
cya

Nikolai