in reply to calling perl subroutine from shell
This is not possible. The shell doesn't understand Perl. The only way you can do something like this is by invoking Perl as a oneliner for example:
perl -MMy::Package -e 'My::Package::clear_scr()'
(I've used My/Package.pm instead of a.pm)
If you need to pass parameters to your routine, I recommend that you pass them in via @ARGV:
perl -MMy::Package -e 'My::Package::clear_scr(@ARGV)' wipe
For more inspiration, see how the Perl installation package uses ExtUtils::Command, which exports such interesting functions as rm_f, mkdir and so on...
|
---|