What does your HTML page look like? The tutorial uses:
but your code reads:my $tainted_username = param( 'username' ) || '';
Does the HTML form set the variable username or the variable login? Those must match.my $username = param( 'login' ) || '';
If things get any worse, I'll have to ask you to stop helping me.