http://www.perlmonks.org?node_id=652011


in reply to Running a Background Job

top won't run from the commandline with &, so it's not surprising that perl can't do it either.

Are you trying to gather system statistics? If you really want to use top, have you tried top's batch mode (-b option)?

Replies are listed 'Best First'.
Re^2: Running a Background Job
by perlfan (Vicar) on Nov 21, 2007 at 00:04 UTC
    Update: sorry, I thought you were saying 'perl' couldn't run in the background - didn't catch the issue with 'top' until after :-/

    What?! This is absolutely false. 'perl' can certainly run in the background!
    # perl -e 'print "hello\n"' > test.out 2>&1
    #cat test.out hello