in reply to when to use subroutine
For me, a subroutine is one of a number of solutions to help provide one of the following:
Subroutines aren't the only way to provide this, and Perl, like many languages, offers a number of ways to provide modularization and code reuse. Subroutines can be separated into a separate file, a file of related subroutines could be made into a Module and even turned into an reusable Object.
All the commenters make good points, but I think you'll just have to take a look at your code while keeping these ideas in mind and see what makes sense.
---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: when to use subroutine
by convenientstore (Pilgrim) on Oct 28, 2007 at 19:57 UTC | |
by chromatic (Archbishop) on Oct 28, 2007 at 21:03 UTC | |
by convenientstore (Pilgrim) on Oct 28, 2007 at 21:14 UTC |