swampyankee has asked for the wisdom of the Perl Monks concerning the following question:
The world of Fortran has fsplit, which splits Fortran source into individual subroutines or functions (they're different in Fortran, which is neither here nor there).
My question is, then, is there a similar program available for Perl? I am not terribly concerned with anonymous subs, nor am I terribly concerned with cases like
Thanks in advance!{ my %private_hash; sub build_data { # do magical stuff on %private_hash } sub get_item { my $item = shift; if(exists($private_hash{$item})){ return $private_hash{$item}; } else{ return undef; } } }
grammar correction
Having the fairly typical combination of hubris and laziness of a Perl code walloper, I've decided to build my own solution.
Right now, my idea is to
{ sub one { # magical stuff here } sub two { # more magical stuff here } }
</update: 13 Sept 2006>
emc
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Program to split a Perl program into subs
by Fletch (Bishop) on Sep 06, 2006 at 18:13 UTC | |
by swampyankee (Parson) on Sep 07, 2006 at 16:47 UTC | |
|
Re: Program to split a Perl program into subs
by planetscape (Chancellor) on Sep 07, 2006 at 15:55 UTC | |
by swampyankee (Parson) on Sep 07, 2006 at 16:50 UTC |