Apr 2, 2002, 8:41 PM
Staff (2198 posts)
Apr 2, 2002, 8:41 PM
Post #5 of 13
Views: 8895
OSX IE sucks then :P
Try http://jagerman.com/index.cgi?source=1
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Try http://jagerman.com/index.cgi?source=1
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 2, 2002, 8:42 PM
Staff (2198 posts)
Apr 2, 2002, 8:42 PM
Post #6 of 13
Views: 8864
The fg and bg colors are pretty much random - you'll never see the same http://jagerman.com twice
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 3, 2002, 1:34 AM
Veteran (19537 posts)
Apr 3, 2002, 1:34 AM
Post #7 of 13
Views: 8751
I remember you posting a link to that months and months ago
if ($in->param('source')) {
open my $fh, "<", $0;
print <<HTML;
Content-type: text/html
<html><head><title>jagerman.com main page and image source</title></head>
<body>
<pre>
HTML
local $/;
print $in->escapeHTML(scalar <$fh>);
}
.....hm interesting. Why do you do it that way?
My attempt (its pretty quick reading into a string that way...more so than read()...which I thought was impressive
):
open FH, $0;
my $source = do { local $/; <FH> };
close FH;
do{}:
1 wallclock secs ( 0.19 usr + 0.21 sys = 0.40 CPU) @ 12500.00/s (n=5000)
read() is almost twice that.

if ($in->param('source')) {
open my $fh, "<", $0;
print <<HTML;
Content-type: text/html
<html><head><title>jagerman.com main page and image source</title></head>
<body>
<pre>
HTML
local $/;
print $in->escapeHTML(scalar <$fh>);
}
.....hm interesting. Why do you do it that way?
My attempt (its pretty quick reading into a string that way...more so than read()...which I thought was impressive

open FH, $0;
my $source = do { local $/; <FH> };
close FH;
do{}:
1 wallclock secs ( 0.19 usr + 0.21 sys = 0.40 CPU) @ 12500.00/s (n=5000)
read() is almost twice that.
Apr 3, 2002, 11:19 AM
Veteran (19537 posts)
Apr 3, 2002, 11:19 AM
Post #9 of 13
Views: 8718
I knew you'd say that.....
I wasn't making a criticizm of your code...obviously I know yours is gonna be good, I was just making a comment that I always thought read() was quick but it seems do{} was faster by quite a bit when I did a benchmark.
When I asked why you did it that way, I was asking because I knew there'd be a good reason and was wondering what it was
I wasn't making a criticizm of your code...obviously I know yours is gonna be good, I was just making a comment that I always thought read() was quick but it seems do{} was faster by quite a bit when I did a benchmark.
When I asked why you did it that way, I was asking because I knew there'd be a good reason and was wondering what it was

Apr 3, 2002, 11:30 AM
Staff (2198 posts)
Apr 3, 2002, 11:30 AM
Post #10 of 13
Views: 8734
I understand that - I'm just wondering what makes you think I'm using read(). My code is almost exactly the same as yours, except that I don't use a do { } block.
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 3, 2002, 11:35 AM
Veteran (19537 posts)
Apr 3, 2002, 11:35 AM
Post #11 of 13
Views: 8723
I don't/didn't think you are/were using read. It was just a mildy related piece of information I threw in there as it was something I'd encountered recently
I was however wondering what the reason was for using:
open $fh, ">", $0;
Wont:
open $fh, $0;
...work the same way?
This is all for the purpose of learning, not criticizm.

I was however wondering what the reason was for using:
open $fh, ">", $0;
Wont:
open $fh, $0;
...work the same way?
This is all for the purpose of learning, not criticizm.
Apr 3, 2002, 11:55 AM
Staff (2198 posts)
Apr 3, 2002, 11:55 AM
Post #12 of 13
Views: 8700
Yeah, but the three argument form of open is the "better" way to do it in 5.6.0 - plus the fact that because all GT code is 5.004_04 compatible, I don't get a chance to use it very often.
'open my $fh, ...' is not the better way (unless you plan on passing the filehandle) - again it's just me justifying the "use 5.6.0" at the top of the script
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

'open my $fh, ...' is not the better way (unless you plan on passing the filehandle) - again it's just me justifying the "use 5.6.0" at the top of the script

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 16, 2002, 5:50 AM
Veteran (19537 posts)
Apr 16, 2002, 5:50 AM
Post #13 of 13
Views: 8623
Ok, I thought I'd have a play too...how about this beauty :)
http://www.wiredon.net/...ff0200&c2=0000ff
You can play with the hex colors in the c1/c2 params
Refresh this post if you like :)
http://www.wiredon.net/...ff0200&c2=0000ff
You can play with the hex colors in the c1/c2 params

Refresh this post if you like :)