My tip is to never use $1 (and its other numbered siblings) in a subroutine that doesn't also set them up. Always pass them around as parameters and use the parameters in the subroutine only. My example shows that approach.
This is IMO the better approach because it avoids the problem that a subroutine itself might execute another match (maybe for debugging) and then will overwrite the value you wanted to use.
In reply to Re^5: displaying html file in the browser using perl
by Corion
in thread displaying html file in the browser using perl
by tsdesai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |