Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have an account, but I can't remember the password or something... anyway, I've gotten brilliant advice, and totally solved my first issue which was a simple filehandle absolute path thing... this one Is SUPER easy. I thought that perl parsed print commands as html, I maybe wrong, but I just need to be able to show 3 different pictures with the resulting options... my options work for text, but now I want to liven up my messages so they are not plan text... anything in the right direction will help.. CHEERS for the awesome site, kyle blaque

Replies are listed 'Best First'.
Re: images for errors
by dsheroh (Monsignor) on Mar 14, 2008 at 17:37 UTC
    Perl does not parse print commands in any way, shape, or form. It just prints them.

    What do you want to accomplish? Are you trying to output an HTML page with images in it? (That's my best guess, but your post is not particularly clear.)

    What have you tried so far in your attempts to do this? What did you want the result(s) to be? What actual result(s) did you get?

    You may also wish to review How (Not) To Ask A Question.

Re: images for errors
by zentara (Cardinal) on Mar 14, 2008 at 18:27 UTC
    Just to help you pose the question better, are your images being generated by a cgi script? Or can you just send out a simple form with ckickable buttons? You probably should read "perldoc CGI" and search for CREATING A CLICKABLE IMAGE BUTTON

    So is this all going to be handled by a single cgi script? Or do you have a multiple cgi scripts handing everything?

    The very basic thing you could do is send out a form, with 3 images, that upon clicking return different params to a cgi script.

    #Here is some UNTESTED PSEUDOCODE to show the idea. There are 2 basi +c functions. One is send out the form, the second is to receive a res +ponse from the form and process it. My cgi is rusty, so anyone who ca +n fix the errors, please do. #!/usr/bin/perl use warnings; use strict; use CGI; my( $q ) = new CGI; print $q->header; print $q->start_html( -title=>"Test" ); print $q->start_form(-action=>'this_script.cgi); # Add images # image_button() produces a clickable image. When its clicked on the # position of the click is returned to your script as "button_name.x" + and # "button_name.y", where "button_name" is the name youve assigned to i +t. print $q->image_button(button_name1, /path/source/URL, MIDDLE); print $q->image_button(button_name2, /path/source/URL, MIDDLE); print $q->image_button(button_name3, /path/source/URL, MIDDLE); print $q->submit( -name=>'Choose Action', -label=>'Start Test' ); print $q->br; print $q->end_form; print $q->end_html; # this is where you detect which button is pressed if ( $q->param() ) { my $button = $query->param(); #probably need better param checking #use #@params=$query->param; #gets a list of all the names of the parameters passed to the script print "@params\n"; if ($button eq 'button_name1'){'do something'} if ($button eq 'button_name2'){'do something'} if ($button eq 'button_name3'){'do something'} }

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.