in reply to Perl : Convert a monolithic code to a function
sub mysub { my ( $var1, $var2 ) = @_; rest of your process } Call with: mysub($var1, $var2);
It's all in the learning perl book, it's probably easiest to start there.
EDIT: No ampersand before the subroutine's name!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl : Convert a monolithic code to a function
by user786 (Sexton) on Jun 29, 2014 at 00:58 UTC | |
by Anonymous Monk on Jun 29, 2014 at 01:09 UTC | |
|
Re^2: Perl : Convert a monolithic code to a function
by user786 (Sexton) on Jun 28, 2014 at 23:47 UTC |