Hi May,

> if ($plup =~ m/(^\w\.gif\|^\w\.jpg)/ {
So... you forgot a ) at last before {
you may you may simpliy write in this way
if ($plup =~ /(\.gif|\.jpg)$/)

print "<emb src=$plup width="100" height="100">";
This is another dead point.....

you should use \" inside the print "" statement... if you want
to use double quote inside (I 've mensioned =))
however, you may omit the quotes, (i.e. =100)
or you may use single quote ( i.e. ='100' )

But for your case, don't you want it as large as full screen ?
so you may use 100%. However, if you are using double
quote, or omit the quote within the print "" statement, you
have to write 100\%, otherwise, perl will looking for a hash...

Finally, it is EMBED, not EMB

Hope this help,
Smiley Connie =)

PS. You may run your script in shell ( perl yourscript.pl ),
before you go on with the web browser... So it will direct
tell you the syntax error at which line.. It saves your time
to debug....


----- Original Message -----
From: "Troy May" <[EMAIL PROTECTED]>
To: "Beginners CGI List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 03, 2002 1:49 PM
Subject: RE: Random images on a bulletin board


> Ok, thanks for the advice.  It makes sense how to do it now.  I adjusted
the
> code a bit and it is throwing errors.  My regex might be screwed up? (I'm
> not very good with them)
>
> Here's the code:
>
> -----code-----
>
> @images =
> ("meth.jpg","pennywise.jpg","power.gif","nightshade.swf","pckiller.swf");
>
> srand(time() ^ ($$ + ($$ << 15)));
> $plup = rand(@images);
>
> print "Content-type: text/html\n\n";
> if ($plup =~ m/(^\w\.gif\|^\w\.jpg)/ {
> print "<img src=$plup>";
> } else {
> print "<emb src=$plup width="100" height="100">";
> }
>
> -----code-----
>
> See anything wrong with the regex or any reason it's throwing a 500 error?
>
>
>
>
> -----Original Message-----
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 01, 2002 10:47 PM
> To: Troy May; Beginners CGI List
> Subject: Re: Random images on a bulletin board
>
>
> Emm..... I don't exactly know what do you want,
> but try this if that's what you want:
>
> make an array to put your IMG files,
> make another array to put your SWF files.
>
> make a random 0, 1 to choose if you want to output
> as IMG or SWF
>
> if IMG, random a file from the IMG array,
> if SWF, random a file from the SWF array,
>
> if ($type = "img" ) { print "<img src=$imgfile width=......>" }
> elsif ($type="swf") { print "<embed src=$swffile width=....>" }
> ## you may set width=100\% and height=100\%
> else { print "Hi!" }
>
> Hope this help,
> Smiley Connie =)
>
>
> ----- Original Message -----
> From: "Troy May" <[EMAIL PROTECTED]>
> To: "Beginners CGI List" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 02, 2002 5:41 AM
> Subject: Random images on a bulletin board
>
>
> > Hello,
> >
> > I'm trying to make a random signature for use on bulletin boards.
Images
> > are fine, they are set sizes.  But I'm trying to make it display Flash
> files
> > also.  These Flash files default to full-screen when there are no size
> > limits set.  I can't figure out how to adjust this script to display
> images
> > AND Flash files.  Here's part of the script:
> >
> > ---------------
> > $basedir = "http://www.mysite.com/sigs/";
> >  @files =
> >
>
("Night1.jpg","Night3.jpg","Nightshade5.jpg","Kimme2s.jpg","Amazsig.gif","Ni
> > ghtshade1.jpg");
> >
> > srand(time ^ $$);
> > $plup = rand(@files);
> > print "Location: $basedir$files[$plup]\n\n";
> > ---------------
> >
> > This works with just these images.  But these .swf files have to be
> limited
> > to 100x100 through HTML.
> >
> > Any ideas, or is this impossible?
> >
> > Troy
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to