Keep It Simple, Stupid | |
PerlMonks |
Re: routine as subroutine and on command lineby talexb (Chancellor) |
on Jan 18, 2002 at 19:49 UTC ( [id://139841]=note: print w/replies, xml ) | Need Help?? |
Your original command line was
The more usual way of forming that is That aside, if the routine you wanted to use was inside the existing script, you could name the routine on the command line then use to actually run it (I haven't tried this code -- this is just something to get you pointed in the right direction). This routine would then read input from the command line via the diamond operator while (<>), average the three numbers and output the average using print. If the code's in another module, you'll have to include the module name with the routine name, and either use it within your script or bring it in using the -M command line argument for Perl. This sounds like an awfully complicated way to do something fairly simple. What problem are you really trying to solve? --t. alex "Of course, you realize that this means war." -- Bugs Bunny.
In Section
Seekers of Perl Wisdom
|
|