Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Simple Regex Question / Code Review

by choroba (Chancellor)
on Oct 11, 2012 at 10:44 UTC ( #998413=note: print w/replies, xml ) Need Help??


in reply to Simple Regex Question / Code Review

Do not use @ARGV in a subroutine. Use @_ and pass @ARGV as arguments. It makes the subroutine reusable.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Simple Regex Question / Code Review
by marquezc329 (Scribe) on Oct 12, 2012 at 00:10 UTC
    I think I went one-track minded while writing this and hadn't even thought about expanding this to a point where the subs would need to be reused. I can see why calling @ARGV from inside a subroutine is a horrible habit to develop. Thank you for helping me catch it early on in my learning journey.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998413]
help
Chatterbox?
[Discipulus]: yes. the central thing is the power. itself
[Discipulus]: s/some/new/
[choroba]: politics in the CB again?
[Discipulus]: was not philosopy choroba? ;=)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-04-29 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.