Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: Easy (?) perl syntax question



I'm trying to get a cgi variable (called "formnum") into a string.  If
the variable is not in the input the string should be blank.

1.This code gives a server error:
  $formnum="";
  if($data{'formnum'} eq "1")$formnum="1";


2.This sets to "1" correctly, but the extension does not get appended
to $filename. It seems there is something in the $formnum that
terminates the string early??
  $formnum=$data{'formnum'};
 $filename= $BASE . "/" . $formnum . $extension;


I'm obviously misunderstanding something fundamental here. Can anyone
tell me what it is?
(To add to that, I went through the perl online manuals, and as far as I
can see my syntax is correct. So now I'm really confused!)

Yoroshiku,

Darren

PS. the script I've inherited is already using a library to parse the cgi
inputs into the data array, and the rest of the script works fine.


---------------------------------------------------------------
Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Meeting: 12 December, 12:30 Tokyo Station Yaesu central gate
---------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links