in reply to perl opening a new command line window

how about a pipe?
#!/usr/bin/perl system 'mknod thepipe p' unless -p 'thepipe'; if ( fork ) { system q(xterm -e 'exec < thepipe; cat'); } else { open F, '>thepipe'; select F; $|++; for (1..30) { print "and a $_ woot!\n"; sleep 1; } } unlink 'thepipe';

Replies are listed 'Best First'.
Re^2: perl opening a new command line window
by wazoox (Prior) on Feb 15, 2005 at 14:28 UTC
    depending upon your OS (Linux, Solaris, IRIX ...), you may use mkfifo instead of mknod ... p.
    Keep in mind that fifos may lock, or exit quite easily (the reader can't read anymore after the writer stops). however it'll save some disk space :)
    BTW, would it be possible to create an anonymous pipe (on the IO::File model perhaps?)