in reply to Exec script within script or import sub...? help plz
You sound like you want to build your own module(s). Simple Module Tutorial will show you how to do it.
package Menu; use strict; use Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = (); @EXPORT_OK = qw( show_menu ); sub show_menu { my ( $authenticated ) = @_; if ( $authenticated ) { # blah } else { # blah } } 1; # script #!/usr/bin/perl use lib '/see/tutorial/for/details'; use Menu qw( show_menu ); my $authen = check_authen(); show_menu( $authen );
cheers
tachyon
|
|---|