Mailing List Archive

Support open source code!


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

Re: tlug: Easy (?) perl syntax question



>>   if($data{'formnum'} eq "1")$formnum="1";
>
>Hmm let's see this should do it....
>...
>or 
>   if ($data{'formnum'} eq "1"){ $formnum = "1" }

Okay, I see - I need {}. I'm thinking like a C programmer :-).

>> 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;
>
>
>Where do you get the value for $extension? Are you overwriting the
>$extension somewhere in the script?  

$extension is fine - I'm fairly sure it's $formnum that is the problem.
When I did this:
 $formnum="";
 if($data{'formnum'} eq "1"){$formnum="_1"}
...
 print "<!--$data{'formnum'}-->\n";
 print "<!--$formnum-->\n";
 print "<!--$wfile-->\n";

Then in the HTML I see:
<!--1>
<!---->
<!--19981025.csv-->

The 1 has somehow removed the "--" characters. Also the if does not seem to
have worked.

Now I change my to:
  $formnum=$data{'formnum'};

And in the HTML I see:
 <!--1>
 <!--1>
 <!--199810251>
             ^^^ It's put the 1 there, but removed everything that
followed: ".csv--"

Darren

---------------------------------------------------------------
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