> What I want to do is use different html > templates (the location if which can be stored on the > database) to display > the relevant information. For example: if i read data off a > database that > has 3 pictures i would use 1 template, if the page has 4 pics > i would use > another template. > > Can this be done in perl ????????
Yes. I don't think it's necessary to store the template location in the database, though. It would probably be easier to select all the associated images and test how many you have, and select the template in your perl script based on the number of images. Once you have the information from the database (let's assume it's in @images), you could do something like $numPics = $#images; if($numPics > 3) { $template = 'morethan3.html' } else { $template = '3orless.html' } for(@images) { # insert values into $template somehow } Then you'd have to do some sort of regex replace on your html template file to insert the image filenames. Honestly, I usually prefer to either use templates for only the top and bottom of the html file and automatically generate code for as many pictures as necessary, or generate the entire html file from within perl, depending on the complexity of the requirements. Hope that helps, -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]