What this code does is write the time to a file called ".plan" in your home directory. It does this every second and will overwrite the previous file. It will end only when the script cannot open the file for writing. Or, just like any other Unix process (and I know it's Unix cause of the usage of $ENV), it can be kill'ed from the commandline.while (1) { open(FIFO, ">$ENV{HOME}/.plan") or die "Couldn't open $ENV{HOME}/.plan for writing:$!\n"; print FIFO "The current time is", scalar(localtime), "\n"; close FIFO; sleep 1; }
Now, this isn't an example of FIFO or piping or anything of the sort. It's just a plain old write-to-file script. The 'pipe command' you refer to is probably a commandline thing in Unix.
Or, alternately, it could refer to opening a datastream which is the result of a command, along the lines of open(LS_PIPE, "ls -F|"); That allows you to read from LS_PIPE the results of 'ls -F', as if it was any other file or socket.
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
In reply to Re: Understanding Code
by dragonchild
in thread Understanding Code which uses pipe to bulk copy data
by dreman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |