Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: perl opening a new command line window

by Anonymous Monk
on Feb 15, 2005 at 06:17 UTC ( [id://431041]=note: print w/replies, xml ) Need Help??


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?)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-23 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found