As editors (and, apparently, browsers) can represent tabs differently, the best advice is probably to use spaces instead of tabs in your code (and many editors can do this conversion for you). Running a snippet through perltidy (as previously recommended) is probably also a very good idea.
Personally, I try to use 4-spaces for most code ('perltidy -l 123 -ple' unless I am trying to match someone else's formatting, or have another limitation), but I may have used 2-spaces for some code examples, and I try to avoid the question of how many spaces is "best" (as that argument is almost as long and as bad as those of editor choice).
Just my thoughts...