[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] gifToHtml one-liner mystery



Andrew,

Firstly, you might want to put "5 -w" right after perl in the first line
because
you are using perl5 features and warnings are almost always useful.

You might put a pound sign ('#') in front of the 'ffffff', otherwise I don't
think it will come out as a color.

The constant 'table', while OK in perl v4 should be quoted with single or
double quotes in perl5.

You don't need an asterisk in front of the G when opening the file.

In perl5, it is better to use the lower-precedence 'or' operator rather
than '||' when checking for an error.

You might put the line 'close G;' after reading the file into the GD::Image
object with the "GD::Image->newFromGif(G)" statement.

There is an obvious lack of a dollar sign in front of the 'x' when checking
for a limit to the number of rows (and the number of <TR> Table Row
markers) vice "$i<x" (probably why you got infinite <TR>'s).

I have to admit that the formatting of the code in your message was a bit
hard to decipher (easier-to-read version sent separately).

You might want to put in a judicious "\n", or "\n  ", before < in the
various p"<... statements so that you can read the output (but HTML
browsers don't care if a human can read it with a normal text editor).

I'm not sure you can emit a <BODY ...> just anywhere in an HTML file.

It could be helpful to output the name of each file you are converting
into an HTML table.

The code doesn't seem to be able to read all the .gif files I've accumulated,
but it worked reasonably with some of them.

-- Larry
>hello.
>
>I am trying to get one of the Perl one liners from TPJ#11 to work on a Mac.
...
>#!/usr/bin/perl
 #!/usr/bin/perl5 -w
...
>$f = 'ffffff';
 $f = '#ffffff';
>$T = table;
 $T = 'table';
...
>                        open*G,$_ or(warn("$_: $!")&&next);
                         open G,$_
>                        $g=GD::Image->newFromGif(G) || (warn$_, ": GD
                                                     or

>                                                for($i=0; $i<x; $i++)
                                                 for($i=0; $i<$x; $i++)
...
>andrew mckenzie


--
Regards, Larry F. Allen-Tonar        (larryat@cts.com) +1 760/746-6464 (voice)
         Principal Designer                              +1 760/746-0766 (FAX,
         P.O. Box 463072                                         upon request)
         Escondido, CA  92046-3072



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch