in reply to system command has problem with '>>'
Use:
instead.unless (system "ls -l /bin/bash >> $logfile 2>&1") { print "Nope!\n"; }
Further points: 1) there's no need to first create $logfile. The redirection will create it if necessary. 2) system returns 0 on success, following the Unix convention.
|
|---|