So Bill Gates was tired of VisualBasic and now did some Perl, too bad; this script has a security flaw that allows everyone access to the company records! Fix the flaw for him!
#!/usr/bin/perl
chomp(my $User = `/usr/bin/whoami`);
print "Checking your access level...\n";
if ($User == 'BillGates')
{
print "Authorized! Here are the company records:\n" . `cat /home/BillGates/CompanyRecords.db`;
die("Closing...\n");
}
die("You're not authorized!\n");
OK, so there seems to be quite a lot of emphasis on the fact that it's Bill Gates. He's used to C++ (and VB) syntax, which gives us a clue. Is there something about Perl syntax that differs quite significantly from most languages?
Perhaps this will help:
***SPOILER***http://www.ozzu.com/programming-forum/perl-single-line-statement-blocks-t59123.html***SPOILER***
Essentially this should be simple for anyone who's experienced in Perl (which incidentally doesn't include myself :S) - hope I haven't given *too* much away


