As you see my code expects a variable to create a file . understandable i guess !!#!/usr/bin/perl print "Content-type:text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } $date=$FORM{'date'}; $bar=".txt"; $date=$date . " " . $bar; $dates=$FORM{'date'}; open(INF,"$date") or dienice("Ej ....datum! $date: $! \n");
in this case , when the user presses a java calender and
chosses a date , the date will be used as afile name
with a file extension , such as db or .txt .
the problem is the file is not loading with extension.
but loads without extension.
this means the file will be in binary format.
how can i tackle this oproblem ??
update (broquaint): added <code> tags
In reply to File extension -- by mikael-g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |