The best way to use perl special variables is to create a lexical scope, localize the special variables and modify their behaviour, and when the lexical scope ends perl automatically restores them back to their previous settings.
Examples:
{
# localize special variables and assign different values
local $" = '|';
# do something with the modified special variables
print "@fields\n";
# when the lexical scope ends, perl automatically
# restores the special variables to their previous value
}
my $text = do { local $/; <DATA> }
You also need to be aware of the side effects of localized special variables because the effects are visible globally when calling other functions. As a rule, I always try to keep the code as simple as possible when localizing special variables, and try to avoid calling other subs, just to keep the effect as temporary and as local as possible.