On Friday 27 Dec 2002 12:35 pm, Mystik Gotan wrote:
> Hiya!
>
> First of all, hope you had a merry christmas and you will have a happy new
> year. Okay, so I'm a beginner, but I'm trying to get some more experince
> with Perl (although I use CGI, anyway). (I'm trying to get a job soon so I
> can buy my own computer and I'll use Linux/XP so... ;))
>
> Anyway, I'm busy with a simple poll (might use it someway). You can ony
> vote for true/false. It's not very efficient, but I'll be creating 2 files,
> loop1.txt (true), loop2.txt (for voting false). I have $loop1 and $loop2,
> ofcourse, and I'll be incrementing then when a user votes. (If you have a
> more elegant way to solve this, let me know).

There's nothing wrong with this, but it could get a bit messy if you have 
multiple polls with more than true/false questions.  Why not use one file per 
poll, with 'answer=count' style formatting.  Using hashes to store the values 
it's easy to load/save the file.

> Then, I have a small image, say like 1px, spacer.gif. It sorta tells the
> user the procents of all of whom voted false/true (hope you get my point).
> Say like 46% voted, then the image must be printed out 46 times (as it's
> small, it'll fit). I want to do something like:
>
> print HTML
> TABLE
> True $loop x <img src="spacer.gif>
> False SAME HERE
> TABLE
> HTML
>
> It's sorta pseudo-cde, but please help me :)

Why not use:

<img src=bar.gif width="$loop">

This will produce smalled HTML, and means you could use a nice graded gif file 
to make it look flasher.  BTW, if $loop gets too big, try converting it to a 
percentage value first.

>
>
> _________________________________________________________________
> MSN Zoeken, voor duidelijke zoekresultaten!
> http://search.msn.nl/worldwide.asp

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to