open my $ct_in, '-|', 'crontab -l' or die "Can't read crontab: $!"; my $crontab_contents = do { undef $/; <$ct_in> }; close $ct_in or die "Can't close crontab after read: $!"; open my $ct_out, '|-' 'crontab -' or die "Can't write new crontab: $!" print $ct_out $crontab_contents; print $ct_out "\n"; print $ct_out "*/5 * * * * /every/five/minutes\n"; close $ct_out or die "Can't close crontab after write: $!";