Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect07_process_filehandles
#
# quick example of setting up concurrent processes
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 10-5-04
#######################################################
open DATE, "date|"
or die "cannot pipe from date: $!";
open MAIL, "|mail st10\@humboldt.edu"
or die "cannot pipe to mail: $!";
my $now = <DATE>;
print MAIL "The time is $now"; # assumes $now ends in newline
close DATE;
close MAIL;
if ($?) # if closed with a non-zero exit status
{
die "mail: non-zero exit status of $?";
}
# end of lect07_process_filehandles