in reply to give perl an email
This creates a new named pipe in your home directory named, appropriately enough, pipe. You can echo commands to it or attach it at the end of any pipe. It's not terribly exciting, but it's the basics of what I think you want to do.#!/usr/bin/perl -w use strict; my $FIFO = "$ENV{HOME}/pipe"; while (1) { unless (-p $FIFO) { unlink $FIFO; system('mknod', $FIFO, 'p') && die "Can't make pipe $FIFO: $!"; } open (FIFO, "$FIFO") || die "Can't open $FIFO: $!"; while (<FIFO>) { chomp; print "Command sent: $_\n"; } close FIFO; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: give perl an email
by BBQ (Curate) on Apr 18, 2000 at 05:22 UTC |