Try:
If you stick with your original code you'll need to change:
\[/cat]
to
\[/cat\]
Code:
$text=~ s,\[cat\]([\w/]+)\[/cat\],<a href="$1">$1</a>,g;If you stick with your original code you'll need to change:
\[/cat]
to
\[/cat\]