I tried it using the open2 function, but for some reason the readhandle is empty. maybe i'm using it wrong, since the readhandle is empty perl hangs when i try to read from it.
#!D:\perl\bin\
use IPC::Open2;
$flyprog = "d:\\perl\\fly\\fly.exe";
open2 (*BOY, *FLY, "$flyprog -q");
print FLY "new\n";
print FLY "size 256,256\n";
print FLY "fill 1,1,255,255,255\n";
print FLY "arc 128,128,180,180,0,360,0,0,0\n";
print FLY "fill 128,128,255,255,0\n";
print FLY "arc 128,128,120,120,0,180,0,0,0\n";
print FLY "arc 96,96,10,10,0,360,0,0,0\n";
print FLY "arc 160,96,10,10,0,360,0,0,0\n";
print FLY "fill 96,96,0,0,0\n";
print FLY "fill 160,96,0,0,0\n";
print FLY "string 0,0,0,10,240,giant,Hello, World!\n";
print FLY "string 0,0,0,100,10,medium,Don't worry, be Happy!\n";
close(FLY);
$output = <BOY>;
close(BOY);
print "Content-type: image/gif\n\n";
binmode(STDOUT);
print $output;
It
SHOULD work, but it doesn't for some reason. I must be doing something wrong.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.