mikael-g has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File extension --
by arthas (Hermit) on Jun 12, 2003 at 08:53 UTC | |
|
Re: File extension --
by benn (Vicar) on Jun 12, 2003 at 10:38 UTC | |
|
Re: File extension --
by BUU (Prior) on Jun 12, 2003 at 17:44 UTC |