in reply to executing "at" from perl

echo rm $session_file | at now + 1 minute

should work. This has nothing to do with how perl executes it, but everything with how the shell does it - if you type the contents of the system call in the shell you get the same behaviour.

You could also open a pipe, and write to it:

open my $at, '|-', 'at', qw(now + 1 minute) or die "can't open pipe to 'at': $!"; print $at "rm $session_file"; close $at or die $!;

Or you could use CGI::Session which handles session timeouts for you in a transparent way.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: executing "at" from perl
by rastoboy (Monk) on Nov 19, 2009 at 09:45 UTC
    By the way, it turned out the problem here was that the Apache user didn't have a shell. Put a shell in for him, and it worked great.

    That's not too cool, of course, so I'm still hunting other ways--possibly execution environment-related.