Charles K. Clarkson escribió:

From: Johan Meskens CS3 jmcs3 <> wrote:

: # hello
..
: # second question : how can i insert more than one image # i tried
: the following:
:
: # foreach( 1..6 ){
: #    print "<img src=\"http://127.0.0.1/cgi-bin/five.cgi\";>"; # }
:
: # but this returns 6 times the same image

    Well, that makes sense. What are the names of each image?
The loop above keeps suing the same name each time.


# here is what five.cgi consists of( it returns a random gif-image )

use warnings;
use strict;

use CGI;

my $dirpath = '/Users/Shared/ChromaticSpaceAndWorld/INTRA';

opendir( DIR, $dirpath ) || die " espejo de vidrio $! ";
my @files = grep ! /^[\._]/, readdir DIR;
closedir DIR;

my $image = $files[ rand( $#files ) ];


my $img = CGI->new();

open( FILE, "$dirpath/$image" ) || die " espejo de vidrio $! ";

binmode FILE;
binmode STDOUT;

print $img->header('image/gif');

print while <FILE>;

close FILE;

# so i remain with this second question
# there is probably something fundamental i don't understand


P.S. CGI.pm doesn't need to document every function. Gerneral rules to create any tag is in the section titled PROVIDING ARGUMENTS TO HTML SHORTCUTS.

thank you !

out of half the sun


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to