in reply to system command has problem with '>>'

If you call system with a list of arguments, no shell is involved. And it's the shell that interprets >>. Your way of calling system means ls is called, with >> as its third argument.

Use:

unless (system "ls -l /bin/bash >> $logfile 2>&1") { print "Nope!\n"; }
instead.

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.