i have a script that makes a database of dates for a calendar. extra leading spaces are being added to the database thus not allowing the calendar to read the actual dates. the db file looks like this:
20010101~|~blahh~|~blahh~|~...
_20012010~|~nahr~|~kjnerh~|~...
_20010243~|~knah~|~knrh~|~...
_20022032~|~kjnrh~|~knreh~|~...
this is the submitsub that i think is causing the problem, if anyone could help that'd be great.
sub editsubmit {
if ($FORM{'form'} eq "dates"
{
@varkeys = keys (%FORM);
foreach $line(@varkeys) {
unless ($line eq "action" || $line eq "form" || $line eq "$tempnum|del"
{
($tempnum, $varname) = split(/\|/, $line);
if ($varname eq "date"
{
$del = "$tempnum"."|"."del";
$date = "$tempnum"."|"."date";
$event = "$tempnum"."|"."event";
$url = "$tempnum"."|"."url";
unless ($FORM{"$del"} eq "yes"
{
$list[$tempnum] = "$FORM{$date}~|~~|~~|~$FORM{$event}~|~$FORM{$url}~|~\n";
}
}
}
}
open (DATES,">$filedir/dates.txt"
|| &error("Can't Open dates.txt $!\n"
;
print DATES "@list";
close(DATES);
}
20010101~|~blahh~|~blahh~|~...
_20012010~|~nahr~|~kjnerh~|~...
_20010243~|~knah~|~knrh~|~...
_20022032~|~kjnrh~|~knreh~|~...
this is the submitsub that i think is causing the problem, if anyone could help that'd be great.
sub editsubmit {
if ($FORM{'form'} eq "dates"
@varkeys = keys (%FORM);
foreach $line(@varkeys) {
unless ($line eq "action" || $line eq "form" || $line eq "$tempnum|del"
($tempnum, $varname) = split(/\|/, $line);
if ($varname eq "date"
$del = "$tempnum"."|"."del";
$date = "$tempnum"."|"."date";
$event = "$tempnum"."|"."event";
$url = "$tempnum"."|"."url";
unless ($FORM{"$del"} eq "yes"
$list[$tempnum] = "$FORM{$date}~|~~|~~|~$FORM{$event}~|~$FORM{$url}~|~\n";
}
}
}
}
open (DATES,">$filedir/dates.txt"
print DATES "@list";
close(DATES);
}