in reply to Re: Best practices with globals and subroutine arguments
in thread Best practices with globals and subroutine arguments

It really depends on the scope of the project. If it's a big project spread across multiple files with more than one developer working on it then I would avoid global. On the other hand, if it's a small to medium project in one (or maybe two) files, with only you working on it then I wouldn't hesitate to put some "my" variable below your "use" statements (i.e. variables in scope main::). Caveat: I mostly write sysadmin type scripts these days.

Elda Taluta; Sarks Sark; Ark Arks

  • Comment on Re^2: Best practices with globals and subroutine arguments