#!/usr/bin/perl use strict; use warnings; my $id = '^uid=0'; my $testid = qx{/usr/bin/id}; if ( $testid !~ /$id/ ) { print "[-] access denied!"; exit; } else { print "[+] startin\' script"; #&foo(); }