Okay sure, I just said that because it's strange to see all those print() and \n to output strings with embeddeded code. It just doesn't look nice visually (and probably not fun to debug if javascript gets big or halfway complicated).
One thing I don't understand in the example you linked though... Why did he use this double negation construction in the ValidLogin() sub:
return !!1 if $user eq $pass;
return !!0;
It seems redundant? Actually why even use any ! operators at all and just return the literal code you intend. I can sort of see doing this for exit() to the shell, because the shell exit codes are backwards from Perl. An exit code 0 means success, whereas inside Perl program boolean 0 is false. |