line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Term::Menus;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Menus.pm
|
4
|
|
|
|
|
|
|
#
|
5
|
|
|
|
|
|
|
# Copyright (C) 2000-2018
|
6
|
|
|
|
|
|
|
#
|
7
|
|
|
|
|
|
|
# by Brian M. Kelly.
|
8
|
|
|
|
|
|
|
#
|
9
|
|
|
|
|
|
|
# You may distribute under the terms of the GNU Affero General
|
10
|
|
|
|
|
|
|
# Public License, as specified in the LICENSE file.
|
11
|
|
|
|
|
|
|
# .
|
12
|
|
|
|
|
|
|
#
|
13
|
|
|
|
|
|
|
# http://www.fullautosoftware.net/
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## See user documentation at the end of this file. Search for =head
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '3.024';
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
1920
|
use 5.006;
|
|
1
|
|
|
|
|
9
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $menu_return_debug=0;
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
6
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
26
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
605
|
|
27
|
|
|
|
|
|
|
## Module export.
|
28
|
|
|
|
|
|
|
require Exporter;
|
29
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
30
|
1
|
|
|
|
|
6140
|
use vars qw(@EXPORT @EXPORT_OK %term_input %test %Dump %tosspass %b
|
31
|
|
|
|
|
|
|
%blanklines %parent_menu %Hosts %fa_code %canload %setsid
|
32
|
|
|
|
|
|
|
%VERSION %SetTerminalSize %SetControlChars %find_Selected
|
33
|
|
|
|
|
|
|
%clearpath %noclear %ReadKey %local_hostname %BEGIN %ISA
|
34
|
|
|
|
|
|
|
%editor %__ANON__ %data_dump_streamer %ReadMode %filechk
|
35
|
|
|
|
|
|
|
%fa_conf %transform_pmsi %termwidth %a %tm_menu %fa_code
|
36
|
|
|
|
|
|
|
%DumpVars %DumpLex %fullauto %delete_Selected %timeout
|
37
|
|
|
|
|
|
|
%pick %termheight %EXPORT_OK %ReadLine %fa_login %Menu
|
38
|
|
|
|
|
|
|
%fa_host %fa_menu %abs_path $fa_code %log %FH %AUTOLOAD
|
39
|
|
|
|
|
|
|
%get_all_hosts %hostname %GetSpeed %get_subs_from_menu
|
40
|
|
|
|
|
|
|
%passwd_file_loc %run_sub %GetTerminalSize %escape_quotes
|
41
|
|
|
|
|
|
|
%GetControlChars %numerically %rawInput %transform_sicm
|
42
|
|
|
|
|
|
|
%return_result $MenuMap %get_Menu_map_count %MenuMap %facall
|
43
|
|
|
|
|
|
|
%get_Menu_map %check_for_dupe_menus %EXPORT_FAIL %EXPORT
|
44
|
|
|
|
|
|
|
%import $new_user_flag %new_user_flag %DB_ENV_DSYNC_LOG
|
45
|
|
|
|
|
|
|
%DB_LOCK_PUT %DB_ST_IS_RECNO &DB_JOINENV %DB_LOCK_INHERIT
|
46
|
|
|
|
|
|
|
%DB_VERB_REP_SYSTEM %DB_VERSION_MISMATCH %DB_ENV_STANDALONE
|
47
|
|
|
|
|
|
|
%DB_LOG_VERIFY_ERR %DB_EVENT_REG_ALIVE %DB_XA_CREATE
|
48
|
|
|
|
|
|
|
%DB_VERB_REP_ELECT %DB_REP_JOIN_FAILURE %DB_DELIMITER
|
49
|
|
|
|
|
|
|
%DB_ENV_TXN %DB_ENV_RPCCLIENT %DB_MPOOL_CLEAN %DB_BTREEOLDVER
|
50
|
|
|
|
|
|
|
%DB_TEMPORARY %DB_REPMGR_ACKS_ONE %DB_OLD_VERSION %padwalker
|
51
|
|
|
|
|
|
|
%DB_TEST_POSTLOGMETA %DB_SET_RECNO %DB_SA_UNKNOWNKEY
|
52
|
|
|
|
|
|
|
%DB_MAX_RECORDS %DB_LOCK_CONFLICT %DB_REP_NEWMASTER %banner
|
53
|
|
|
|
|
|
|
%DB_LOCK_FREE_LOCKER %DB_POSITIONI %DB_VERB_FILEOPS
|
54
|
|
|
|
|
|
|
%DB_LOCK_DEFAULT %DB_REP_ANYWHERE %DB_REPMGR_CONF_2SITE_STRICT
|
55
|
|
|
|
|
|
|
%DB_AUTO_COMMIT %DB_TXN_NOWAIT %DB_STAT_LOCK_PARAMS %pw
|
56
|
|
|
|
|
|
|
%DB_REP_CONF_NOWAIT %DB_OK_RECNO %DB_SEQ_WRAPPED %test_hashref
|
57
|
|
|
|
|
|
|
%DB_MUTEX_LOCKED %DB_BEFORE %DB_EVENT_REP_MASTER_FAILURE
|
58
|
|
|
|
|
|
|
%DB_QUEUE %DB_TXN_LOCK_OPTIMISTIC %DB_REP_UNAVAIL %eval_error
|
59
|
|
|
|
|
|
|
%DB_FOREIGN_CASCADE %DB_NOOVERWRITE %DB_REP_CONF_AUTOINIT
|
60
|
|
|
|
|
|
|
%LOGREC_OP %DB_RUNRECOVERY %DB_UNREF %DB_REPMGR_ISPEER
|
61
|
|
|
|
|
|
|
%DB_VERIFY_BAD %DB_STAT_NOERROR %DB_ENV_LOG_AUTOREMOVE
|
62
|
|
|
|
|
|
|
%DB_REP_PAGELOCKED %DB_ST_RECNUM %DB_ORDERCHKONLY %DB_JOINENV
|
63
|
|
|
|
|
|
|
%DB_PRIORITY_VERY_LOW %DB_BTREEMAGIC %DB_LOCK_NOTHELD
|
64
|
|
|
|
|
|
|
%DB_QAMOLDVER %DB_TEST_POSTSYNC %DB_LOG_AUTO_REMOVE
|
65
|
|
|
|
|
|
|
%DB_BTREEVERSION %DB_GET_BOTHC %DB_ENV_RPCCLIENT_GIVEN
|
66
|
|
|
|
|
|
|
%DB_CREATE %DB_ARCH_DATA %DB_VERB_WAITSFOR %DB_INIT_REP
|
67
|
|
|
|
|
|
|
%DB_ENV_RECOVER_FATAL %DB_LOCK_GET_TIMEOUT %DB_STAT_CLEAR
|
68
|
|
|
|
|
|
|
%DB_REP_FULL_ELECTION %DB_VERB_REP_LEASE %DB_REGISTERED
|
69
|
|
|
|
|
|
|
%DB_APPLY_LOGREG %DB_REP_HANDLE_DEAD %DB_NOORDERCHK
|
70
|
|
|
|
|
|
|
%DB_HEAP_RID_SZ %DB_VERIFY_PARTITION %DB_THREADID_STRLEN
|
71
|
|
|
|
|
|
|
%DB_FIRST %DB_REPMGR_CONF_ELECTIONS %DB_SEQ_DEC
|
72
|
|
|
|
|
|
|
%DB_REP_CONF_INMEM %DB_MUTEX_ALLOCATED %DB_JOIN_ITEM
|
73
|
|
|
|
|
|
|
%DB_REP_CONF_NOAUTOINIT %DB_REPMGR_DISCONNECTED
|
74
|
|
|
|
|
|
|
%DB_DUPSORT %DB_TXN_POPENFILES %DB_LOCK_RW_N
|
75
|
|
|
|
|
|
|
%DB_TXN_NOT_DURABLE %DB_LOCK_NORUN %DB_REP_CONF_BULK
|
76
|
|
|
|
|
|
|
%DB_STAT_SUBSYSTEM %DB_USERCOPY_GETDATA %DB_LOCK_TRADE
|
77
|
|
|
|
|
|
|
%DB_COMMIT %DB_LOG_AUTOREMOVE %DB_MPOOL_TRY %DB_WRITEOPEN
|
78
|
|
|
|
|
|
|
%DB_STAT_LOCK_CONF %DB_CLIENT %DB_ENV_TIME_NOTGRANTED
|
79
|
|
|
|
|
|
|
%DB_REPFLAGS_MASK %DB_ENV_NOPANIC %DB_DUPCURSOR
|
80
|
|
|
|
|
|
|
%DB_ENV_APPINIT %DB_LOGFILEID_INVALID %DB_LOCKMAGIC
|
81
|
|
|
|
|
|
|
%DB_STAT_MEMP_HASH %DB_REP_FULL_ELECTION_TIMEOUT
|
82
|
|
|
|
|
|
|
%DB_TXN_CKP %DB_QAMVERSION %DB_EVENT_REP_CLIENT
|
83
|
|
|
|
|
|
|
%DB_NOCOPY %DB_TXNVERSION %LOGREC_PGLIST %DB_RENAMEMAGIC
|
84
|
|
|
|
|
|
|
%DB_REP_DUPMASTER %DB_OPEN_CALLED %DB_PAGE_NOTFOUND
|
85
|
|
|
|
|
|
|
%DB_VERB_DEADLOCK %DB_TXN_FORWARD_ROLL %DB_MULTIVERSION
|
86
|
|
|
|
|
|
|
%DB_LOCK_TIMEOUT %DB_JOIN_NOSORT %DB_NEEDSPLIT
|
87
|
|
|
|
|
|
|
%DB_SET_TXN_NOW %DB_TXN_OPENFILES %DB_TEST_POSTOPEN
|
88
|
|
|
|
|
|
|
%DB_RECORD_LOCK %DB_TEST_PREOPEN %DB_RPC_SERVERVERS
|
89
|
|
|
|
|
|
|
%DB_PRINTABLE %DB_VERB_REPLICATION %DB_MULTIPLE
|
90
|
|
|
|
|
|
|
%DB_COMPACT_FLAGS %DB_KEYEXIST %DB_PRIORITY_VERY_HIGH
|
91
|
|
|
|
|
|
|
%DB_NOERROR %DB_VERSION_RELEASE %DB_USE_ENVIRON
|
92
|
|
|
|
|
|
|
%DB_LOG_VERIFY_DBFILE %DB_TEST_ELECTSEND %DB_TXN_REDO
|
93
|
|
|
|
|
|
|
%DB_DURABLE_UNKNOWN %DB_ARCH_LOG %DB_QAMMAGIC
|
94
|
|
|
|
|
|
|
%DB_TIMEOUT %DB_VERB_REPMGR_MISC %DB_REP_PAGEDONE
|
95
|
|
|
|
|
|
|
%DB_LOCK_PUT_OBJ %DB_VERSION_FAMILY %DB_OK_BTREE
|
96
|
|
|
|
|
|
|
%DB_MAX_PAGES %DB_RDONLY %DB_CACHED_COUNTS
|
97
|
|
|
|
|
|
|
%DB_CKP_INTERNAL %DB_LOG_IN_MEMORY %DB_LOCK_GET
|
98
|
|
|
|
|
|
|
%DB_AGGRESSIVE %DB_STAT_LOCK_LOCKERS %DB_LOCKVERSION
|
99
|
|
|
|
|
|
|
%DB_PRIORITY_DEFAULT %DB_ENV_REP_MASTER %DB_FAILCHK
|
100
|
|
|
|
|
|
|
%DB_ENV_LOG_INMEMORY %DB_LOG_VERIFY_FORWARD
|
101
|
|
|
|
|
|
|
%DB_LOG_VERIFY_WARNING %DB_IGNORE_LEASE %DB_BACKUP_CLEAN
|
102
|
|
|
|
|
|
|
%DB_ENV_DBLOCAL %DB_GET_BOTH_RANGE %DB_FOREIGN_ABORT
|
103
|
|
|
|
|
|
|
%DB_REP_PERMANENT %DB_MPOOL_NOFILE %DB_LOG_BUFFER_FULL
|
104
|
|
|
|
|
|
|
%DB_ENV_MULTIVERSION %DB_RPC_SERVERPROG %DB_MPOOL_DIRTY
|
105
|
|
|
|
|
|
|
%DB_REP_NOBUFFER %DB_USE_ENVIRON_ROOT %DB_LOCK_CHECK
|
106
|
|
|
|
|
|
|
%DB_PREV_NODUP %DB_ST_TOPLEVEL %DB_PAGEYIELD %DB_EXCL
|
107
|
|
|
|
|
|
|
%DB_UPGRADE %DB_INORDER %DB_YIELDCPU %DB_ENV_DSYNC_DB
|
108
|
|
|
|
|
|
|
%DB_REP_ELECTION %DB_LOCK_RIW_N %DB_PAGE_LOCK
|
109
|
|
|
|
|
|
|
%DB_TXN_SYNC %DB_ST_DUPSORT %DB_LOG_SILENT_ERR
|
110
|
|
|
|
|
|
|
%DB_MPOOL_UNLINK %LOGREC_PGDBT %DB_DIRECT %DB_CHKSUM
|
111
|
|
|
|
|
|
|
%DB_ENV_OVERWRITE %DB_TXN_LOG_UNDO %DB_INIT_TXN
|
112
|
|
|
|
|
|
|
%DB_REP_CHECKPOINT_DELAY %DB_TEST_ELECTVOTE2
|
113
|
|
|
|
|
|
|
%DB_TEST_ELECTINIT %DB_EID_BROADCAST %DB_DELETED
|
114
|
|
|
|
|
|
|
%DB_REPMGR_ACKS_QUORUM %DB_ENV_LOCKDOWN
|
115
|
|
|
|
|
|
|
%DB_MUTEXDEBUG %DB_FREE_SPACE %DB_VERB_REGISTER
|
116
|
|
|
|
|
|
|
%DB_MPOOL_EDIT %DB_NORECURSE %DB_TEST_ELECTVOTE1
|
117
|
|
|
|
|
|
|
%DB_PRIORITY_LOW %DB_EVENT_REP_PERM_FAILED
|
118
|
|
|
|
|
|
|
%DB_SET_RANGE %DB_FORCE %LOGREC_LOCKS %DB_RENUMBER
|
119
|
|
|
|
|
|
|
%DB_REP_CONNECTION_RETRY %DB_MPOOL_PRIVATE
|
120
|
|
|
|
|
|
|
%DB_SEQUENCE_OLDVER %DB_LOG_CHKPNT %DB_FREELIST_ONLY
|
121
|
|
|
|
|
|
|
%DB_VERB_REP_MISC %DB_ENV_REGION_INIT %DB_RENUMBER
|
122
|
|
|
|
|
|
|
%DB_TXN_BACKWARD_ROLL %DB_LOCK_ABORT %DB_LOG_RESEND
|
123
|
|
|
|
|
|
|
%DB_ENV_REF_COUNTED %DB_DONOTINDEX %DB_NOMMAP
|
124
|
|
|
|
|
|
|
%DB_LOCK_UPGRADE %DB_REP_STARTUPDONE %DB_NEXT_DUP
|
125
|
|
|
|
|
|
|
%DB_ENV_OPEN_CALLED %DB_LOGVERSION_LATCHING
|
126
|
|
|
|
|
|
|
%DB_REP_ELECTION_RETRY %DB_VERB_REP_TEST
|
127
|
|
|
|
|
|
|
%DB_VERB_REP_MSGS %DB_debug_FLAG %DB_LOG_DSYNC
|
128
|
|
|
|
|
|
|
%DB_DSYNC_LOG %DB_GET_BOTH_LTE %DB_TXN_LOG_VERIFY
|
129
|
|
|
|
|
|
|
%DB_LOCK_RANDOM %DB_KEYEMPTY %DB_DIRECT_LOG
|
130
|
|
|
|
|
|
|
%DB_LOG_ZERO %DB_ENV_REP_LOGSONLY %DB_NOSYNC
|
131
|
|
|
|
|
|
|
%DB_LOG_VERIFY_INTERR %DB_SHALLOW_DUP %DB_SET
|
132
|
|
|
|
|
|
|
%DB_LOCK_SET_TIMEOUT %DB_UPDATE_SECONDARY
|
133
|
|
|
|
|
|
|
%DB_THREAD %DB_USERCOPY_SETDATA %DB_ASSOC_CREATE
|
134
|
|
|
|
|
|
|
%DB_MUTEXLOCKS %DB_LOGOLDVER %DB_TXN_LOCK_MASK
|
135
|
|
|
|
|
|
|
%DB_REGION_NAME %DB_NOLOCKING %DB_MPOOL_CREATE
|
136
|
|
|
|
|
|
|
%DB_INIT_MPOOL %DB_CURLSN %DB_LOG_PERM %DB_WRITELOCK
|
137
|
|
|
|
|
|
|
%DB_ENV_FAILCHK %DB_EVENT_REP_NEWMASTER
|
138
|
|
|
|
|
|
|
%DB_JAVA_CALLBACK %DB_OVERWRITE_DUP %DB_RPCCLIENT
|
139
|
|
|
|
|
|
|
%DB_ENV_CREATE %DB_ENV_THREAD %DB_PR_HEADERS
|
140
|
|
|
|
|
|
|
%DB_TXN_APPLY %DB_WRITELOCK %DB_VRFY_FLAGMASK
|
141
|
|
|
|
|
|
|
%DB_REP_LOCKOUT %DB_EVENT_NOT_HANDLED %DB_NEXT
|
142
|
|
|
|
|
|
|
%DB_TIME_NOTGRANTED %DB_LOG_INMEMORY %LOGREC_Done
|
143
|
|
|
|
|
|
|
%DB_LOG_DIRECT %DB_ALREADY_ABORTED %DB_INCOMPLETE
|
144
|
|
|
|
|
|
|
%DB_MUTEX_LOGICAL_LOCK %DB_TXN_LOG_MASK %DB_PREV
|
145
|
|
|
|
|
|
|
%DB_STAT_MEMP_NOERROR %DB_CL_WRITER %DB_DSYNC_DB
|
146
|
|
|
|
|
|
|
%DB_ENV_TXN_NOWAIT %DB_REGISTER %DB_ODDFILESIZE
|
147
|
|
|
|
|
|
|
%DB_FAST_STAT %DB_LOG_NOT_DURABLE %DB_CDB_ALLDB
|
148
|
|
|
|
|
|
|
%DB_LOG_NOCOPY %DB_INIT_CDB %DB_RECORDCOUNT
|
149
|
|
|
|
|
|
|
%LOGREC_DATA %DB_NEXT_DUP %DB_SET_LOCK_TIMEOUT
|
150
|
|
|
|
|
|
|
%DB_PERMANENT %DB_TXN_LOG_REDO %DB_CHECKPOINT
|
151
|
|
|
|
|
|
|
%DB_ENV_CDB_ALLDB %DB_EVENT_REP_JOIN_FAILURE
|
152
|
|
|
|
|
|
|
%DB_LOG_VERIFY_VERBOSE %DB_LOGCHKSUM %DB_BTREE
|
153
|
|
|
|
|
|
|
%DB_LOG_VERIFY_PARTIAL %DB_KEYFIRST %DB_EXTENT
|
154
|
|
|
|
|
|
|
%DB_TXN_SNAPSHOT %DB_REP_ISPERM %DB_NOPANIC
|
155
|
|
|
|
|
|
|
%DB_LOCK_UPGRADE_WRITE %DB_FOREIGN_CONFLICT
|
156
|
|
|
|
|
|
|
%DB_MPOOL_NEW %DB_TXN_UNDO %DB_REGION_MAGIC
|
157
|
|
|
|
|
|
|
%DB_PRIORITY_HIGH %DB_ENV_DIRECT_DB %LOGREC_HDR
|
158
|
|
|
|
|
|
|
%DB_RECOVER_FATAL %DB_LOCK_REMOVE %DB_LOGVERSION
|
159
|
|
|
|
|
|
|
%DB_GID_SIZE %DB_PRIORITY_UNCHANGED %LOGREC_HDR
|
160
|
|
|
|
|
|
|
%DB_LOGC_BUF_SIZE %DB_REVSPLITOFF %DB_LOCK_NOWAIT
|
161
|
|
|
|
|
|
|
%DB_SEQUENTIAL %DB_REGION_ANON %DB_ENV_NOMMAP
|
162
|
|
|
|
|
|
|
%DB_SEQUENCE_VERSION %DB_SYSTEM_MEM %DB_AFTER
|
163
|
|
|
|
|
|
|
%DB_REP_ELECTION_TIMEOUT %DB_STAT_ALL %DB_APPEND
|
164
|
|
|
|
|
|
|
%DB_HASHVERSION %DB_LOCK_OLDEST %DB_XIDDATASIZE
|
165
|
|
|
|
|
|
|
%DB_VERIFY_FATAL %DB_ASSOC_IMMUTABLE_KEY
|
166
|
|
|
|
|
|
|
%DB_SEQ_RANGE_SET %DB_REGION_INIT %DB_RECOVER
|
167
|
|
|
|
|
|
|
%DB_LOCK_MAXLOCKS %DB_REP_CONF_DELAYCLIENT
|
168
|
|
|
|
|
|
|
%DB_EVENT_REP_ELECTION_FAILED %DB_ENV_YIELDCPU
|
169
|
|
|
|
|
|
|
%DB_OK_QUEUE %DB_MULTIPLE_KEY %DB_DIRECT_DB
|
170
|
|
|
|
|
|
|
%DB_LOCK_DUMP %DB_TEST_PREDESTROY %DB_ENCRYPT
|
171
|
|
|
|
|
|
|
%DB_EID_INVALID %DB_LOCK_MINLOCKS %LOGREC_TIME
|
172
|
|
|
|
|
|
|
%LOGREC_DBOP %DB_ENV_REP_CLIENT %DB_SPARE_FLAG
|
173
|
|
|
|
|
|
|
%DB_TXNMAGIC %DB_LOCK_NOTEXIST %DB_REP_REREQUEST
|
174
|
|
|
|
|
|
|
%DB_VERB_REP_SYNC %DB_NO_AUTO_COMMIT %DB_PR_PAGE
|
175
|
|
|
|
|
|
|
%DB_EVENT_REP_DUPMASTER %DB_GET_BOTH %DB_HASH
|
176
|
|
|
|
|
|
|
%DB_TXN_BULK %DB_TEST_POSTLOG %DB_REP_LOGSONLY
|
177
|
|
|
|
|
|
|
%DB_ENV_TXN_NOT_DURABLE %DB_POSITION %DB_RECNUM
|
178
|
|
|
|
|
|
|
%DB_LOCKDOWN %DB_LOG_NO_DATA %DB_ST_DUPSET
|
179
|
|
|
|
|
|
|
%DB_REP_HEARTBEAT_SEND %DB_SET_TXN_TIMEOUT
|
180
|
|
|
|
|
|
|
%DB_REPMGR_ACKS_ALL_PEERS %DB_TEST_ELECTWAIT2
|
181
|
|
|
|
|
|
|
%DB_ENV_DATABASE_LOCKING %DB_GET_RECNO
|
182
|
|
|
|
|
|
|
%DB_ARCH_REMOVE %DB_LOCK_RECORD %DB_EVENT_PANIC
|
183
|
|
|
|
|
|
|
%DB_LOG_LOCKED %DB_LOCK_NOTGRANTED %DB_RMW
|
184
|
|
|
|
|
|
|
%DB_ENV_AUTO_COMMIT %DB_NEXT_NODUP %DB_SEQ_WRAP
|
185
|
|
|
|
|
|
|
%DB_LOCK_PUT_READ %DB_REP_ACK_TIMEOUT
|
186
|
|
|
|
|
|
|
%DB_VERB_CHKPOINT %DB_LOG_DISK %DB_HASHMAGIC
|
187
|
|
|
|
|
|
|
%DB_HASHOLDVER %DB_OK_HASH %DB_REP_NEWSITE
|
188
|
|
|
|
|
|
|
%DB_TEST_POSTRENAME %DB_ST_RELEN %DB_TXN_LOCK
|
189
|
|
|
|
|
|
|
%DB_NOSERVER_ID %DB_UNKNOWN %DB_ENV_LOGGING
|
190
|
|
|
|
|
|
|
%DB_EVENT_NO_SUCH_EVENT %DB_NODUPDATA
|
191
|
|
|
|
|
|
|
%DB_BUFFER_SMALL %DB_APP_INIT %DB_TXN_FAMILY
|
192
|
|
|
|
|
|
|
%DB_ENV_SYSTEM_MEM %DB_READ_UNCOMMITTED
|
193
|
|
|
|
|
|
|
%DB_MPOOL_DISCARD %DB_SNAPSHOT %DB_NOSERVER
|
194
|
|
|
|
|
|
|
%DB_REPMGR_CONNECTED %DB_VERSION_FULL_STRING
|
195
|
|
|
|
|
|
|
%DB_SWAPBYTES %DB_REP_MASTER %DB_SECONDARY_BAD
|
196
|
|
|
|
|
|
|
%DB_TXN_LOCK_2PL %DB_TXN_LOG_UNDOREDO
|
197
|
|
|
|
|
|
|
%DB_LOG_WRNOSYNC %DB_ENV_FATAL %DB_TRUNCATE
|
198
|
|
|
|
|
|
|
%DB_LOCK_PUT_ALL %DB_MUTEX_SELF_BLOCK
|
199
|
|
|
|
|
|
|
%DB_CURSOR_BULK %DB_VERSION_PATCH %DB_ENV_CDB
|
200
|
|
|
|
|
|
|
%DB_DATABASE_LOCK %DB_HANDLE_LOCK %DB_SET_LTE
|
201
|
|
|
|
|
|
|
%DB_LOG_VERIFY_BAD %DB_OPFLAGS_MASK %DB_PAD
|
202
|
|
|
|
|
|
|
%DB_SET_REG_TIMEOUT %DB_REP_BULKOVF
|
203
|
|
|
|
|
|
|
%DB_REP_CONF_LEASE %DB_INIT_LOCK %DB_NOTFOUND
|
204
|
|
|
|
|
|
|
%DB_TXN_PRINT %DB_INIT_LOG %DB_TEST_SUBDB_LOCKS
|
205
|
|
|
|
|
|
|
%DB_ARCH_ABS %DB_ST_DUPOK %DB_REP_IGNORE
|
206
|
|
|
|
|
|
|
%DB_REPMGR_PEER %DB_REPMGR_ACKS_NONE %LOGREC_DBT
|
207
|
|
|
|
|
|
|
%DB_WRNOSYNC %DB_VERSION_STRING %DB_ST_OVFL_LEAF
|
208
|
|
|
|
|
|
|
%DB_ENV_TXN_NOSYNC %DB_SA_SKIPFIRSTKEY %DB_FLUSH
|
209
|
|
|
|
|
|
|
%DB_REP_EGENCHG %DB_MPOOL_NEW_GROUP %DB_LOGMAGIC
|
210
|
|
|
|
|
|
|
%LOGREC_PGDDBT %DB_MPOOL_FREE %DB_READ_COMMITTED
|
211
|
|
|
|
|
|
|
%DB_ENV_NOLOCKING %DB_EVENT_REG_PANIC
|
212
|
|
|
|
|
|
|
%DB_TXN_NOSYNC %DB_CONSUME_WAIT %DB_CURRENT
|
213
|
|
|
|
|
|
|
%DB_REPMGR_ACKS_ALL %DB_REP_NOTPERM %DB_DEGREE_2
|
214
|
|
|
|
|
|
|
%LOGREC_POINTER %DB_REP_OUTDATED %DB_RDWRMASTER
|
215
|
|
|
|
|
|
|
%DB_ENV_USER_ALLOC %DB_CURSOR_TRANSIENT
|
216
|
|
|
|
|
|
|
%DB_FOREIGN_NULLIFY %DB_LOCK_SWITCH %DB_VERIFY
|
217
|
|
|
|
|
|
|
%DB_EVENT_REP_MASTER %DB_DIRTY_READ %LOGREC_DB
|
218
|
|
|
|
|
|
|
%DB_MPOOL_LAST %DB_CONSUME %DB_KEYLAST
|
219
|
|
|
|
|
|
|
%DB_LOCK_MINWRITE %DB_REP_HEARTBEAT_MONITOR
|
220
|
|
|
|
|
|
|
%DB_LOG_COMMIT %DB_VERB_RECOVERY %DB_TXN_WAIT
|
221
|
|
|
|
|
|
|
%DB_EVENT_REP_ELECTED %DB_FILE_ID_LEN
|
222
|
|
|
|
|
|
|
%DB_TEST_ELECTWAIT1 %DB_LOCK_EXPIRE %DB_LAST
|
223
|
|
|
|
|
|
|
%DB_DATABASE_LOCKING %DB_FCNTL_LOCKING
|
224
|
|
|
|
|
|
|
%DB_TXN_WRITE_NOSYNC %DB_ENV_NO_OUTPUT_SET
|
225
|
|
|
|
|
|
|
%DB_user_BEGIN %DB_EVENT_WRITE_FAILED
|
226
|
|
|
|
|
|
|
%DB_MPOOL_NOLOCK %DB_VERSION_MINOR %transform_mbii
|
227
|
|
|
|
|
|
|
%DB_REP_CREATE %DB_REP_DEFAULT_PRIORITY
|
228
|
|
|
|
|
|
|
%DB_REP_LEASE_TIMEOUT %DB_REP_CLIENT
|
229
|
|
|
|
|
|
|
%DB_TXN_LOCK_OPTIMIST %DB_LOCK_DEADLOCK
|
230
|
|
|
|
|
|
|
%DB_ENCRYPT_AES %DB_LOCK_MAXWRITE %DB_GETREC
|
231
|
|
|
|
|
|
|
%DB_MUTEX_THREAD %DB_ENV_PRIVATE %DB_PREV_DUP
|
232
|
|
|
|
|
|
|
%DB_TEST_PRERENAME %DB_PR_RECOVERYTEST
|
233
|
|
|
|
|
|
|
%DB_MPOOL_EXTENT %DB_FILEOPEN %DB_SALVAGE
|
234
|
|
|
|
|
|
|
%DB_CXX_NO_EXCEPTIONS %DB_LOCK_YOUNGEST
|
235
|
|
|
|
|
|
|
%DB_VERB_REPMGR_CONNFAIL %DB_REP_LOGREADY
|
236
|
|
|
|
|
|
|
%DB_ENV_TXN_WRITE_NOSYNC %DB_ENV_LOCKING
|
237
|
|
|
|
|
|
|
%DB_IMMUTABLE_KEY %DB_MUTEX_SHARED %DB_HEAP
|
238
|
|
|
|
|
|
|
%DB_CHKSUM_SHA1 %DB_ENV_TXN_SNAPSHOT
|
239
|
|
|
|
|
|
|
%DB_VERSION_MAJOR %DB_ENV_HOTBACKUP %transform_mbio
|
240
|
|
|
|
|
|
|
%DB_TEST_POSTDESTROY %DB_FORCESYNC %DB_DUP
|
241
|
|
|
|
|
|
|
%DB_NOSERVER_HOME %DB_SEQ_INC %DB_FIXEDLEN
|
242
|
|
|
|
|
|
|
%DB_LOG_VERIFY_CAF %DB_TXN_TOKEN_SIZE
|
243
|
|
|
|
|
|
|
%DB_VERB_FILEOPS_ALL %LOGREC_ARG %DB_RECNO
|
244
|
|
|
|
|
|
|
%DB_REP_LEASE_EXPIRED %DB_HOTBACKUP_IN_PROGRESS
|
245
|
|
|
|
|
|
|
%DB_ENV_DIRECT_LOG %DB_REPMGR_ACKS_ALL_AVAILABLE
|
246
|
|
|
|
|
|
|
%DB_WRITECURSOR %DB_STAT_LOCK_OBJECTS
|
247
|
|
|
|
|
|
|
%DB_TEST_RECYCLE %DB_TXN_ABORT %DB_PRIVATE
|
248
|
|
|
|
|
|
|
%DB_PANIC_ENVIRONMENT %DB_OVERWRITE
|
249
|
|
|
|
|
|
|
%DB_EVENT_REP_STARTUPDONE %DB_SURPRISE_KID
|
250
|
|
|
|
|
|
|
%DB_REPMGR_ACKS_ONE_PEER %DB_REP_HOLDELECTION
|
251
|
|
|
|
|
|
|
%DB_EVENT_REP_SITE_ADDED %DB_EVENT_REP_INIT_DONE
|
252
|
|
|
|
|
|
|
%DB_MEM_THREAD %DB_EVENT_REP_CONNECT_ESTD
|
253
|
|
|
|
|
|
|
%DB_ENV_NOFLUSH %DB_EVENT_REP_LOCAL_SITE_REMOVED
|
254
|
|
|
|
|
|
|
%DB_LEGACY %DB_GROUP_CREATOR %DB_EID_MASTER
|
255
|
|
|
|
|
|
|
%DB_HEAPVERSION %DB_OK_HEAP %DB_MEM_TRANSACTION
|
256
|
|
|
|
|
|
|
%DB_EVENT_REP_CONNECT_TRY_FAILED %DB_NOFLUSH
|
257
|
|
|
|
|
|
|
%DB_STAT_SUMMARY %DB_MEM_TRANSACTION %CARP_NOT
|
258
|
|
|
|
|
|
|
%DB_HEAPMAGIC %DB_REPMGR_NEED_RESPONSE
|
259
|
|
|
|
|
|
|
%DB_MEM_LOCKOBJECT %DB_MEM_LOGID %DB_MEM_LOCKER
|
260
|
|
|
|
|
|
|
%DB_INTERNAL_DB %DB_MEM_LOCK %DB_HEAPOLDVER
|
261
|
|
|
|
|
|
|
%DB_FAILCHK_ISALIVE %DB_BOOTSTRAP_HELPER
|
262
|
|
|
|
|
|
|
%DB_HEAP_FULL %DB_STAT_ALLOC %DB_LOCAL_SITE
|
263
|
|
|
|
|
|
|
%DB_NO_CHECKPOINT %DB_EVENT_REP_SITE_REMOVED
|
264
|
|
|
|
|
|
|
%DB_EVENT_REP_CONNECT_BROKEN %DB_INIT_MUTEX
|
265
|
|
|
|
|
|
|
%DB_VERB_BACKUP %DB_INTERNAL_PERSISTENT_DB
|
266
|
|
|
|
|
|
|
%DB_REP_CONF_AUTOROLLBACK %DB2_AM_INTEXCL
|
267
|
|
|
|
|
|
|
%DB2_AM_EXCL %DB_INTERNAL_TEMPORARY_DB
|
268
|
|
|
|
|
|
|
%DB_BACKUP_UPDATE %DB2_AM_NOWAIT %DB_BACKUP_SIZE
|
269
|
|
|
|
|
|
|
%DB_BACKUP_FILES %DB_BACKUP_WRITE_DIRECT
|
270
|
|
|
|
|
|
|
%DB_EVENT_REP_WOULD_ROLLBACK &DB_BACKUP_CLEAN
|
271
|
|
|
|
|
|
|
%DB_BACKUP_READ_COUNT %DB_BACKUP_SINGLE_DIR
|
272
|
|
|
|
|
|
|
%DB_LOCK_IGNORE_REC %DB_BACKUP_READ_SLEEP
|
273
|
|
|
|
|
|
|
%DB_BACKUP_NO_LOGS %DB_REP_WOULDROLLBACK
|
274
|
|
|
|
|
|
|
%DB_STREAM_WRITE %DB_REP_CONF_ELECT_LOGLENGTH
|
275
|
|
|
|
|
|
|
%list_module %DB_STREAM_READ %DB_LOG_BLOB
|
276
|
|
|
|
|
|
|
%DB_STREAM_SYNC_WRITE %DB_CHKSUM_FAIL
|
277
|
|
|
|
|
|
|
%DB_EVENT_REP_AUTOTAKEOVER_FAILED %DB_VERB_MVCC
|
278
|
|
|
|
|
|
|
%DB_REPMGR_ISVIEW %DB_MUTEX_PROCESS_ONLY
|
279
|
|
|
|
|
|
|
%transform_mbir %DB_EVENT_REP_INQUEUE_FULL
|
280
|
|
|
|
|
|
|
%DB_MUTEX_DESCRIBE_STRLEN %DB_FAILURE_SYMPTOM_SIZE
|
281
|
|
|
|
|
|
|
%DB_LOG_NOSYNC %DB_REPMGR_CONF_PREFMAS_CLIENT
|
282
|
|
|
|
|
|
|
%DB_SET_MUTEX_FAILCHK_TIMEOUT %DB_INTERNAL_BLOB_DB
|
283
|
|
|
|
|
|
|
%DB_EVENT_FAILCHK_PANIC %DB_EXIT_FAILCHK
|
284
|
|
|
|
|
|
|
%LOGREC_LONGARG %DB_EVENT_MUTEX_DIED
|
285
|
|
|
|
|
|
|
%DB_MUTEX_OWNER_DEAD %DB_STREAM_WRITE
|
286
|
|
|
|
|
|
|
%DB_REPMGR_CONF_PREFMAS_MASTER %DB_EXIT_FILE_EXISTS
|
287
|
|
|
|
|
|
|
%DB_MEM_EXTFILE_DATABASE %DB_EVENT_REP_AUTOTAKEOVER
|
288
|
|
|
|
|
|
|
%DB_FORCESYNCENV %SELECT %DB_REPMGR_CONF_FORWARD_WRITES
|
289
|
|
|
|
|
|
|
%DB_REPMGR_CONF_ENABLE_EPOLL %DB2_AM_MPOOL_OPENED
|
290
|
|
|
|
|
|
|
%DB_REP_WRITE_FORWARD_TIMEOUT %DB_META_CHKSUM_FAIL
|
291
|
|
|
|
|
|
|
%DB_MEM_REP_SITE %DB_LOG_EXT_FILE %DB_OFF_T_MAX
|
292
|
|
|
|
|
|
|
%DB_REPMGR_ISELECTABLE %DB_SLICE_CORRUPT
|
293
|
|
|
|
|
|
|
%DB_VERB_SLICE %DB_REPMGR_CONF_DISABLE_POLL
|
294
|
|
|
|
|
|
|
%DB_TXN_DISPATCH %DB_CONVERT %EPOLL %POLL
|
295
|
|
|
|
|
|
|
%DB_SYSTEM_MEM_MISSING %DB_REP_INELECT %DB_SLICED
|
296
|
|
|
|
|
|
|
%DB_REGION_MAGIC_RECOVER %DB_NOINTMP %HAVE_EPOLL
|
297
|
1
|
|
|
1
|
|
7
|
%DB_MEM_DATABASE %DB_MEM_DATABASE_LENGTH);
|
|
1
|
|
|
|
|
2
|
|
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
@EXPORT = qw(pick Menu get_Menu_map);
|
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
#####################################################################
|
302
|
|
|
|
|
|
|
#### ###
|
303
|
|
|
|
|
|
|
#### DEFAULT MODULE OF Term::Menus $tm_menu IS: ###
|
304
|
|
|
|
|
|
|
#### ###
|
305
|
|
|
|
|
|
|
#### ==> *NONE* <== If you want a different ###
|
306
|
|
|
|
|
|
|
#### ###
|
307
|
|
|
|
|
|
|
#### module to be the default, change $tm_menu variable below or ###
|
308
|
|
|
|
|
|
|
#### set the $tm_menu variable in the BEGIN { } block ###
|
309
|
|
|
|
|
|
|
#### of the top level script invoking &Menu(). (Advised) ###
|
310
|
|
|
|
|
|
|
#### ###
|
311
|
|
|
|
|
|
|
#####################################################################
|
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
our $tm_menu='';
|
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# Example: our $tm_menu='my_menus.pm'; ###
|
316
|
|
|
|
|
|
|
###
|
317
|
|
|
|
|
|
|
# See documentation for more info ###
|
318
|
|
|
|
|
|
|
###
|
319
|
|
|
|
|
|
|
#################################################################
|
320
|
|
|
|
|
|
|
|
321
|
1
|
|
|
1
|
|
9
|
use Config ();
|
|
1
|
|
|
|
|
30
|
|
|
1
|
|
|
|
|
35
|
|
322
|
1
|
|
|
1
|
|
6
|
use Cwd 'abs_path';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
323
|
1
|
|
|
1
|
|
606
|
use Capture::Tiny;
|
|
1
|
|
|
|
|
28733
|
|
|
1
|
|
|
|
|
239
|
|
324
|
|
|
|
|
|
|
BEGIN {
|
325
|
|
|
|
|
|
|
our $filechk = sub {
|
326
|
|
|
|
|
|
|
package filechk;
|
327
|
0
|
|
|
|
|
0
|
eval { die };
|
|
0
|
|
|
|
|
0
|
|
328
|
0
|
|
|
|
|
0
|
my $path=$@;
|
329
|
0
|
|
|
|
|
0
|
$path=~s/Died at (.*)Term\/Menus.pm.*$/$1/s;
|
330
|
0
|
|
|
|
|
0
|
chomp($path);
|
331
|
0
|
0
|
|
|
|
0
|
return 0 unless -e "$path$_[0]";
|
332
|
0
|
|
|
|
|
0
|
return 1;
|
333
|
1
|
|
|
1
|
|
6
|
};
|
334
|
|
|
|
|
|
|
our $canload = sub {
|
335
|
|
|
|
|
|
|
package canloadone;
|
336
|
0
|
|
|
|
|
0
|
eval { die };
|
|
0
|
|
|
|
|
0
|
|
337
|
0
|
|
|
|
|
0
|
my $path=$@;
|
338
|
0
|
|
|
|
|
0
|
$path=~s/Died at (.*)Term\/Menus.pm.*$/$1/s;
|
339
|
0
|
|
|
|
|
0
|
chomp($path);
|
340
|
0
|
0
|
|
|
|
0
|
return 0 unless -e "$path$_[0]";
|
341
|
0
|
|
|
|
|
0
|
eval { require $_[0] };
|
|
0
|
|
|
|
|
0
|
|
342
|
0
|
0
|
|
|
|
0
|
unless ($@) {
|
343
|
0
|
|
|
|
|
0
|
return 1;
|
344
|
|
|
|
|
|
|
} else {
|
345
|
0
|
|
|
|
|
0
|
return 0;
|
346
|
|
|
|
|
|
|
}
|
347
|
1
|
|
|
|
|
673
|
};
|
348
|
|
|
|
|
|
|
}
|
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
unless (defined caller(2) && -1
|
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
### NOTE: $tm_menu will *NOT* be used when Term::Menus
|
353
|
|
|
|
|
|
|
### is used with Net::FullAuto. Set $fa_menu (below)
|
354
|
|
|
|
|
|
|
### or $main::fa_menu when using Net::FullAuto.
|
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
if ($tm_menu) {
|
357
|
|
|
|
|
|
|
unless ($Term::Menus::canload->($tm_menu)) {
|
358
|
|
|
|
|
|
|
my $die="\n FATAL ERROR: The variable \$tm_menu is defined,\n".
|
359
|
|
|
|
|
|
|
" in the module file:\n\n".
|
360
|
|
|
|
|
|
|
" $INC{'Term/Menus.pm'}\n\n".
|
361
|
|
|
|
|
|
|
" but the value: $tm_menu does not\n".
|
362
|
|
|
|
|
|
|
" reference a module that can be loaded";
|
363
|
|
|
|
|
|
|
die $die;
|
364
|
|
|
|
|
|
|
}
|
365
|
|
|
|
|
|
|
} elsif (defined $main::tm_menu) {
|
366
|
|
|
|
|
|
|
if ($Term::Menus::canload->($main::tm_menu)) {
|
367
|
|
|
|
|
|
|
$tm_menu=$main::tm_menu;
|
368
|
|
|
|
|
|
|
} else {
|
369
|
|
|
|
|
|
|
my $die="\n FATAL ERROR: The variable \$tm_menu is defined,\n".
|
370
|
|
|
|
|
|
|
" but the value: $tm_menu does not\n".
|
371
|
|
|
|
|
|
|
" reference a module that can be loaded";
|
372
|
|
|
|
|
|
|
die $die;
|
373
|
|
|
|
|
|
|
}
|
374
|
|
|
|
|
|
|
}
|
375
|
|
|
|
|
|
|
if ($tm_menu) {
|
376
|
|
|
|
|
|
|
require $tm_menu;
|
377
|
|
|
|
|
|
|
my $tm=substr($tm_menu,
|
378
|
|
|
|
|
|
|
(rindex $tm_menu,'/')+1,-3);
|
379
|
|
|
|
|
|
|
import $tm;
|
380
|
|
|
|
|
|
|
}
|
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
}
|
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
##############################################################
|
385
|
|
|
|
|
|
|
##############################################################
|
386
|
|
|
|
|
|
|
#
|
387
|
|
|
|
|
|
|
# THIS BLOCK MARKED BY TWO LINES OF POUND SYMBOLS IS FOR
|
388
|
|
|
|
|
|
|
# SETTINGS NEEDED BY THE MODULE Net::FullAuto. IF YOU ARE
|
389
|
|
|
|
|
|
|
# USING Term::Menus OUTSIDE OF Net::FullAuto, YOU CAN
|
390
|
|
|
|
|
|
|
# SAFELY IGNORE THIS SECTION. (That's 'ignore' - not 'remove')
|
391
|
|
|
|
|
|
|
#
|
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
our $data_dump_streamer=0;
|
394
|
|
|
|
|
|
|
eval { require Data::Dump::Streamer };
|
395
|
|
|
|
|
|
|
unless ($@) {
|
396
|
|
|
|
|
|
|
$data_dump_streamer=1;
|
397
|
|
|
|
|
|
|
import Data::Dump::Streamer;
|
398
|
|
|
|
|
|
|
}
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
#our $io_interactive=0;
|
401
|
|
|
|
|
|
|
#eval { require IO::Interactive };
|
402
|
|
|
|
|
|
|
#unless ($@) {
|
403
|
|
|
|
|
|
|
# $io_interactive=1;
|
404
|
|
|
|
|
|
|
# import IO::Interactive;
|
405
|
|
|
|
|
|
|
#}
|
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
BEGIN { ## Begin Net::FullAuto Settings
|
408
|
|
|
|
|
|
|
|
409
|
1
|
|
|
1
|
|
4
|
eval { require Data::Dump::Streamer };
|
|
1
|
|
|
|
|
932
|
|
410
|
1
|
50
|
|
|
|
54252
|
unless ($@) {
|
411
|
1
|
|
|
|
|
3
|
$data_dump_streamer=1;
|
412
|
1
|
|
|
|
|
7
|
import Data::Dump::Streamer;
|
413
|
|
|
|
|
|
|
}
|
414
|
1
|
50
|
|
|
|
112
|
unless (exists $INC{'Term/Menus.pm'}) {
|
415
|
0
|
|
|
|
|
0
|
foreach my $fpath (@INC) {
|
416
|
0
|
|
|
|
|
0
|
my $f=$fpath;
|
417
|
0
|
0
|
|
|
|
0
|
if (-e $f.'/Term/Menus.pm') {
|
418
|
0
|
|
|
|
|
0
|
$INC{'Term/Menus.pm'}=$f.'/Term/Menus.pm';
|
419
|
0
|
|
|
|
|
0
|
last;
|
420
|
|
|
|
|
|
|
}
|
421
|
|
|
|
|
|
|
}
|
422
|
|
|
|
|
|
|
}
|
423
|
1
|
|
|
|
|
3
|
my $vlin=__LINE__;
|
424
|
|
|
|
|
|
|
#####################################################################
|
425
|
|
|
|
|
|
|
#### ###
|
426
|
|
|
|
|
|
|
#### DEFAULT MODULE OF Net::FullAuto $fa_code IS: ###
|
427
|
|
|
|
|
|
|
#### ###
|
428
|
|
|
|
|
|
|
#### ==> Distro/fa_code_demo.pm <== If you want a different ###
|
429
|
|
|
|
|
|
|
#### ###
|
430
|
|
|
|
|
|
|
#### module to be the default, change $fa_code variable below or ###
|
431
|
|
|
|
|
|
|
#### set the $fa_code variable in the BEGIN { } block ###
|
432
|
|
|
|
|
|
|
#### of the top level script invoking Net::FullAuto. (Advised) ###
|
433
|
|
|
|
|
|
|
#### ###
|
434
|
|
|
|
|
|
|
#####################################################################
|
435
|
|
|
|
|
|
|
###
|
436
|
1
|
|
|
|
|
9
|
our $fa_code=['Distro/fa_code_demo.pm', #<== Change Location Here ###
|
437
|
|
|
|
|
|
|
"From $INC{'Term/Menus.pm'}, Line: ".($vlin+13)]; ###
|
438
|
|
|
|
|
|
|
###
|
439
|
|
|
|
|
|
|
#####################################################################
|
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
#####################################################################
|
442
|
|
|
|
|
|
|
#### ###
|
443
|
|
|
|
|
|
|
#### DEFAULT MODULE OF Net::FullAuto $fa_conf IS: ###
|
444
|
|
|
|
|
|
|
#### ###
|
445
|
|
|
|
|
|
|
#### ==> Distro/fa_conf.pm <== If you want a differnet ###
|
446
|
|
|
|
|
|
|
#### ###
|
447
|
|
|
|
|
|
|
#### module to be the default, change $fa_conf variable below or ###
|
448
|
|
|
|
|
|
|
#### set the $fa_conf variable in the BEGIN { } block ###
|
449
|
|
|
|
|
|
|
#### of the top level script invoking Net::FullAuto. (Advised) ###
|
450
|
|
|
|
|
|
|
#### ###
|
451
|
|
|
|
|
|
|
#####################################################################
|
452
|
|
|
|
|
|
|
###
|
453
|
1
|
|
|
|
|
6
|
our $fa_conf=['Distro/fa_conf.pm', #<== Change Location Here ###
|
454
|
|
|
|
|
|
|
"From $INC{'Term/Menus.pm'}, Line: ".($vlin+30)]; ###
|
455
|
|
|
|
|
|
|
###
|
456
|
|
|
|
|
|
|
#####################################################################
|
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
#####################################################################
|
459
|
|
|
|
|
|
|
#### ###
|
460
|
|
|
|
|
|
|
#### DEFAULT MODULE OF Net::FullAuto $fa_host IS: ###
|
461
|
|
|
|
|
|
|
#### ###
|
462
|
|
|
|
|
|
|
#### ==> Distro/fa_host.pm <== If you want a different ###
|
463
|
|
|
|
|
|
|
#### ###
|
464
|
|
|
|
|
|
|
#### module to be the default, change $fa_host variable below or ###
|
465
|
|
|
|
|
|
|
#### set the $fa_hosts_config variable in the BEGIN { } block ###
|
466
|
|
|
|
|
|
|
#### of the top level script invoking Net::FullAuto. (Advised) ###
|
467
|
|
|
|
|
|
|
#### ###
|
468
|
|
|
|
|
|
|
#####################################################################
|
469
|
|
|
|
|
|
|
###
|
470
|
1
|
|
|
|
|
7
|
our $fa_host=['Distro/fa_host.pm', #<== Change Location Here ###
|
471
|
|
|
|
|
|
|
"From $INC{'Term/Menus.pm'}, Line: ".($vlin+47)]; ###
|
472
|
|
|
|
|
|
|
###
|
473
|
|
|
|
|
|
|
#####################################################################
|
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
#####################################################################
|
476
|
|
|
|
|
|
|
#### ###
|
477
|
|
|
|
|
|
|
#### DEFAULT MODULE OF Net::FullAuto $fa_menu IS: ###
|
478
|
|
|
|
|
|
|
#### ###
|
479
|
|
|
|
|
|
|
#### ==> Distro/fa_menu_demo.pm <== If you want a different ###
|
480
|
|
|
|
|
|
|
#### ###
|
481
|
|
|
|
|
|
|
#### module to be the default, change $fa_menu variable below or ###
|
482
|
|
|
|
|
|
|
#### set the $fa_menu variable in the BEGIN { } block ###
|
483
|
|
|
|
|
|
|
#### of the top level script invoking Net::FullAuto. (Advised) ###
|
484
|
|
|
|
|
|
|
#### ###
|
485
|
|
|
|
|
|
|
#####################################################################
|
486
|
|
|
|
|
|
|
###
|
487
|
1
|
|
|
|
|
4
|
our $fa_menu=['Distro/fa_menu_demo.pm', #<== Change Location Here ###
|
488
|
|
|
|
|
|
|
"From $INC{'Term/Menus.pm'}, Line ".($vlin+81)]; ###
|
489
|
|
|
|
|
|
|
###
|
490
|
|
|
|
|
|
|
#####################################################################
|
491
|
|
|
|
|
|
|
|
492
|
1
|
|
|
|
|
3
|
our $fullauto=0;$new_user_flag=1;
|
|
1
|
|
|
|
|
3
|
|
493
|
1
|
50
|
33
|
|
|
253
|
if (defined caller(2) && -1
|
494
|
0
|
|
|
|
|
0
|
$fullauto=1;
|
495
|
0
|
|
|
|
|
0
|
my $default_modules='';
|
496
|
0
|
0
|
0
|
|
|
0
|
unless ($main::fa_code && $main::fa_conf && $main::fa_host
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
497
|
|
|
|
|
|
|
&& $main::fa_menu) {
|
498
|
0
|
0
|
|
|
|
0
|
unless (exists $INC{'Net/FullAuto.pm'}) {
|
499
|
0
|
|
|
|
|
0
|
foreach my $fpath (@INC) {
|
500
|
0
|
|
|
|
|
0
|
my $f=$fpath;
|
501
|
0
|
0
|
|
|
|
0
|
if (-e $f.'/Net/FullAuto.pm') {
|
502
|
0
|
|
|
|
|
0
|
$INC{'Net/FullAuto.pm'}=$f.'/Net/FullAuto.pm';
|
503
|
0
|
|
|
|
|
0
|
last;
|
504
|
|
|
|
|
|
|
}
|
505
|
|
|
|
|
|
|
}
|
506
|
|
|
|
|
|
|
}
|
507
|
0
|
|
|
|
|
0
|
my $fa_path=$INC{'Net/FullAuto.pm'};
|
508
|
0
|
|
|
|
|
0
|
my $progname=substr($0,(rindex $0,'/')+1,-3);
|
509
|
0
|
|
|
|
|
0
|
substr($fa_path,-3)='';
|
510
|
0
|
|
0
|
|
|
0
|
my $username=getlogin || getpwuid($<);
|
511
|
0
|
0
|
|
|
|
0
|
if (-f $fa_path.'/fa_global.pm') {
|
512
|
0
|
0
|
|
|
|
0
|
if (-r $fa_path.'/fa_global.pm') {
|
513
|
|
|
|
|
|
|
{
|
514
|
1
|
|
|
1
|
|
9
|
no strict 'subs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
|
0
|
|
|
|
|
0
|
|
515
|
0
|
|
|
|
|
0
|
require $fa_path.'/fa_global.pm';
|
516
|
0
|
|
0
|
|
|
0
|
$fa_global::berkeley_db_path||='';
|
517
|
0
|
|
0
|
|
|
0
|
$fa_global::FA_Sudo||={};
|
518
|
0
|
0
|
|
|
|
0
|
if (exists $fa_global::FA_Sudo->{$username}) {
|
519
|
0
|
|
|
|
|
0
|
$username=$fa_global::FA_Sudo->{$username};
|
520
|
|
|
|
|
|
|
}
|
521
|
0
|
0
|
0
|
|
|
0
|
if ($fa_global::berkeley_db_path &&
|
522
|
|
|
|
|
|
|
-d $fa_global::berkeley_db_path.'Defaults') {
|
523
|
1
|
|
|
1
|
|
5
|
BEGIN { $Term::Menus::facall=caller(2);
|
524
|
1
|
|
50
|
|
|
45
|
$Term::Menus::facall||='' };
|
525
|
1
|
|
|
|
|
6
|
use if (-1
|
526
|
1
|
|
|
1
|
|
673
|
"BerkeleyDB";
|
|
1
|
|
|
|
|
13
|
|
527
|
0
|
0
|
|
|
|
0
|
my $dbenv = BerkeleyDB::Env->new(
|
528
|
|
|
|
|
|
|
-Home => $fa_global::berkeley_db_path.'Defaults',
|
529
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL
|
530
|
|
|
|
|
|
|
) or die(
|
531
|
|
|
|
|
|
|
"cannot open environment for DB: ".
|
532
|
|
|
|
|
|
|
$BerkeleyDB::Error."\n",'','');
|
533
|
0
|
0
|
|
|
|
0
|
my $kind=(grep { /^--test$/ } @ARGV)?'test':'prod';
|
|
0
|
|
|
|
|
0
|
|
534
|
0
|
|
|
|
|
0
|
my $bdb = BerkeleyDB::Btree->new(
|
535
|
|
|
|
|
|
|
-Filename => "${progname}_${kind}_defaults.db",
|
536
|
|
|
|
|
|
|
-Flags => DB_CREATE,
|
537
|
|
|
|
|
|
|
-Env => $dbenv
|
538
|
|
|
|
|
|
|
);
|
539
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
540
|
0
|
|
|
|
|
0
|
$bdb = BerkeleyDB::Btree->new(
|
541
|
|
|
|
|
|
|
-Filename => "${progname}_${kind}_defaults.db",
|
542
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_RECOVER_FATAL,
|
543
|
|
|
|
|
|
|
-Env => $dbenv
|
544
|
|
|
|
|
|
|
);
|
545
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
546
|
0
|
|
|
|
|
0
|
die "Cannot Open DB ${progname}_${kind}_defaults.db:".
|
547
|
|
|
|
|
|
|
" $BerkeleyDB::Error\n";
|
548
|
|
|
|
|
|
|
}
|
549
|
|
|
|
|
|
|
}
|
550
|
0
|
0
|
0
|
|
|
0
|
if (exists $ENV{'SSH_CONNECTION'} &&
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
551
|
|
|
|
|
|
|
exists $ENV{'USER'} && ($ENV{'USER'}
|
552
|
|
|
|
|
|
|
ne $username)) {
|
553
|
0
|
|
|
|
|
0
|
$username=$ENV{'USER'};
|
554
|
|
|
|
|
|
|
} elsif ($username eq 'SYSTEM' &&
|
555
|
|
|
|
|
|
|
exists $ENV{'IWUSER'} && ($ENV{'IWUSER'}
|
556
|
|
|
|
|
|
|
ne $username)) {
|
557
|
0
|
|
|
|
|
0
|
my $login_flag=0;
|
558
|
0
|
|
|
|
|
0
|
foreach (@ARGV) {
|
559
|
0
|
|
|
|
|
0
|
my $argv=$_;
|
560
|
0
|
0
|
|
|
|
0
|
if ($login_flag) {
|
|
|
0
|
|
|
|
|
|
561
|
0
|
|
|
|
|
0
|
$username=$argv;
|
562
|
0
|
|
|
|
|
0
|
last;
|
563
|
|
|
|
|
|
|
} elsif (lc($argv) eq '--login') {
|
564
|
0
|
|
|
|
|
0
|
$login_flag=1;
|
565
|
|
|
|
|
|
|
}
|
566
|
|
|
|
|
|
|
}
|
567
|
0
|
0
|
|
|
|
0
|
$username=$ENV{'IWUSER'} unless $login_flag;
|
568
|
0
|
|
|
|
|
0
|
} elsif (grep { /--login/ } @ARGV) {
|
569
|
0
|
|
|
|
|
0
|
my $login_flag=0;
|
570
|
0
|
|
|
|
|
0
|
foreach (@ARGV) {
|
571
|
0
|
|
|
|
|
0
|
my $argv=$_;
|
572
|
0
|
0
|
|
|
|
0
|
if ($login_flag) {
|
|
|
0
|
|
|
|
|
|
573
|
0
|
|
|
|
|
0
|
$username=$argv;
|
574
|
0
|
|
|
|
|
0
|
last;
|
575
|
|
|
|
|
|
|
} elsif (lc($argv) eq '--login') {
|
576
|
0
|
|
|
|
|
0
|
$login_flag=1;
|
577
|
|
|
|
|
|
|
}
|
578
|
|
|
|
|
|
|
}
|
579
|
|
|
|
|
|
|
}
|
580
|
0
|
0
|
|
|
|
0
|
my $status=$bdb->db_get(
|
581
|
|
|
|
|
|
|
$username,$default_modules) if $bdb;
|
582
|
0
|
|
0
|
|
|
0
|
$default_modules||='';
|
583
|
0
|
0
|
|
|
|
0
|
$default_modules=~s/\$HASH\d*\s*=\s*//s
|
584
|
|
|
|
|
|
|
if -1
|
585
|
0
|
|
|
|
|
0
|
$default_modules=eval $default_modules;
|
586
|
0
|
|
0
|
|
|
0
|
$default_modules||={};
|
587
|
0
|
|
|
|
|
0
|
my $save_defaults_for_user_flag=0;
|
588
|
0
|
0
|
|
|
|
0
|
if ($data_dump_streamer) {
|
589
|
0
|
|
|
|
|
0
|
foreach my $mod (keys %{$default_modules}) {
|
|
0
|
|
|
|
|
0
|
|
590
|
0
|
0
|
|
|
|
0
|
if ($mod eq 'set') {
|
591
|
0
|
0
|
|
|
|
0
|
if ($default_modules->{set} ne 'none') {
|
592
|
0
|
|
|
|
|
0
|
$save_defaults_for_user_flag=1;
|
593
|
0
|
|
|
|
|
0
|
next;
|
594
|
0
|
|
|
|
|
0
|
} else { next }
|
595
|
|
|
|
|
|
|
}
|
596
|
0
|
0
|
|
|
|
0
|
unless ($Term::Menus::filechk->(
|
597
|
|
|
|
|
|
|
$default_modules->{$mod})) {
|
598
|
0
|
|
|
|
|
0
|
delete $default_modules->{$mod};
|
599
|
0
|
|
|
|
|
0
|
next;
|
600
|
|
|
|
|
|
|
}
|
601
|
0
|
|
|
|
|
0
|
$save_defaults_for_user_flag=1;
|
602
|
|
|
|
|
|
|
}
|
603
|
0
|
0
|
|
|
|
0
|
if ($save_defaults_for_user_flag) {
|
604
|
0
|
|
|
|
|
0
|
my $def_modules=Data::Dump::Streamer::Dump(
|
605
|
|
|
|
|
|
|
$default_modules)->Out();
|
606
|
0
|
0
|
|
|
|
0
|
my $status=$bdb->db_put(
|
607
|
|
|
|
|
|
|
$username,$def_modules) if $bdb;
|
608
|
|
|
|
|
|
|
} else {
|
609
|
0
|
0
|
|
|
|
0
|
my $status=$bdb->db_del(
|
610
|
|
|
|
|
|
|
$username) if $bdb;
|
611
|
|
|
|
|
|
|
}
|
612
|
|
|
|
|
|
|
}
|
613
|
0
|
|
|
|
|
0
|
undef $bdb;
|
614
|
0
|
|
|
|
|
0
|
$dbenv->close();
|
615
|
0
|
|
|
|
|
0
|
undef $dbenv;
|
616
|
0
|
0
|
|
|
|
0
|
unless (keys %{$default_modules}) {
|
|
0
|
0
|
|
|
|
0
|
|
617
|
0
|
|
|
|
|
0
|
$default_modules->{'set'}='none';
|
618
|
0
|
|
|
|
|
0
|
$default_modules->{'fa_code'}=
|
619
|
|
|
|
|
|
|
'Net/FullAuto/Distro/fa_code_demo.pm';
|
620
|
0
|
|
|
|
|
0
|
$default_modules->{'fa_conf'}=
|
621
|
|
|
|
|
|
|
'Net/FullAuto/Distro/fa_conf.pm';
|
622
|
0
|
|
|
|
|
0
|
$default_modules->{'fa_host'}=
|
623
|
|
|
|
|
|
|
'Net/FullAuto/Distro/fa_host.pm';
|
624
|
0
|
|
|
|
|
0
|
$default_modules->{'fa_menu'}=
|
625
|
|
|
|
|
|
|
'Net/FullAuto/Distro/fa_menu_demo.pm';
|
626
|
0
|
0
|
|
|
|
0
|
} elsif (exists $default_modules->{'set'} &&
|
627
|
|
|
|
|
|
|
$default_modules->{'set'} ne 'none') {
|
628
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
629
|
0
|
|
|
|
|
0
|
my $setname=$default_modules->{'set'};
|
630
|
0
|
0
|
|
|
|
0
|
my $stenv = BerkeleyDB::Env->new(
|
631
|
|
|
|
|
|
|
-Home => $fa_global::berkeley_db_path.'Sets',
|
632
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL
|
633
|
|
|
|
|
|
|
) or die(
|
634
|
|
|
|
|
|
|
"cannot open environment for DB: ".
|
635
|
|
|
|
|
|
|
$BerkeleyDB::Error."\n",'','');
|
636
|
0
|
|
|
|
|
0
|
my $std = BerkeleyDB::Btree->new(
|
637
|
|
|
|
|
|
|
-Filename => "${progname}_sets.db",
|
638
|
|
|
|
|
|
|
-Flags => DB_CREATE,
|
639
|
|
|
|
|
|
|
-Env => $stenv
|
640
|
|
|
|
|
|
|
);
|
641
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
642
|
0
|
|
|
|
|
0
|
$std = BerkeleyDB::Btree->new(
|
643
|
|
|
|
|
|
|
-Filename => "${progname}_sets.db",
|
644
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_RECOVER_FATAL,
|
645
|
|
|
|
|
|
|
-Env => $stenv
|
646
|
|
|
|
|
|
|
);
|
647
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
648
|
0
|
|
|
|
|
0
|
die "Cannot Open DB ${progname}_sets.db:".
|
649
|
|
|
|
|
|
|
" $BerkeleyDB::Error\n";
|
650
|
|
|
|
|
|
|
}
|
651
|
|
|
|
|
|
|
}
|
652
|
|
|
|
|
|
|
#my $username=getlogin || getpwuid($<);
|
653
|
0
|
|
|
|
|
0
|
my $set='';
|
654
|
0
|
|
|
|
|
0
|
my $status=$std->db_get(
|
655
|
|
|
|
|
|
|
$username,$set);
|
656
|
0
|
|
0
|
|
|
0
|
$set||='';
|
657
|
0
|
0
|
|
|
|
0
|
$set=~s/\$HASH\d*\s*=\s*//s
|
658
|
|
|
|
|
|
|
if -1
|
659
|
0
|
|
|
|
|
0
|
$set=eval $set;
|
660
|
0
|
|
0
|
|
|
0
|
$set||={};
|
661
|
0
|
|
|
|
|
0
|
undef $std;
|
662
|
0
|
|
|
|
|
0
|
$stenv->close();
|
663
|
0
|
|
|
|
|
0
|
undef $stenv;
|
664
|
0
|
|
|
|
|
0
|
$fa_code=[$set->{$setname}->{'fa_code'},
|
665
|
|
|
|
|
|
|
"From Default Set $setname ".
|
666
|
|
|
|
|
|
|
"(Change with fa --set)"];
|
667
|
0
|
|
|
|
|
0
|
$fa_conf=[$set->{$setname}->{'fa_conf'},
|
668
|
|
|
|
|
|
|
"From Default Set $setname ".
|
669
|
|
|
|
|
|
|
"(Change with fa --set)"];
|
670
|
0
|
|
|
|
|
0
|
$fa_host=[$set->{$setname}->{'fa_host'},
|
671
|
|
|
|
|
|
|
"From Default Set $setname ".
|
672
|
|
|
|
|
|
|
"(Change with fa --set)"];
|
673
|
0
|
|
|
|
|
0
|
$fa_menu=[$set->{$setname}->{'fa_menu'},
|
674
|
|
|
|
|
|
|
"From Default Set $setname ".
|
675
|
|
|
|
|
|
|
"(Change with fa --set)"];
|
676
|
|
|
|
|
|
|
} else {
|
677
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
678
|
0
|
0
|
|
|
|
0
|
if (exists $default_modules->{'fa_code'}) {
|
679
|
0
|
|
|
|
|
0
|
$fa_code=[$default_modules->{'fa_code'},
|
680
|
|
|
|
|
|
|
"From Default Setting ".
|
681
|
|
|
|
|
|
|
"(Change with fa --defaults)"];
|
682
|
|
|
|
|
|
|
}
|
683
|
0
|
0
|
|
|
|
0
|
if (exists $default_modules->{'fa_conf'}) {
|
684
|
0
|
|
|
|
|
0
|
$fa_conf=[$default_modules->{'fa_conf'},
|
685
|
|
|
|
|
|
|
"From Default Setting ".
|
686
|
|
|
|
|
|
|
"(Change with fa --defaults)"];
|
687
|
|
|
|
|
|
|
}
|
688
|
0
|
0
|
|
|
|
0
|
if (exists $default_modules->{'fa_host'}) {
|
689
|
0
|
|
|
|
|
0
|
$fa_host=[$default_modules->{'fa_host'},
|
690
|
|
|
|
|
|
|
"From Default Setting ".
|
691
|
|
|
|
|
|
|
"(Change with fa --defaults)"];
|
692
|
|
|
|
|
|
|
}
|
693
|
0
|
0
|
|
|
|
0
|
if (exists $default_modules->{'fa_menu'}) {
|
694
|
0
|
|
|
|
|
0
|
$fa_menu=[$default_modules->{'fa_menu'},
|
695
|
|
|
|
|
|
|
"From Default Setting ".
|
696
|
|
|
|
|
|
|
"(Change with fa --defaults)"];
|
697
|
|
|
|
|
|
|
}
|
698
|
|
|
|
|
|
|
}
|
699
|
|
|
|
|
|
|
}
|
700
|
|
|
|
|
|
|
}
|
701
|
|
|
|
|
|
|
} else {
|
702
|
0
|
|
|
|
|
0
|
warn("WARNING: Cannot read defaults file $fa_path/fa_global.pm".
|
703
|
|
|
|
|
|
|
" - permission denied (Hint: Perhaps you need to 'Run as ".
|
704
|
|
|
|
|
|
|
"administrator'?)");
|
705
|
|
|
|
|
|
|
}
|
706
|
|
|
|
|
|
|
}
|
707
|
0
|
|
|
|
|
0
|
my @A=();my %A=();
|
|
0
|
|
|
|
|
0
|
|
708
|
0
|
|
|
|
|
0
|
push @A,@ARGV;
|
709
|
0
|
|
|
|
|
0
|
my $acnt=0;
|
710
|
0
|
|
|
|
|
0
|
foreach my $a (@A) {
|
711
|
0
|
|
|
|
|
0
|
$acnt++;
|
712
|
0
|
|
|
|
|
0
|
my $aa=$a;
|
713
|
0
|
0
|
|
|
|
0
|
if (-1
|
|
|
0
|
|
|
|
|
|
714
|
0
|
|
|
|
|
0
|
my $k=unpack('x5a*',$aa);
|
715
|
0
|
|
0
|
|
|
0
|
my $v=$A[$acnt]||'';
|
716
|
0
|
0
|
|
|
|
0
|
unless (-1
|
717
|
0
|
|
|
|
|
0
|
$A{$k}=$v;
|
718
|
|
|
|
|
|
|
} else {
|
719
|
0
|
|
|
|
|
0
|
@A=();
|
720
|
0
|
|
|
|
|
0
|
last;
|
721
|
|
|
|
|
|
|
}
|
722
|
|
|
|
|
|
|
} elsif (-1
|
723
|
0
|
|
0
|
|
|
0
|
my $v=$A[$acnt]||'';
|
724
|
0
|
0
|
|
|
|
0
|
unless (-1
|
725
|
0
|
|
|
|
|
0
|
$A{set}=$v;
|
726
|
|
|
|
|
|
|
} else {
|
727
|
0
|
|
|
|
|
0
|
@A=();
|
728
|
0
|
|
|
|
|
0
|
last;
|
729
|
|
|
|
|
|
|
}
|
730
|
|
|
|
|
|
|
}
|
731
|
|
|
|
|
|
|
}
|
732
|
0
|
|
|
|
|
0
|
foreach my $e (('set','code','conf','host','maps','menu')) {
|
733
|
0
|
0
|
|
|
|
0
|
if (exists $A{$e}) {
|
734
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
735
|
0
|
0
|
|
|
|
0
|
if ($e eq 'set') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
736
|
1
|
|
|
1
|
|
1367
|
no strict 'subs';
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2120
|
|
737
|
0
|
|
|
|
|
0
|
my $setname=$A{$e};
|
738
|
0
|
|
|
|
|
0
|
my $fa_path=$INC{'Net/FullAuto.pm'};
|
739
|
0
|
|
|
|
|
0
|
my $progname=substr($0,(rindex $0,'/')+1,-3);
|
740
|
0
|
|
|
|
|
0
|
substr($fa_path,-3)='';
|
741
|
0
|
0
|
|
|
|
0
|
if (-f $fa_path.'/fa_global.pm') {
|
742
|
0
|
0
|
|
|
|
0
|
my $stenv = BerkeleyDB::Env->new(
|
743
|
|
|
|
|
|
|
-Home => $fa_global::berkeley_db_path.'Sets',
|
744
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL
|
745
|
|
|
|
|
|
|
) or die(
|
746
|
|
|
|
|
|
|
"cannot open environment for DB: ".
|
747
|
|
|
|
|
|
|
$BerkeleyDB::Error."\n",'','');
|
748
|
0
|
|
|
|
|
0
|
my $std = BerkeleyDB::Btree->new(
|
749
|
|
|
|
|
|
|
-Filename => "${progname}_sets.db",
|
750
|
|
|
|
|
|
|
-Flags => DB_CREATE,
|
751
|
|
|
|
|
|
|
-Env => $stenv
|
752
|
|
|
|
|
|
|
);
|
753
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
754
|
0
|
|
|
|
|
0
|
$std = BerkeleyDB::Btree->new(
|
755
|
|
|
|
|
|
|
-Filename => "${progname}_sets.db",
|
756
|
|
|
|
|
|
|
-Flags => DB_CREATE|DB_RECOVER_FATAL,
|
757
|
|
|
|
|
|
|
-Env => $stenv
|
758
|
|
|
|
|
|
|
);
|
759
|
0
|
0
|
|
|
|
0
|
unless ($BerkeleyDB::Error=~/Successful/) {
|
760
|
0
|
|
|
|
|
0
|
die "Cannot Open DB ${progname}_sets.db:".
|
761
|
|
|
|
|
|
|
" $BerkeleyDB::Error\n";
|
762
|
|
|
|
|
|
|
}
|
763
|
|
|
|
|
|
|
}
|
764
|
|
|
|
|
|
|
#my $username=getlogin || getpwuid($<);
|
765
|
0
|
|
|
|
|
0
|
my $set='';
|
766
|
0
|
|
|
|
|
0
|
my $status=$std->db_get(
|
767
|
|
|
|
|
|
|
$username,$set);
|
768
|
0
|
|
0
|
|
|
0
|
$set||='';
|
769
|
0
|
0
|
|
|
|
0
|
$set=~s/\$HASH\d*\s*=\s*//s
|
770
|
|
|
|
|
|
|
if -1
|
771
|
0
|
|
|
|
|
0
|
$set=eval $set;
|
772
|
0
|
|
0
|
|
|
0
|
$set||={};
|
773
|
0
|
|
|
|
|
0
|
undef $std;
|
774
|
0
|
|
|
|
|
0
|
$stenv->close();
|
775
|
0
|
|
|
|
|
0
|
undef $stenv;
|
776
|
0
|
|
|
|
|
0
|
$fa_code=[$set->{$setname}->{'fa_code'},
|
777
|
|
|
|
|
|
|
"From CMD arg fa --set $setname line ".__LINE__];
|
778
|
0
|
|
|
|
|
0
|
$fa_conf=[$set->{$setname}->{'fa_conf'},
|
779
|
|
|
|
|
|
|
"From CMD arg fa --set $setname line ".__LINE__];
|
780
|
0
|
|
|
|
|
0
|
$fa_host=[$set->{$setname}->{'fa_host'},
|
781
|
|
|
|
|
|
|
"From CMD arg fa --set $setname line ".__LINE__];
|
782
|
0
|
|
|
|
|
0
|
$fa_menu=[$set->{$setname}->{'fa_menu'},
|
783
|
|
|
|
|
|
|
"From CMD arg fa --set $setname line ".__LINE__];
|
784
|
|
|
|
|
|
|
} else {
|
785
|
0
|
|
|
|
|
0
|
my $die="\n FATAL ERROR: The Set indicated from".
|
786
|
|
|
|
|
|
|
" the CMD arg:\n\n".
|
787
|
|
|
|
|
|
|
" ==> fa --set $A{$e}n\n".
|
788
|
|
|
|
|
|
|
" does not exist. To create this\n".
|
789
|
|
|
|
|
|
|
" set, run fa --set without any\n".
|
790
|
|
|
|
|
|
|
" other arguments";
|
791
|
0
|
|
|
|
|
0
|
die $die;
|
792
|
|
|
|
|
|
|
}
|
793
|
|
|
|
|
|
|
} elsif ($e eq 'code') {
|
794
|
0
|
|
|
|
|
0
|
$fa_code=$A{$e};
|
795
|
0
|
|
|
|
|
0
|
$fa_code=[$fa_code,
|
796
|
|
|
|
|
|
|
"From CMD arg: fa --fa_code $A{$e}"];
|
797
|
|
|
|
|
|
|
} elsif ($e eq 'menu') {
|
798
|
0
|
|
|
|
|
0
|
$fa_menu=$A{$e};
|
799
|
0
|
|
|
|
|
0
|
$fa_menu=[$fa_menu,
|
800
|
|
|
|
|
|
|
"From CMD arg: fa --fa_menu $A{$e}"];
|
801
|
|
|
|
|
|
|
} elsif ($e eq 'host') {
|
802
|
0
|
|
|
|
|
0
|
$fa_host=$A{$e};
|
803
|
0
|
|
|
|
|
0
|
$fa_host=[$fa_host,
|
804
|
|
|
|
|
|
|
"From CMD arg: fa --fa_host $A{$e}"];
|
805
|
|
|
|
|
|
|
} elsif ($e eq 'conf') {
|
806
|
0
|
|
|
|
|
0
|
$fa_conf=$A{$e};
|
807
|
0
|
|
|
|
|
0
|
$fa_conf=[$fa_conf,
|
808
|
|
|
|
|
|
|
"From CMD arg: fa --fa_conf $A{$e}"];
|
809
|
|
|
|
|
|
|
}
|
810
|
|
|
|
|
|
|
}
|
811
|
0
|
|
|
|
|
0
|
my $abspath=abs_path($0);
|
812
|
0
|
|
|
|
|
0
|
$abspath=~s/\.exe$//;
|
813
|
0
|
|
|
|
|
0
|
$abspath.='.pl';
|
814
|
0
|
0
|
0
|
|
|
0
|
if (defined $main::fa_code && $main::fa_code) {
|
815
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
816
|
0
|
|
|
|
|
0
|
$fa_code=$main::fa_code;
|
817
|
0
|
|
|
|
|
0
|
my $p=abs_path($0);
|
818
|
0
|
|
|
|
|
0
|
$fa_code=[$fa_code,
|
819
|
|
|
|
|
|
|
"From \$fa_code variable in $abspath"];
|
820
|
|
|
|
|
|
|
}
|
821
|
0
|
0
|
0
|
|
|
0
|
if (defined $main::fa_conf && $main::fa_conf) {
|
822
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
823
|
0
|
|
|
|
|
0
|
$fa_conf=$main::fa_conf;
|
824
|
0
|
|
|
|
|
0
|
$fa_conf=[$fa_conf,
|
825
|
|
|
|
|
|
|
"From \$fa_conf variable in $abspath"];
|
826
|
|
|
|
|
|
|
}
|
827
|
0
|
0
|
0
|
|
|
0
|
if (defined $main::fa_host && $main::fa_host) {
|
828
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
829
|
0
|
|
|
|
|
0
|
$fa_host=$main::fa_host;
|
830
|
0
|
|
|
|
|
0
|
$fa_host=[$fa_host,
|
831
|
|
|
|
|
|
|
"From \$fa_host variable in $abspath"];
|
832
|
|
|
|
|
|
|
}
|
833
|
0
|
0
|
0
|
|
|
0
|
if (defined $main::fa_menu && $main::fa_menu) {
|
834
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
835
|
0
|
|
|
|
|
0
|
$fa_menu=$main::fa_menu;
|
836
|
0
|
|
|
|
|
0
|
$fa_menu=[$fa_menu,
|
837
|
|
|
|
|
|
|
"From \$fa_menu variable in $abspath"];
|
838
|
|
|
|
|
|
|
}
|
839
|
|
|
|
|
|
|
}
|
840
|
|
|
|
|
|
|
} else {
|
841
|
0
|
|
|
|
|
0
|
$new_user_flag=0;
|
842
|
0
|
|
|
|
|
0
|
my $abspath=abs_path($0);
|
843
|
0
|
|
|
|
|
0
|
$abspath=~s/\.exe$//;
|
844
|
0
|
|
|
|
|
0
|
$abspath.='.pl';
|
845
|
0
|
|
|
|
|
0
|
$fa_code=[$fa_code,
|
846
|
|
|
|
|
|
|
"From \$fa_code variable in $abspath"];
|
847
|
0
|
|
|
|
|
0
|
$fa_conf=[$fa_conf,
|
848
|
|
|
|
|
|
|
"From \$fa_conf variable in $abspath"];
|
849
|
0
|
|
|
|
|
0
|
$fa_host=[$fa_host,
|
850
|
|
|
|
|
|
|
"From \$fa_host variable in $abspath"];
|
851
|
0
|
|
|
|
|
0
|
$fa_menu=[$fa_menu,
|
852
|
|
|
|
|
|
|
"From \$fa_menu variable in $abspath"];
|
853
|
|
|
|
|
|
|
}
|
854
|
0
|
0
|
0
|
|
|
0
|
$fa_code->[0]='Net/FullAuto/'.$fa_code->[0]
|
855
|
|
|
|
|
|
|
if $fa_code->[0] && -1==index $fa_code->[0],'Net/FullAuto';
|
856
|
0
|
|
0
|
|
|
0
|
$fa_code->[0]||='';
|
857
|
0
|
|
|
|
|
0
|
my $argv=join " ",@ARGV;
|
858
|
0
|
|
|
|
|
0
|
my $rx='^--edi*t* *|^-e[a-z]|^--admin|^-V|^-v|^--VE*R*S*I*O*N*|'.
|
859
|
|
|
|
|
|
|
'^--users|^--ve*r*s*i*o*n*|^--cat|^--tutorial|^--figlet';
|
860
|
0
|
0
|
|
|
|
0
|
if (!map { /$rx/ } @ARGV) {
|
|
0
|
|
|
|
|
0
|
|
861
|
0
|
0
|
|
|
|
0
|
if ($fa_code->[0]) {
|
862
|
0
|
0
|
|
|
|
0
|
if ($Term::Menus::canload->($fa_code->[0])) {
|
863
|
0
|
|
|
|
|
0
|
require $fa_code->[0];
|
864
|
0
|
|
|
|
|
0
|
my $mod=substr($fa_code->[0],(rindex $fa_code->[0],'/')+1,-3);
|
865
|
0
|
|
|
|
|
0
|
import $mod;
|
866
|
0
|
|
|
|
|
0
|
$fa_code=$mod.'.pm';
|
867
|
|
|
|
|
|
|
} else {
|
868
|
0
|
|
|
|
|
0
|
my $ln=__LINE__;
|
869
|
0
|
|
|
|
|
0
|
$ln-=5;
|
870
|
|
|
|
|
|
|
die "Cannot load module $fa_code->[0]".
|
871
|
|
|
|
|
|
|
"\n $fa_code->[1]\n".
|
872
|
|
|
|
|
|
|
"\"require $fa_code->[0];\"".
|
873
|
0
|
|
|
|
|
0
|
"--failed at ".$INC{'Term/Menus.pm'}." line $ln\.\n$@\n";
|
874
|
|
|
|
|
|
|
}
|
875
|
|
|
|
|
|
|
} else {
|
876
|
0
|
|
|
|
|
0
|
require 'Net/FullAuto/Distro/fa_code.pm';
|
877
|
0
|
|
|
|
|
0
|
import fa_code;
|
878
|
0
|
|
|
|
|
0
|
$fa_code='fa_code.pm';
|
879
|
|
|
|
|
|
|
}
|
880
|
|
|
|
|
|
|
}
|
881
|
0
|
0
|
0
|
|
|
0
|
$fa_conf->[0]='Net/FullAuto/'.$fa_conf->[0]
|
882
|
|
|
|
|
|
|
if $fa_conf->[0] && -1==index $fa_conf->[0],'Net/FullAuto';
|
883
|
0
|
|
0
|
|
|
0
|
$fa_conf->[0]||='';
|
884
|
0
|
0
|
|
|
|
0
|
if ($argv!~/--edit |^-e[a-z]|--cat /) {
|
885
|
0
|
0
|
|
|
|
0
|
if ($fa_conf->[0]) {
|
886
|
0
|
0
|
|
|
|
0
|
if ($Term::Menus::canload->($fa_conf->[0])) {
|
887
|
0
|
|
|
|
|
0
|
require $fa_conf->[0];
|
888
|
0
|
|
|
|
|
0
|
my $mod=substr($fa_conf->[0],(rindex $fa_conf->[0],'/')+1,-3);
|
889
|
0
|
|
|
|
|
0
|
import $mod;
|
890
|
0
|
|
|
|
|
0
|
$fa_conf=$mod.'.pm';
|
891
|
|
|
|
|
|
|
} else {
|
892
|
0
|
|
|
|
|
0
|
my $ln=__LINE__;
|
893
|
0
|
|
|
|
|
0
|
$ln-=5;
|
894
|
|
|
|
|
|
|
die "Cannot load module $fa_conf->[0]".
|
895
|
|
|
|
|
|
|
"\n $fa_conf->[1]\n".
|
896
|
|
|
|
|
|
|
"\"require $fa_conf->[0];\"".
|
897
|
0
|
|
|
|
|
0
|
"--failed at ".$INC{'Term/Menus.pm'}." line $ln\.\n$@\n";
|
898
|
|
|
|
|
|
|
}
|
899
|
|
|
|
|
|
|
} else {
|
900
|
0
|
|
|
|
|
0
|
require 'Net/FullAuto/Distro/fa_conf.pm';
|
901
|
0
|
|
|
|
|
0
|
import fa_conf;
|
902
|
0
|
|
|
|
|
0
|
$fa_conf='fa_conf.pm';
|
903
|
|
|
|
|
|
|
}
|
904
|
|
|
|
|
|
|
}
|
905
|
0
|
0
|
0
|
|
|
0
|
$fa_host->[0]='Net/FullAuto/'.$fa_host->[0]
|
906
|
|
|
|
|
|
|
if $fa_host->[0] && -1==index $fa_host->[0],'Net/FullAuto';
|
907
|
0
|
|
0
|
|
|
0
|
$fa_host->[0]||='';
|
908
|
0
|
0
|
|
|
|
0
|
if ($argv!~/--edit |^-e[a-z]/) {
|
909
|
0
|
0
|
|
|
|
0
|
if ($fa_host->[0]) {
|
910
|
0
|
0
|
|
|
|
0
|
if ($Term::Menus::canload->($fa_host->[0])) {
|
911
|
0
|
|
|
|
|
0
|
require $fa_host->[0];
|
912
|
0
|
|
|
|
|
0
|
my $mod=substr($fa_host->[0],(rindex $fa_host->[0],'/')+1,-3);
|
913
|
0
|
|
|
|
|
0
|
import $mod;
|
914
|
0
|
|
|
|
|
0
|
$fa_host=$mod.'.pm';
|
915
|
|
|
|
|
|
|
} else {
|
916
|
0
|
|
|
|
|
0
|
my $ln=__LINE__;
|
917
|
0
|
|
|
|
|
0
|
$ln-=5;
|
918
|
|
|
|
|
|
|
die "Cannot load module $fa_host->[0]".
|
919
|
|
|
|
|
|
|
"\n $fa_host->[1]\n".
|
920
|
|
|
|
|
|
|
"\"require $fa_host->[0];\"".
|
921
|
0
|
|
|
|
|
0
|
"--failed at ".$INC{'Term/Menus.pm'}." line $ln\.\n$@\n";
|
922
|
|
|
|
|
|
|
}
|
923
|
|
|
|
|
|
|
} else {
|
924
|
0
|
|
|
|
|
0
|
require 'Net/FullAuto/Distro/fa_host.pm';
|
925
|
0
|
|
|
|
|
0
|
import fa_host;
|
926
|
0
|
|
|
|
|
0
|
$fa_host='fa_host.pm';
|
927
|
|
|
|
|
|
|
}
|
928
|
|
|
|
|
|
|
}
|
929
|
0
|
0
|
0
|
|
|
0
|
$fa_menu->[0]='Net/FullAuto/'.$fa_menu->[0]
|
930
|
|
|
|
|
|
|
if $fa_menu->[0] && -1==index $fa_menu->[0],'Net/FullAuto';
|
931
|
0
|
|
0
|
|
|
0
|
$fa_menu->[0]||='';
|
932
|
0
|
0
|
|
|
|
0
|
if ($argv!~/--edit |^-e[a-z]/) {
|
933
|
0
|
0
|
|
|
|
0
|
if ($fa_menu->[0]) {
|
934
|
0
|
0
|
|
|
|
0
|
if ($Term::Menus::canload->($fa_menu->[0])) {
|
935
|
0
|
|
|
|
|
0
|
require $fa_menu->[0];
|
936
|
0
|
|
|
|
|
0
|
my $mod=substr($fa_menu->[0],(rindex $fa_menu->[0],'/')+1,-3);
|
937
|
0
|
|
|
|
|
0
|
import $mod;
|
938
|
0
|
|
|
|
|
0
|
$fa_menu=$mod.'.pm';
|
939
|
|
|
|
|
|
|
} else {
|
940
|
0
|
|
|
|
|
0
|
my $ln=__LINE__;
|
941
|
0
|
|
|
|
|
0
|
$ln-=5;
|
942
|
|
|
|
|
|
|
die "Cannot load module $fa_menu->[0]".
|
943
|
|
|
|
|
|
|
"\n $fa_menu->[1]\n".
|
944
|
|
|
|
|
|
|
"\"require $fa_menu->[0];\"".
|
945
|
0
|
|
|
|
|
0
|
"--failed at ".$INC{'Term/Menus.pm'}." line $ln\.\n$@\n";
|
946
|
|
|
|
|
|
|
}
|
947
|
|
|
|
|
|
|
} else {
|
948
|
0
|
|
|
|
|
0
|
require 'Net/FullAuto/Distro/fa_menu_demo.pm';
|
949
|
0
|
|
|
|
|
0
|
import fa_menu_demo;
|
950
|
0
|
|
|
|
|
0
|
$fa_menu='fa_menu_demo.pm';
|
951
|
|
|
|
|
|
|
}
|
952
|
|
|
|
|
|
|
}
|
953
|
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
}
|
955
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
}
|
957
|
|
|
|
|
|
|
|
958
|
|
|
|
|
|
|
our %email_defaults=();
|
959
|
|
|
|
|
|
|
if (%fa_code::email_defaults) {
|
960
|
|
|
|
|
|
|
%email_defaults=%fa_code::email_defaults;
|
961
|
|
|
|
|
|
|
}
|
962
|
|
|
|
|
|
|
our %email_addresses=();
|
963
|
|
|
|
|
|
|
if (%fa_code::email_addresses) {
|
964
|
|
|
|
|
|
|
%email_addresses=%fa_code::email_addresses;
|
965
|
|
|
|
|
|
|
}
|
966
|
|
|
|
|
|
|
our $passwd_file_loc='';
|
967
|
|
|
|
|
|
|
if (defined $fa_code::passwd_file_loc && $fa_code::passwd_file_loc) {
|
968
|
|
|
|
|
|
|
$passwd_file_loc=$fa_code::passwd_file_loc;
|
969
|
|
|
|
|
|
|
}
|
970
|
|
|
|
|
|
|
our $test=0;
|
971
|
|
|
|
|
|
|
if (defined $fa_code::test && $fa_code::test) {
|
972
|
|
|
|
|
|
|
$test=$fa_code::test;
|
973
|
|
|
|
|
|
|
}
|
974
|
|
|
|
|
|
|
our $timeout=30;
|
975
|
|
|
|
|
|
|
if (defined $fa_code::timeout && $fa_code::timeout) {
|
976
|
|
|
|
|
|
|
$timeout=$fa_code::timeout;
|
977
|
|
|
|
|
|
|
}
|
978
|
|
|
|
|
|
|
our $log=0;
|
979
|
|
|
|
|
|
|
if (defined $fa_code::log && $fa_code::log) {
|
980
|
|
|
|
|
|
|
$log=$fa_code::log;
|
981
|
|
|
|
|
|
|
}
|
982
|
|
|
|
|
|
|
our $tosspass=0;
|
983
|
|
|
|
|
|
|
if (defined $fa_code::tosspass && $fa_code::tosspass) {
|
984
|
|
|
|
|
|
|
$tosspass=$fa_code::tosspass;
|
985
|
|
|
|
|
|
|
}
|
986
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
## End Net::FullAuto Settings
|
988
|
|
|
|
|
|
|
|
989
|
|
|
|
|
|
|
##############################################################
|
990
|
|
|
|
|
|
|
##############################################################
|
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
## Begin Term::Menus
|
993
|
|
|
|
|
|
|
|
994
|
|
|
|
|
|
|
our $termwidth=0;
|
995
|
|
|
|
|
|
|
our $termheight=0;
|
996
|
|
|
|
|
|
|
our $padwalker=0;
|
997
|
|
|
|
|
|
|
our $term_input=0;
|
998
|
|
|
|
|
|
|
eval { require Term::ReadKey };
|
999
|
|
|
|
|
|
|
unless ($@) {
|
1000
|
|
|
|
|
|
|
import Term::ReadKey;
|
1001
|
|
|
|
|
|
|
($termwidth,$termheight)=eval {
|
1002
|
1
|
|
|
1
|
|
9
|
no strict 'subs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
806
|
|
1003
|
|
|
|
|
|
|
my ($termwidth,$termheight)=('','');
|
1004
|
|
|
|
|
|
|
($termwidth, $termheight) =
|
1005
|
|
|
|
|
|
|
Term::ReadKey::GetTerminalSize();
|
1006
|
|
|
|
|
|
|
$termwidth||='';$termheight||='';
|
1007
|
|
|
|
|
|
|
return $termwidth,$termheight;
|
1008
|
|
|
|
|
|
|
};
|
1009
|
|
|
|
|
|
|
if ($@) {
|
1010
|
|
|
|
|
|
|
$termwidth='';$termheight='';
|
1011
|
|
|
|
|
|
|
}
|
1012
|
|
|
|
|
|
|
} else {
|
1013
|
|
|
|
|
|
|
$termwidth='';$termheight='';
|
1014
|
|
|
|
|
|
|
}
|
1015
|
|
|
|
|
|
|
if ($termwidth) {
|
1016
|
|
|
|
|
|
|
eval { require Term::RawInput };
|
1017
|
|
|
|
|
|
|
unless ($@) {
|
1018
|
|
|
|
|
|
|
$term_input=1;
|
1019
|
|
|
|
|
|
|
import Term::RawInput;
|
1020
|
|
|
|
|
|
|
}
|
1021
|
|
|
|
|
|
|
}
|
1022
|
|
|
|
|
|
|
eval { require PadWalker };
|
1023
|
|
|
|
|
|
|
unless ($@) {
|
1024
|
|
|
|
|
|
|
$padwalker=1;
|
1025
|
|
|
|
|
|
|
import PadWalker;
|
1026
|
|
|
|
|
|
|
}
|
1027
|
|
|
|
|
|
|
eval { require Devel::Symdump };
|
1028
|
|
|
|
|
|
|
unless ($@) {
|
1029
|
|
|
|
|
|
|
#$devel_symdump=1;
|
1030
|
|
|
|
|
|
|
import Devel::Symdump;
|
1031
|
|
|
|
|
|
|
}
|
1032
|
|
|
|
|
|
|
our $clearpath='';
|
1033
|
|
|
|
|
|
|
if ($^O ne 'MSWin32' && $^O ne 'MSWin64') {
|
1034
|
|
|
|
|
|
|
if (-e '/usr/bin/clear') {
|
1035
|
|
|
|
|
|
|
$clearpath='/usr/bin/';
|
1036
|
|
|
|
|
|
|
} elsif (-e '/bin/clear') {
|
1037
|
|
|
|
|
|
|
$clearpath='/bin/';
|
1038
|
|
|
|
|
|
|
} elsif (-e '/usr/local/bin/clear') {
|
1039
|
|
|
|
|
|
|
$clearpath='/usr/local/bin/';
|
1040
|
|
|
|
|
|
|
}
|
1041
|
|
|
|
|
|
|
}
|
1042
|
|
|
|
|
|
|
|
1043
|
|
|
|
|
|
|
our %LookUpMenuName=();
|
1044
|
|
|
|
|
|
|
our $MenuMap=[];
|
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
our $noclear=1; # set to one to turn off clear for debugging
|
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
sub check_for_dupe_menus {
|
1049
|
|
|
|
|
|
|
|
1050
|
0
|
|
|
0
|
0
|
|
my $m_flag=0;
|
1051
|
0
|
|
|
|
|
|
my $s_flag=0;
|
1052
|
0
|
|
|
|
|
|
foreach my $dir (@INC) {
|
1053
|
0
|
0
|
0
|
|
|
|
if (!$m_flag && -f "$dir/$Term::Menus::fa_menu") {
|
1054
|
0
|
|
|
|
|
|
$m_flag=1;
|
1055
|
0
|
|
|
|
|
|
open(FH,"<$dir/$Term::Menus::fa_menu");
|
1056
|
0
|
|
|
|
|
|
my $line='';my %menudups=();
|
|
0
|
|
|
|
|
|
|
1057
|
0
|
|
|
|
|
|
while ($line=) {
|
1058
|
0
|
0
|
|
|
|
|
if ($line=~/^[ \t]*\%(.*)\s*=/) {
|
1059
|
0
|
0
|
|
|
|
|
if (!exists $menudups{$1}) {
|
1060
|
0
|
|
|
|
|
|
$menudups{$1}='';
|
1061
|
|
|
|
|
|
|
} else {
|
1062
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;my $die='';
|
|
0
|
|
|
|
|
|
|
1063
|
0
|
|
|
|
|
|
$die="\n FATAL ERROR! - Duplicate Hash Blocks:"
|
1064
|
|
|
|
|
|
|
."\n -> \"%$1\" is defined more than once\n"
|
1065
|
|
|
|
|
|
|
." in the $dir/$mcmf file.\n\n"
|
1066
|
|
|
|
|
|
|
." Hint: delete or comment-out all duplicates\n\n";
|
1067
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1068
|
0
|
0
|
|
|
|
|
print $die if !$Net::FullAuto::FA_Core::cron;
|
1069
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die,'__cleanup__');
|
1070
|
0
|
|
|
|
|
|
} else { die $die }
|
1071
|
|
|
|
|
|
|
}
|
1072
|
|
|
|
|
|
|
}
|
1073
|
|
|
|
|
|
|
}
|
1074
|
|
|
|
|
|
|
}
|
1075
|
0
|
0
|
0
|
|
|
|
if (!$s_flag && -f "$dir/$Term::Menus::fa_code") {
|
1076
|
0
|
|
|
|
|
|
$s_flag=1;
|
1077
|
0
|
|
|
|
|
|
open(FH,"<$dir/$Term::Menus::fa_code");
|
1078
|
0
|
|
|
|
|
|
my $line='';my %dups=();
|
|
0
|
|
|
|
|
|
|
1079
|
0
|
|
|
|
|
|
while ($line=) {
|
1080
|
0
|
0
|
|
|
|
|
if ($line=~/^[ \t]*\%(.*)\s*=/) {
|
1081
|
0
|
0
|
|
|
|
|
if (!exists $dups{$1}) {
|
1082
|
0
|
|
|
|
|
|
$dups{$1}='';
|
1083
|
|
|
|
|
|
|
} else {
|
1084
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - Duplicate Hash Blocks:"
|
1085
|
|
|
|
|
|
|
."\n -> \"%$1\" is defined more "
|
1086
|
|
|
|
|
|
|
."than once\n in the $dir/"
|
1087
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
1088
|
|
|
|
|
|
|
." file.\n\n Hint: delete "
|
1089
|
|
|
|
|
|
|
."or comment-out all duplicates\n\n";
|
1090
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1091
|
0
|
0
|
|
|
|
|
print $die if !$Net::FullAuto::FA_Core::cron;
|
1092
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die,'__cleanup__');
|
1093
|
0
|
|
|
|
|
|
} else { die $die }
|
1094
|
|
|
|
|
|
|
}
|
1095
|
|
|
|
|
|
|
}
|
1096
|
|
|
|
|
|
|
}
|
1097
|
|
|
|
|
|
|
}
|
1098
|
|
|
|
|
|
|
}
|
1099
|
|
|
|
|
|
|
|
1100
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1101
|
0
|
|
|
|
|
|
foreach my $symname (keys %Term::Menus::) {
|
1102
|
0
|
0
|
|
|
|
|
if (eval "\\%$symname") {
|
1103
|
0
|
|
|
|
|
|
my $hashref=eval "\\%$symname";
|
1104
|
0
|
|
|
|
|
|
HF: foreach my $key (keys %{$hashref}) {
|
|
0
|
|
|
|
|
|
|
1105
|
0
|
0
|
|
|
|
|
if (ref $hashref->{$key} eq 'HASH') {
|
1106
|
0
|
|
|
|
|
|
foreach my $ky (keys %{$hashref->{$key}}) {
|
|
0
|
|
|
|
|
|
|
1107
|
0
|
0
|
|
|
|
|
if (lc($ky) eq 'text') {
|
1108
|
0
|
|
|
|
|
|
$LookUpMenuName{$hashref}=$symname;
|
1109
|
0
|
|
|
|
|
|
last HF;
|
1110
|
|
|
|
|
|
|
}
|
1111
|
|
|
|
|
|
|
}
|
1112
|
|
|
|
|
|
|
}
|
1113
|
|
|
|
|
|
|
}
|
1114
|
|
|
|
|
|
|
}
|
1115
|
|
|
|
|
|
|
}
|
1116
|
|
|
|
|
|
|
}
|
1117
|
|
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
}
|
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
&check_for_dupe_menus() if defined $main::fa_menu
|
1121
|
|
|
|
|
|
|
&& $main::fa_menu;
|
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
{
|
1124
|
1
|
|
|
1
|
|
565
|
use Sys::Hostname;
|
|
1
|
|
|
|
|
1114
|
|
|
1
|
|
|
|
|
601
|
|
1125
|
|
|
|
|
|
|
our $local_hostname=&Sys::Hostname::hostname();
|
1126
|
|
|
|
|
|
|
}
|
1127
|
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
my $count=0;
|
1129
|
|
|
|
|
|
|
our $blanklines='';
|
1130
|
|
|
|
|
|
|
if ($Term::Menus::termheight) {
|
1131
|
|
|
|
|
|
|
$count=$Term::Menus::termheight;
|
1132
|
|
|
|
|
|
|
} else { $count=30 }
|
1133
|
|
|
|
|
|
|
while ($count--) { $blanklines.="\n" }
|
1134
|
|
|
|
|
|
|
our $parent_menu='';
|
1135
|
|
|
|
|
|
|
|
1136
|
|
|
|
|
|
|
sub fa_login
|
1137
|
|
|
|
|
|
|
{
|
1138
|
0
|
|
|
0
|
0
|
|
my $code='';my $menu_args='';my $to='';my $die='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1139
|
0
|
|
|
|
|
|
my $start_menu_ref='';my $cache='';
|
|
0
|
|
|
|
|
|
|
1140
|
0
|
|
|
|
|
|
my $returned='';
|
1141
|
0
|
|
|
|
|
|
eval {
|
1142
|
0
|
|
|
|
|
|
($code,$menu_args,$to,$cache)=
|
1143
|
|
|
|
|
|
|
&Net::FullAuto::FA_Core::fa_login(@_);
|
1144
|
0
|
0
|
|
|
|
|
$main::cache=$cache if $cache;
|
1145
|
0
|
0
|
|
|
|
|
undef $main::cache unless $cache;
|
1146
|
0
|
|
|
|
|
|
my $mc=substr($Term::Menus::fa_menu,
|
1147
|
|
|
|
|
|
|
(rindex $Term::Menus::fa_menu,'/')+1,-3);
|
1148
|
0
|
|
|
|
|
|
$start_menu_ref=eval '$'.$mc.'::start_menu_ref';
|
1149
|
0
|
|
0
|
|
|
|
$to||=0;
|
1150
|
0
|
0
|
|
|
|
|
$timeout=$to if $to;
|
1151
|
0
|
0
|
|
|
|
|
if ($code) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1152
|
0
|
|
|
|
|
|
&run_sub($code,$menu_args);
|
1153
|
|
|
|
|
|
|
} elsif (ref $start_menu_ref eq 'HASH') {
|
1154
|
0
|
0
|
|
|
|
|
unless (keys %LookUpMenuName) {
|
1155
|
0
|
|
|
|
|
|
&check_for_dupe_menus();
|
1156
|
|
|
|
|
|
|
}
|
1157
|
0
|
0
|
|
|
|
|
if ($Net::FullAuto::FA_Core::plan) {
|
1158
|
0
|
|
|
|
|
|
my $plann=shift @{$Net::FullAuto::FA_Core::plan};
|
|
0
|
|
|
|
|
|
|
1159
|
0
|
|
|
|
|
|
my $return=eval $plann->{Item};
|
1160
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@,'-1') if $@;
|
1161
|
0
|
|
|
|
|
|
return $return;
|
1162
|
|
|
|
|
|
|
}
|
1163
|
0
|
|
|
|
|
|
$returned=&Menu($start_menu_ref);
|
1164
|
|
|
|
|
|
|
} elsif ($start_menu_ref) {
|
1165
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;
|
1166
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The top level menu "
|
1167
|
|
|
|
|
|
|
."block indicated\n by the "
|
1168
|
|
|
|
|
|
|
."\$start_menu_ref variable in the\n "
|
1169
|
|
|
|
|
|
|
." $mcmf file, does not exist as"
|
1170
|
|
|
|
|
|
|
."\n a properly constructed and"
|
1171
|
|
|
|
|
|
|
."\\or named hash\n block in the"
|
1172
|
|
|
|
|
|
|
." ".__PACKAGE__.".pm file\n\n Hint: "
|
1173
|
|
|
|
|
|
|
."our \$start_menu_ref=\\%Menu_1\;\n\n "
|
1174
|
|
|
|
|
|
|
."\[ Menu_1 is example - name you choose is"
|
1175
|
|
|
|
|
|
|
." optional \]\n\n %Menu_1=\(\n"
|
1176
|
|
|
|
|
|
|
." Item_1 => { ... },\n "
|
1177
|
|
|
|
|
|
|
."...\n \)\;\n";
|
1178
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1179
|
|
|
|
|
|
|
} else {
|
1180
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;
|
1181
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The \$start_menu_ref\n"
|
1182
|
|
|
|
|
|
|
." variable in the $mcmf\n"
|
1183
|
|
|
|
|
|
|
." file, is not defined or properly"
|
1184
|
|
|
|
|
|
|
."\n initialized with the name of "
|
1185
|
|
|
|
|
|
|
."the\n menu hash block designated"
|
1186
|
|
|
|
|
|
|
." for the\n top level menu.\n\n"
|
1187
|
|
|
|
|
|
|
." Hint: our \$start_menu_ref"
|
1188
|
|
|
|
|
|
|
."=\\%Menu_1\;\n\n \[ Menu_1 is example - "
|
1189
|
|
|
|
|
|
|
."name you choose is optional \]\n\n "
|
1190
|
|
|
|
|
|
|
."%Menu_1=\(\n Item_1 => { ... },\n"
|
1191
|
|
|
|
|
|
|
." ...\n \)\;\n";
|
1192
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1193
|
|
|
|
|
|
|
}
|
1194
|
|
|
|
|
|
|
};
|
1195
|
0
|
0
|
|
|
|
|
if ($@) {
|
1196
|
0
|
|
|
|
|
|
my $cmdlin=52;
|
1197
|
0
|
0
|
|
|
|
|
$cmdlin=47 if $code;
|
1198
|
0
|
|
|
|
|
|
my $errr=$@;
|
1199
|
0
|
|
|
|
|
|
$errr=~s/^\s*/\n /s;
|
1200
|
0
|
|
|
|
|
|
print $errr;
|
1201
|
|
|
|
|
|
|
}
|
1202
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::cleanup(0,$returned);
|
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
}
|
1205
|
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
|
sub run_sub
|
1207
|
|
|
|
|
|
|
{
|
1208
|
1
|
|
|
1
|
|
8
|
use if $Term::Menus::fullauto, "IO::Handle";
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
1209
|
1
|
|
|
1
|
|
59
|
use if $Term::Menus::fullauto, POSIX => qw(setsid);
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
1210
|
|
|
|
|
|
|
|
1211
|
0
|
0
|
0
|
0
|
0
|
|
if ($Term::Menus::fullauto && defined $Net::FullAuto::FA_Core::service
|
|
|
|
0
|
|
|
|
|
1212
|
|
|
|
|
|
|
&& $Net::FullAuto::FA_Core::service) {
|
1213
|
0
|
|
|
|
|
|
print "\n\n ##### TRANSITIONING TO SERVICE ######".
|
1214
|
|
|
|
|
|
|
"\n\n FullAuto will now continue running as".
|
1215
|
|
|
|
|
|
|
"\n as a Service/Daemon. Now exiting".
|
1216
|
|
|
|
|
|
|
"\n interactive mode ...\n\n";
|
1217
|
0
|
0
|
|
|
|
|
chdir '/' or die "Can't chdir to /: $!";
|
1218
|
0
|
|
|
|
|
|
umask 0;
|
1219
|
0
|
0
|
|
|
|
|
open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
|
1220
|
0
|
0
|
|
|
|
|
open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
|
1221
|
0
|
0
|
|
|
|
|
open STDERR, '>/dev/null' or die "Can't write to /dev/null: $!";
|
1222
|
0
|
0
|
|
|
|
|
defined(my $pid = fork) or die "Can't fork: $!";
|
1223
|
0
|
0
|
|
|
|
|
exit if $pid;
|
1224
|
0
|
0
|
|
|
|
|
$pid = &setsid or die "Can't start a new session: $!";
|
1225
|
|
|
|
|
|
|
}
|
1226
|
|
|
|
|
|
|
|
1227
|
0
|
|
|
|
|
|
my $code=$_[0];
|
1228
|
0
|
|
|
|
|
|
$code=~s/^[&]//;
|
1229
|
0
|
0
|
|
|
|
|
my $menu_args= (defined $_[1]) ? $_[1] : '';
|
1230
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3).'::'
|
1231
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
1232
|
0
|
|
0
|
|
|
|
$subfile||='';
|
1233
|
0
|
|
|
|
|
|
my $return=
|
1234
|
|
|
|
|
|
|
eval "\&$subfile$code\(\@{\$menu_args}\)";
|
1235
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@,'-1') if $@;
|
1236
|
0
|
|
|
|
|
|
return $return;
|
1237
|
|
|
|
|
|
|
}
|
1238
|
|
|
|
|
|
|
|
1239
|
|
|
|
|
|
|
sub get_all_hosts
|
1240
|
|
|
|
|
|
|
{
|
1241
|
0
|
|
|
0
|
0
|
|
return Net::FullAuto::FA_Core::get_all_hosts(@_);
|
1242
|
|
|
|
|
|
|
}
|
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
sub get_Menu_map_count
|
1245
|
|
|
|
|
|
|
{
|
1246
|
0
|
|
|
0
|
0
|
|
my $map_count=0;$count=0;
|
|
0
|
|
|
|
|
|
|
1247
|
0
|
|
|
|
|
|
foreach my $map (@{$_[0]}) {
|
|
0
|
|
|
|
|
|
|
1248
|
0
|
|
|
|
|
|
$count=$map->[0];
|
1249
|
0
|
0
|
|
|
|
|
$map_count=$count if $map_count<$count;
|
1250
|
|
|
|
|
|
|
}
|
1251
|
0
|
|
|
|
|
|
return $map_count;
|
1252
|
|
|
|
|
|
|
}
|
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
sub get_Menu_map
|
1255
|
|
|
|
|
|
|
{
|
1256
|
0
|
|
|
0
|
1
|
|
my %tmphash=();my @menu_picks=();
|
|
0
|
|
|
|
|
|
|
1257
|
0
|
|
|
|
|
|
foreach my $map (@{$MenuMap}) {
|
|
0
|
|
|
|
|
|
|
1258
|
0
|
|
|
|
|
|
$tmphash{$map->[0]}=$map->[1];
|
1259
|
|
|
|
|
|
|
}
|
1260
|
0
|
|
|
|
|
|
foreach my $number (sort numerically keys %tmphash) {
|
1261
|
0
|
|
|
|
|
|
push @menu_picks, $tmphash{$number};
|
1262
|
|
|
|
|
|
|
}
|
1263
|
0
|
|
|
|
|
|
return @menu_picks;
|
1264
|
|
|
|
|
|
|
}
|
1265
|
|
|
|
|
|
|
|
1266
|
|
|
|
|
|
|
sub eval_error
|
1267
|
|
|
|
|
|
|
{
|
1268
|
|
|
|
|
|
|
|
1269
|
0
|
|
0
|
0
|
0
|
|
my $log_handle=$_[1]||'';
|
1270
|
0
|
0
|
0
|
|
|
|
if (10
|
1271
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1272
|
|
|
|
|
|
|
-1
|
1273
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1274
|
0
|
|
|
|
|
|
close($log_handle);
|
1275
|
|
|
|
|
|
|
}
|
1276
|
0
|
|
|
|
|
|
die $_[0];
|
1277
|
|
|
|
|
|
|
} else {
|
1278
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
1279
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
1280
|
|
|
|
|
|
|
."Conveyed\n"
|
1281
|
|
|
|
|
|
|
." the Following "
|
1282
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
1283
|
|
|
|
|
|
|
." $_[0]\n line ".__LINE__;
|
1284
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1285
|
|
|
|
|
|
|
-1
|
1286
|
0
|
|
|
|
|
|
print $log_handle $die;
|
1287
|
0
|
|
|
|
|
|
close($log_handle);
|
1288
|
|
|
|
|
|
|
}
|
1289
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1290
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1291
|
0
|
|
|
|
|
|
} else { die $die }
|
1292
|
|
|
|
|
|
|
}
|
1293
|
|
|
|
|
|
|
}
|
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
sub banner
|
1296
|
|
|
|
|
|
|
{
|
1297
|
|
|
|
|
|
|
|
1298
|
0
|
|
0
|
0
|
0
|
|
my $banner=$_[0]||'';
|
1299
|
0
|
0
|
|
|
|
|
return '' unless $banner;
|
1300
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||{};
|
1301
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[2]||'';
|
1302
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[3]||'';
|
1303
|
0
|
0
|
|
|
|
|
my $numbor=(defined $_[4])?$_[4]:'';
|
1304
|
0
|
|
0
|
|
|
|
my $ikey=$_[5]||'';
|
1305
|
0
|
|
0
|
|
|
|
my $input=$_[6]||{};
|
1306
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[7]||{};
|
1307
|
0
|
|
0
|
|
|
|
my $log_handle=$_[8]||'';
|
1308
|
0
|
|
0
|
|
|
|
$banner||='';
|
1309
|
0
|
0
|
0
|
|
|
|
if (ref $banner eq 'CODE') {
|
|
|
0
|
|
|
|
|
|
1310
|
0
|
|
|
|
|
|
my $banner_code=$banner;
|
1311
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
1312
|
0
|
|
|
|
|
|
$banner_code=
|
1313
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($banner_code)->Out();
|
1314
|
0
|
|
|
|
|
|
$banner_code=&transform_pmsi($banner_code,
|
1315
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1316
|
|
|
|
|
|
|
}
|
1317
|
|
|
|
|
|
|
#print "WHAT IS CDNOW2=$banner_code<==\n";;
|
1318
|
0
|
|
|
|
|
|
$banner_code=~s/\$CODE\d*\s*=\s*//s;
|
1319
|
|
|
|
|
|
|
#print "WHAT IS CDREALLYNOW=$banner_code<==\n";;
|
1320
|
0
|
|
|
|
|
|
my $eval_banner_code=eval $banner_code;
|
1321
|
0
|
|
0
|
0
|
|
|
$eval_banner_code||=sub {};
|
1322
|
0
|
|
|
|
|
|
my $die="\n"
|
1323
|
|
|
|
|
|
|
." FATAL ERROR! - Error in Banner => sub{ *CONTENT* },\n"
|
1324
|
|
|
|
|
|
|
." code block. To find error, copy the\n"
|
1325
|
|
|
|
|
|
|
." *CONTENT* to a separate script, and\n"
|
1326
|
|
|
|
|
|
|
." test for the error there. Use the\n"
|
1327
|
|
|
|
|
|
|
." 'use strict;' pragma.\n\n";
|
1328
|
0
|
|
|
|
|
|
eval {
|
1329
|
0
|
|
|
|
|
|
$banner=$eval_banner_code->();
|
1330
|
|
|
|
|
|
|
};
|
1331
|
0
|
0
|
|
|
|
|
if ($@) {
|
1332
|
0
|
0
|
0
|
|
|
|
if (10
|
1333
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1334
|
0
|
|
|
|
|
|
return '',$@
|
1335
|
|
|
|
|
|
|
}
|
1336
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1337
|
|
|
|
|
|
|
-1
|
1338
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1339
|
0
|
|
|
|
|
|
close($log_handle);
|
1340
|
|
|
|
|
|
|
}
|
1341
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1342
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
1343
|
0
|
|
|
|
|
|
} else { die $@ }
|
1344
|
|
|
|
|
|
|
} else {
|
1345
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1346
|
0
|
|
|
|
|
|
return '',$die.' '.$@
|
1347
|
|
|
|
|
|
|
}
|
1348
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1349
|
|
|
|
|
|
|
-1
|
1350
|
0
|
|
|
|
|
|
print $log_handle $die.' '.$@;
|
1351
|
0
|
|
|
|
|
|
close($log_handle);
|
1352
|
|
|
|
|
|
|
}
|
1353
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1354
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
1355
|
|
|
|
|
|
|
$die.' '.$@);
|
1356
|
0
|
|
|
|
|
|
} else { die $die.' '.$@ }
|
1357
|
|
|
|
|
|
|
}
|
1358
|
|
|
|
|
|
|
}
|
1359
|
0
|
|
|
|
|
|
} elsif (keys %{$Conveyed} || $picks_from_parent) {
|
1360
|
0
|
|
|
|
|
|
$banner=&transform_pmsi($banner,
|
1361
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1362
|
|
|
|
|
|
|
} else {
|
1363
|
0
|
|
|
|
|
|
chomp($banner);
|
1364
|
|
|
|
|
|
|
}
|
1365
|
0
|
0
|
0
|
|
|
|
if ($banner && ($banner=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1366
|
0
|
|
|
|
|
|
&& grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) &&
|
1367
|
|
|
|
|
|
|
defined $picks_from_parent &&
|
1368
|
|
|
|
|
|
|
!ref $picks_from_parent) {
|
1369
|
0
|
|
|
|
|
|
my @banner=();
|
1370
|
0
|
0
|
|
|
|
|
if ($banner!~/::/) {
|
1371
|
0
|
|
|
|
|
|
$banner=~s/^[&]//;
|
1372
|
0
|
|
|
|
|
|
eval "\@banner=main::$banner";
|
1373
|
|
|
|
|
|
|
} else {
|
1374
|
0
|
|
|
|
|
|
eval "\@banner=$banner";
|
1375
|
|
|
|
|
|
|
}
|
1376
|
0
|
|
|
|
|
|
$banner=join '',@banner;
|
1377
|
|
|
|
|
|
|
}
|
1378
|
0
|
|
|
|
|
|
return transform_mbio(transform_mbii(transform_mbir(
|
1379
|
|
|
|
|
|
|
$banner,$Conveyed,$MenuUnit_hash_ref,
|
1380
|
|
|
|
|
|
|
$log_handle),$numbor,$ikey,$input,
|
1381
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed,$log_handle),$MenuUnit_hash_ref,
|
1382
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent,$log_handle);
|
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
}
|
1385
|
|
|
|
|
|
|
|
1386
|
|
|
|
|
|
|
sub Menu
|
1387
|
|
|
|
|
|
|
{
|
1388
|
|
|
|
|
|
|
#print "MENUCALLER=",(caller)[0]," and ",__PACKAGE__,"\n";;
|
1389
|
|
|
|
|
|
|
#print "MENUCALLER=",caller,"\n";
|
1390
|
0
|
|
|
0
|
1
|
|
my $MenuUnit_hash_ref=$_[0];
|
1391
|
|
|
|
|
|
|
#print "WHAT IS THIS=",&Data::Dump::Streamer::Dump($MenuUnit_hash_ref)->Out(),"\n";
|
1392
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name}=&pw($MenuUnit_hash_ref);
|
1393
|
0
|
|
|
|
|
|
my $select_many=0;
|
1394
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Select}) {
|
1395
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Select} &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1396
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select} &&
|
1397
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}=~/many/i) {
|
1398
|
0
|
|
|
|
|
|
$select_many='Many';
|
1399
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1400
|
|
|
|
|
|
|
} elsif (exists $MenuUnit_hash_ref->{Select} &&
|
1401
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select} &&
|
1402
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}=~/one/i) {
|
1403
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1404
|
|
|
|
|
|
|
}
|
1405
|
|
|
|
|
|
|
} else {
|
1406
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1407
|
|
|
|
|
|
|
}
|
1408
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[1]||'';
|
1409
|
0
|
|
|
|
|
|
my $log_handle='';
|
1410
|
0
|
0
|
0
|
|
|
|
if ($picks_from_parent && -1
|
1411
|
0
|
|
|
|
|
|
$log_handle=$picks_from_parent;
|
1412
|
0
|
|
|
|
|
|
$picks_from_parent='';
|
1413
|
|
|
|
|
|
|
}
|
1414
|
0
|
|
|
|
|
|
my $unattended=0;
|
1415
|
0
|
0
|
|
|
|
|
if ($picks_from_parent=~/\](Cron|Batch|Unattended|FullAuto)\[/i) {
|
1416
|
0
|
|
|
|
|
|
$unattended=1;
|
1417
|
0
|
|
|
|
|
|
undef $picks_from_parent;
|
1418
|
|
|
|
|
|
|
}
|
1419
|
0
|
0
|
|
|
|
|
my $recurse = (defined $_[2]) ? $_[2] : 0;
|
1420
|
0
|
0
|
|
|
|
|
my $FullMenu= (defined $_[3]) ? $_[3] : {};
|
1421
|
0
|
0
|
|
|
|
|
my $Selected= (defined $_[4]) ? $_[4] : {};
|
1422
|
0
|
0
|
|
|
|
|
my $Conveyed= (defined $_[5]) ? $_[5] : {};
|
1423
|
0
|
0
|
|
|
|
|
my $SavePick= (defined $_[6]) ? $_[6] : {};
|
1424
|
0
|
0
|
|
|
|
|
my $SaveMMap= (defined $_[7]) ? $_[7] : {};
|
1425
|
0
|
0
|
|
|
|
|
my $SaveNext= (defined $_[8]) ? $_[8] : {};
|
1426
|
0
|
0
|
|
|
|
|
my $Persists= (defined $_[9]) ? $_[9] : {};
|
1427
|
0
|
0
|
|
|
|
|
my $parent_menu= (defined $_[10]) ? $_[10] : '';
|
1428
|
0
|
|
|
|
|
|
my $no_wantarray=0;
|
1429
|
|
|
|
|
|
|
|
1430
|
0
|
0
|
0
|
|
|
|
if ((defined $_[11] && $_[11]) ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1431
|
|
|
|
|
|
|
((caller)[0] ne __PACKAGE__ && !wantarray)) {
|
1432
|
0
|
|
|
|
|
|
$no_wantarray=1;
|
1433
|
|
|
|
|
|
|
}
|
1434
|
0
|
0
|
0
|
|
|
|
if (defined $_[12] && $_[12]) {
|
1435
|
0
|
|
|
|
|
|
return '','','','','','','','','','','',$_[12];
|
1436
|
|
|
|
|
|
|
}
|
1437
|
0
|
0
|
0
|
|
|
|
if (defined $_[13] && $_[13]) {
|
1438
|
0
|
|
|
|
|
|
$log_handle=$_[13];
|
1439
|
|
|
|
|
|
|
}
|
1440
|
0
|
|
|
|
|
|
my %Items=();my %negate=();my %result=();my %convey=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1441
|
0
|
|
|
|
|
|
my %chosen=();my %default=();my %select=();my %mark=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1442
|
0
|
|
|
|
|
|
my $pick='';my $picks=[];my %num__=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1443
|
0
|
|
|
|
|
|
my $display_this_many_items=10;my $die_err='';
|
|
0
|
|
|
|
|
|
|
1444
|
0
|
|
|
|
|
|
my $master_substituted='';my $convey='';$mark{BLANK}=1;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1445
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
1446
|
0
|
|
|
|
|
|
my $num=0;my @convey=();my $filtered=0;my $sorted='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1447
|
0
|
|
|
|
|
|
foreach my $key (keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
1448
|
0
|
0
|
0
|
|
|
|
if (4
|
1449
|
0
|
|
|
|
|
|
$Items{substr($key,5)}=$MenuUnit_hash_ref->{$key};
|
1450
|
|
|
|
|
|
|
}
|
1451
|
|
|
|
|
|
|
}
|
1452
|
0
|
0
|
|
|
|
|
$Persists->{unattended}=$unattended if $unattended;
|
1453
|
|
|
|
|
|
|
my $start=($FullMenu->{$MenuUnit_hash_ref}[11])?
|
1454
|
0
|
0
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]:0;
|
1455
|
|
|
|
|
|
|
|
1456
|
|
|
|
|
|
|
############################################
|
1457
|
|
|
|
|
|
|
# Breakdown the MenuUnit into its Components
|
1458
|
|
|
|
|
|
|
############################################
|
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
# Breakdown Each Item into its Components
|
1461
|
|
|
|
|
|
|
#########################################
|
1462
|
|
|
|
|
|
|
|
1463
|
0
|
|
|
|
|
|
my $got_item_flag=0;
|
1464
|
0
|
|
|
|
|
|
while (++$num) {
|
1465
|
0
|
|
0
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]||0;
|
1466
|
0
|
|
|
|
|
|
@convey=();
|
1467
|
0
|
0
|
|
|
|
|
unless (exists $Items{$num}) {
|
1468
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Banner} && !$got_item_flag) {
|
1469
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
1470
|
0
|
|
|
|
|
|
} else { last }
|
1471
|
|
|
|
|
|
|
} else {
|
1472
|
0
|
|
|
|
|
|
$got_item_flag=1;
|
1473
|
|
|
|
|
|
|
}
|
1474
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Negate} &&
|
1475
|
0
|
|
|
|
|
|
!(keys %{$MenuUnit_hash_ref->{Select}})) {
|
1476
|
0
|
|
|
|
|
|
my $die="Can Only Use \"Negate =>\""
|
1477
|
|
|
|
|
|
|
."\n\t\tElement in ".__PACKAGE__.".pm when the"
|
1478
|
|
|
|
|
|
|
."\n\t\t\"Select =>\" Element is set to \'Many\'\n\n";
|
1479
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die)
|
1480
|
|
|
|
|
|
|
if $Term::Menus::fullauto;
|
1481
|
0
|
|
|
|
|
|
die $die;
|
1482
|
|
|
|
|
|
|
}
|
1483
|
0
|
|
|
|
|
|
my $con_regex=qr/\]c(o+nvey)*\[/i;
|
1484
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Convey}) {
|
|
|
0
|
|
|
|
|
|
1485
|
0
|
|
|
|
|
|
my $convey_test=$Items{$num}->{Convey};
|
1486
|
0
|
0
|
0
|
|
|
|
if (ref $Items{$num}->{Convey} eq 'ARRAY') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1487
|
0
|
|
|
|
|
|
foreach my $line (@{$Items{$num}->{Convey}}) {
|
|
0
|
|
|
|
|
|
|
1488
|
0
|
|
|
|
|
|
push @convey, $line;
|
1489
|
|
|
|
|
|
|
}
|
1490
|
|
|
|
|
|
|
} elsif (ref $Items{$num}->{Convey} eq 'CODE') {
|
1491
|
0
|
|
|
|
|
|
my $convey_code=$Items{$num}->{Convey};
|
1492
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
1493
|
0
|
|
|
|
|
|
$convey_code=
|
1494
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($convey_code)->Out();
|
1495
|
|
|
|
|
|
|
#print "PICKSFROMPARENTXX=$picks_from_parent AND CONVEY_CODE=$convey_code\n";
|
1496
|
0
|
|
|
|
|
|
$convey_code=&transform_pmsi($convey_code,
|
1497
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1498
|
|
|
|
|
|
|
}
|
1499
|
|
|
|
|
|
|
#print "WHAT IS CDNOW1=$convey_code<==\n";
|
1500
|
0
|
|
|
|
|
|
$convey_code=~s/\$CODE\d*\s*=\s*//s;
|
1501
|
|
|
|
|
|
|
#print "WHAT IS CDREALLYNOW=$convey_code<==\n";;
|
1502
|
0
|
|
|
|
|
|
my $eval_convey_code=eval $convey_code;
|
1503
|
0
|
|
0
|
0
|
|
|
$eval_convey_code||=sub {};
|
1504
|
0
|
|
|
|
|
|
@convey=$eval_convey_code->();
|
1505
|
0
|
0
|
|
|
|
|
@convey=@{$convey[0]} if ref $convey[0] eq 'ARRAY';
|
|
0
|
|
|
|
|
|
|
1506
|
0
|
0
|
|
|
|
|
if ($@) {
|
1507
|
0
|
0
|
0
|
|
|
|
if (10
|
1508
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
1509
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
1510
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
1511
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
1512
|
|
|
|
|
|
|
}
|
1513
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1514
|
|
|
|
|
|
|
-1
|
1515
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1516
|
0
|
|
|
|
|
|
close($log_handle);
|
1517
|
|
|
|
|
|
|
}
|
1518
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1519
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
1520
|
0
|
|
|
|
|
|
} else { die $@ }
|
1521
|
|
|
|
|
|
|
} else {
|
1522
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
1523
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
1524
|
|
|
|
|
|
|
."Conveyed\n"
|
1525
|
|
|
|
|
|
|
." the Following "
|
1526
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
1527
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
1528
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
1529
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
1530
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
1531
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
1532
|
|
|
|
|
|
|
}
|
1533
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1534
|
|
|
|
|
|
|
-1
|
1535
|
0
|
|
|
|
|
|
print $log_handle $die;
|
1536
|
0
|
|
|
|
|
|
close($log_handle);
|
1537
|
|
|
|
|
|
|
}
|
1538
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1539
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1540
|
0
|
|
|
|
|
|
} else { die $die }
|
1541
|
|
|
|
|
|
|
}
|
1542
|
|
|
|
|
|
|
}
|
1543
|
0
|
0
|
0
|
|
|
|
if (0==$#convey && $convey[0]=~/^(?:[{](.*)[}])?[<]$/) {
|
1544
|
0
|
|
|
|
|
|
return \@convey;
|
1545
|
|
|
|
|
|
|
}
|
1546
|
|
|
|
|
|
|
} elsif ($convey_test=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
1547
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
1548
|
0
|
0
|
0
|
|
|
|
if (defined $picks_from_parent &&
|
1549
|
|
|
|
|
|
|
!ref $picks_from_parent) {
|
1550
|
|
|
|
|
|
|
my $transformed_convey=
|
1551
|
|
|
|
|
|
|
&transform_pmsi($Items{$num}->{Convey},
|
1552
|
0
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1553
|
|
|
|
|
|
|
$picks_from_parent);
|
1554
|
0
|
0
|
|
|
|
|
if ($transformed_convey!~/::/) {
|
1555
|
0
|
|
|
|
|
|
$transformed_convey=~s/^[&]//;
|
1556
|
0
|
|
|
|
|
|
eval "\@convey=main::$transformed_convey";
|
1557
|
|
|
|
|
|
|
} else {
|
1558
|
0
|
|
|
|
|
|
eval "\@convey=$transformed_convey";
|
1559
|
|
|
|
|
|
|
}
|
1560
|
|
|
|
|
|
|
}
|
1561
|
|
|
|
|
|
|
} else {
|
1562
|
0
|
|
|
|
|
|
push @convey, $Items{$num}->{Convey};
|
1563
|
|
|
|
|
|
|
}
|
1564
|
0
|
|
|
|
|
|
foreach my $item (@convey) {
|
1565
|
0
|
0
|
|
|
|
|
next if $item=~/^\s*$/s;
|
1566
|
0
|
|
|
|
|
|
my $text=$Items{$num}->{Text};
|
1567
|
0
|
|
|
|
|
|
$text=~s/$con_regex/$item/g;
|
1568
|
0
|
|
|
|
|
|
$text=&transform_pmsi($text,
|
1569
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1570
|
|
|
|
|
|
|
$picks_from_parent);
|
1571
|
0
|
0
|
|
|
|
|
if (-1
|
1572
|
0
|
|
|
|
|
|
$text=~
|
1573
|
|
|
|
|
|
|
s/__Master_${$}__/Local-Host: $Term::Menus::local_hostname/sg;
|
1574
|
0
|
|
|
|
|
|
$master_substituted="Local-Host: $Term::Menus::local_hostname";
|
1575
|
|
|
|
|
|
|
}
|
1576
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Include}) {
|
|
|
0
|
|
|
|
|
|
1577
|
0
|
0
|
|
|
|
|
if ($text=~/$Items{$num}->{Include}/s) {
|
1578
|
|
|
|
|
|
|
next if exists $Items{$num}->{Exclude} &&
|
1579
|
0
|
0
|
0
|
|
|
|
$text=~/$Items{$num}->{Exclude}/;
|
1580
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1581
|
|
|
|
|
|
|
} else {
|
1582
|
0
|
|
|
|
|
|
next;
|
1583
|
|
|
|
|
|
|
}
|
1584
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Exclude} &&
|
1585
|
|
|
|
|
|
|
$text=~/$Items{$num}->{Exclude}/) {
|
1586
|
0
|
|
|
|
|
|
next;
|
1587
|
|
|
|
|
|
|
} else {
|
1588
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1589
|
|
|
|
|
|
|
}
|
1590
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Convey} &&
|
|
|
0
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
$Items{$num}->{Convey} ne '') {
|
1592
|
0
|
|
|
|
|
|
$convey{$text}=[$item,$Items{$num}->{Convey}];
|
1593
|
|
|
|
|
|
|
} elsif (!exists $Items{$num}->{Convey}) {
|
1594
|
0
|
|
|
|
|
|
$convey{$text}=[$item,''];
|
1595
|
|
|
|
|
|
|
}
|
1596
|
|
|
|
|
|
|
$default{$text}=$Items{$num}->{Default}
|
1597
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Default};
|
1598
|
|
|
|
|
|
|
#print "WHAT IS THIS=$text and NEGATE=",$Items{$num}->{Negate}," and KEYS=",keys %{$Items{$num}},"\n";
|
1599
|
|
|
|
|
|
|
$negate{$text}=$Items{$num}->{Negate}
|
1600
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Negate};
|
1601
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[2]{$text}) {
|
|
|
0
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
$result{$text}=
|
1603
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$text};
|
1604
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Result}) {
|
1605
|
|
|
|
|
|
|
$result{$text}=$Items{$num}->{Result}
|
1606
|
0
|
|
|
|
|
|
}
|
1607
|
0
|
|
|
|
|
|
my $tsttt=$Items{$num}->{Select};
|
1608
|
|
|
|
|
|
|
$select{$text}=$Items{$num}->{Select}
|
1609
|
|
|
|
|
|
|
if exists $Items{$num}->{Select}
|
1610
|
0
|
0
|
0
|
|
|
|
&& $tsttt=~/many/i;
|
1611
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Mark}) {
|
1612
|
0
|
|
|
|
|
|
$mark{$text}=$Items{$num}->{Mark};
|
1613
|
0
|
|
|
|
|
|
my $lmt=length $mark{$text};
|
1614
|
0
|
0
|
|
|
|
|
$mark{BLANK}=$lmt if $mark{BLANK}<$lmt;
|
1615
|
|
|
|
|
|
|
}
|
1616
|
0
|
0
|
|
|
|
|
$filtered=1 if exists $Items{$num}->{Filter};
|
1617
|
|
|
|
|
|
|
$sorted=$Items{$num}->{Sort}
|
1618
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Sort};
|
1619
|
0
|
|
|
|
|
|
$chosen{$text}="Item_$num";
|
1620
|
|
|
|
|
|
|
}
|
1621
|
|
|
|
|
|
|
} elsif ($show_banner_only) {
|
1622
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
1623
|
0
|
|
|
|
|
|
$result{'__FA_Banner__'}=$MenuUnit_hash_ref->{Result};
|
1624
|
0
|
|
|
|
|
|
} last;
|
1625
|
|
|
|
|
|
|
} else {
|
1626
|
|
|
|
|
|
|
my $text=&transform_pmsi($Items{$num}->{Text},
|
1627
|
0
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1628
|
|
|
|
|
|
|
$picks_from_parent);
|
1629
|
0
|
0
|
|
|
|
|
if (-1{Text},"__Master_${$}__") {
|
1630
|
0
|
|
|
|
|
|
$text=~
|
1631
|
|
|
|
|
|
|
s/__Master_${$}__/Local-Host: $Term::Menus::local_hostname/sg;
|
1632
|
0
|
|
|
|
|
|
$master_substituted=
|
1633
|
|
|
|
|
|
|
"Local-Host: $Term::Menus::local_hostname";
|
1634
|
|
|
|
|
|
|
}
|
1635
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Include}) {
|
|
|
0
|
|
|
|
|
|
1636
|
0
|
0
|
|
|
|
|
if ($Items{$num}->{Text}=~/$Items{$num}->{Include}/) {
|
1637
|
|
|
|
|
|
|
next if exists $Items{$num}->{Exclude} &&
|
1638
|
0
|
0
|
0
|
|
|
|
$Items{$num}->{Text}=~/$Items{$num}->{Exclude}/;
|
1639
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1640
|
0
|
|
|
|
|
|
} else { next }
|
1641
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Exclude} &&
|
1642
|
|
|
|
|
|
|
$Items{$num}->{Text}=~/$Items{$num}->{Exclude}/) {
|
1643
|
0
|
|
|
|
|
|
next;
|
1644
|
0
|
|
|
|
|
|
} else { push @{$picks}, $text }
|
|
0
|
|
|
|
|
|
|
1645
|
|
|
|
|
|
|
$convey{$Items{$num}->{Text}}=['',$Items{$num}->{Convey}]
|
1646
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Convey};
|
1647
|
|
|
|
|
|
|
$default{$text}=$Items{$num}->{Default}
|
1648
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Default};
|
1649
|
|
|
|
|
|
|
$negate{$text}=$Items{$num}->{Negate}
|
1650
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Negate};
|
1651
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[2]{$text}) {
|
|
|
0
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
$result{$text}=
|
1653
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$text};
|
1654
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Result}) {
|
1655
|
|
|
|
|
|
|
$result{$text}=$Items{$num}->{Result}
|
1656
|
0
|
|
|
|
|
|
}
|
1657
|
0
|
|
0
|
|
|
|
my $tsttt=$Items{$num}->{Select}||'';
|
1658
|
|
|
|
|
|
|
$select{$text}=$Items{$num}->{Select}
|
1659
|
|
|
|
|
|
|
if exists $Items{$num}->{Select}
|
1660
|
0
|
0
|
0
|
|
|
|
&& $tsttt=~/many/i;
|
1661
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Mark}) {
|
1662
|
0
|
|
|
|
|
|
$mark{$text}=$Items{$num}->{Mark};
|
1663
|
0
|
|
|
|
|
|
my $lmt=length $mark{$text};
|
1664
|
0
|
0
|
|
|
|
|
$mark{BLANK}=$lmt if $mark{BLANK}<$lmt;
|
1665
|
|
|
|
|
|
|
}
|
1666
|
0
|
0
|
|
|
|
|
$filtered=1 if exists $Items{$num}->{Filter};
|
1667
|
|
|
|
|
|
|
$sorted=$Items{$num}->{Sort}
|
1668
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Sort};
|
1669
|
0
|
|
|
|
|
|
$chosen{$text}="Item_$num";
|
1670
|
|
|
|
|
|
|
$num__{$text}=$Items{$num}->{__NUM__}
|
1671
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{__NUM__};
|
1672
|
|
|
|
|
|
|
}
|
1673
|
|
|
|
|
|
|
}
|
1674
|
|
|
|
|
|
|
|
1675
|
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
|
#########################################
|
1677
|
|
|
|
|
|
|
# End Items Breakdown
|
1678
|
|
|
|
|
|
|
|
1679
|
|
|
|
|
|
|
$display_this_many_items=$_[0]->{Display}
|
1680
|
0
|
0
|
|
|
|
|
if exists $_[0]->{Display};
|
1681
|
|
|
|
|
|
|
|
1682
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Scroll} &&
|
1683
|
|
|
|
|
|
|
ref $MenuUnit_hash_ref->{Scroll} ne 'ARRAY') {
|
1684
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}=
|
1685
|
0
|
|
|
|
|
|
[ $MenuUnit_hash_ref->{Scroll},1 ];
|
1686
|
|
|
|
|
|
|
}
|
1687
|
|
|
|
|
|
|
|
1688
|
|
|
|
|
|
|
############################################
|
1689
|
|
|
|
|
|
|
# End MenuUnit Breakdown
|
1690
|
|
|
|
|
|
|
############################################
|
1691
|
|
|
|
|
|
|
|
1692
|
0
|
0
|
|
|
|
|
%default=() if defined $FullMenu->{$MenuUnit_hash_ref}[5];
|
1693
|
0
|
0
|
|
|
|
|
my $nm_=(keys %num__)?\%num__:{};
|
1694
|
|
|
|
|
|
|
#print "MENU=",$MenuUnit_hash_ref->{Name}," and CONVEY=",keys %convey,"\n";;
|
1695
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}=[ $MenuUnit_hash_ref,
|
1696
|
|
|
|
|
|
|
\%negate,\%result,\%convey,\%chosen,\%default,
|
1697
|
|
|
|
|
|
|
\%select,\%mark,$nm_,$filtered,$picks,$start ];
|
1698
|
0
|
0
|
0
|
|
|
|
if ($select_many || keys %{$MenuUnit_hash_ref->{Select}}) {
|
|
0
|
|
|
|
|
|
|
1699
|
0
|
|
|
|
|
|
my @filtered_menu_return=();
|
1700
|
0
|
|
|
|
|
|
my $error='';
|
1701
|
|
|
|
|
|
|
($pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1702
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1703
|
|
|
|
|
|
|
@filtered_menu_return,$error)=&pick(
|
1704
|
0
|
|
0
|
|
|
|
$picks,$MenuUnit_hash_ref->{Banner}||'',
|
1705
|
|
|
|
|
|
|
$display_this_many_items,'','',
|
1706
|
|
|
|
|
|
|
$MenuUnit_hash_ref,++$recurse,
|
1707
|
|
|
|
|
|
|
$picks_from_parent,$parent_menu,
|
1708
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,$SavePick,
|
1709
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
1710
|
|
|
|
|
|
|
$no_wantarray,$sorted,
|
1711
|
|
|
|
|
|
|
$select_many);
|
1712
|
0
|
0
|
|
|
|
|
if (-1<$#filtered_menu_return) {
|
1713
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1714
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1715
|
|
|
|
|
|
|
$filtered_menu_return[0],$filtered_menu_return[1],
|
1716
|
|
|
|
|
|
|
$filtered_menu_return[2];
|
1717
|
|
|
|
|
|
|
}
|
1718
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && $master_substituted) {
|
1719
|
0
|
|
|
|
|
|
$pick=~s/$master_substituted/__Master_${$}__/sg;
|
1720
|
|
|
|
|
|
|
}
|
1721
|
0
|
0
|
0
|
|
|
|
if ($pick eq ']quit[') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1722
|
0
|
|
|
|
|
|
return ']quit['
|
1723
|
|
|
|
|
|
|
} elsif ($pick eq '-' || $pick eq '+') {
|
1724
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1725
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1726
|
|
|
|
|
|
|
} elsif ($pick=~/DONE/) {
|
1727
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1728
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1729
|
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY' && wantarray
|
1730
|
|
|
|
|
|
|
&& !$no_wantarray && 1==$recurse) {
|
1731
|
0
|
0
|
|
|
|
|
if (ref $pick->[$#{$pick}] eq 'HASH') {
|
|
0
|
|
|
|
|
|
|
1732
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1733
|
0
|
|
|
|
|
|
pop @choyce;
|
1734
|
0
|
|
|
|
|
|
pop @choyce;
|
1735
|
|
|
|
|
|
|
return @choyce
|
1736
|
0
|
|
|
|
|
|
}
|
1737
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1738
|
|
|
|
|
|
|
return @choyce
|
1739
|
0
|
|
|
|
|
|
} elsif ($pick) { return $pick }
|
|
0
|
|
|
|
|
|
|
1740
|
|
|
|
|
|
|
} else {
|
1741
|
0
|
|
|
|
|
|
my @filtered_menu_return=();
|
1742
|
0
|
|
|
|
|
|
my $error='';
|
1743
|
|
|
|
|
|
|
($pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1744
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1745
|
|
|
|
|
|
|
@filtered_menu_return,$error)
|
1746
|
0
|
|
0
|
|
|
|
=&pick($picks,$MenuUnit_hash_ref->{Banner}||'',
|
1747
|
|
|
|
|
|
|
$display_this_many_items,
|
1748
|
|
|
|
|
|
|
'','',$MenuUnit_hash_ref,++$recurse,
|
1749
|
|
|
|
|
|
|
$picks_from_parent,$parent_menu,
|
1750
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,$SavePick,
|
1751
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
1752
|
|
|
|
|
|
|
$no_wantarray,$sorted,
|
1753
|
|
|
|
|
|
|
$select_many);
|
1754
|
0
|
0
|
|
|
|
|
if (-1<$#filtered_menu_return) {
|
1755
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1756
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1757
|
|
|
|
|
|
|
$filtered_menu_return[0],$filtered_menu_return[1],
|
1758
|
|
|
|
|
|
|
$filtered_menu_return[2];
|
1759
|
|
|
|
|
|
|
}
|
1760
|
|
|
|
|
|
|
#print "WAHT IS ALL=",keys %{$pick->[0]}," and FULL=$FullMenu and SEL=$Selected and CON=$Conveyed and SAVE=$SavePick and LAST=$SaveMMap and NEXT=$SaveNext and PERSISTS=$Persists and PARENT=$parent_menu<==\n";
|
1761
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && $master_substituted) {
|
1762
|
0
|
|
|
|
|
|
$pick=~s/$master_substituted/__Master_${$}__/sg;
|
1763
|
|
|
|
|
|
|
}
|
1764
|
0
|
0
|
0
|
|
|
|
if ($pick eq ']quit[') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1765
|
0
|
|
|
|
|
|
return ']quit['
|
1766
|
|
|
|
|
|
|
} elsif ($pick eq '-' || $pick eq '+') {
|
1767
|
0
|
0
|
|
|
|
|
unless (keys %{$SavePick->{$MenuUnit_hash_ref}}) {
|
|
0
|
0
|
|
|
|
|
|
1768
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1769
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1770
|
0
|
0
|
|
|
|
|
} elsif ($select_many || keys %{$Selected->{$MenuUnit_hash_ref}}) {
|
|
0
|
|
|
|
|
|
|
1771
|
0
|
|
|
|
|
|
return '+',$FullMenu,$Selected,$Conveyed,
|
1772
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1773
|
|
|
|
|
|
|
} else {
|
1774
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1775
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1776
|
|
|
|
|
|
|
}
|
1777
|
|
|
|
|
|
|
} elsif ($pick=~/DONE/) {
|
1778
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1779
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1780
|
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY') {
|
1781
|
0
|
|
|
|
|
|
my $topmenu='';
|
1782
|
0
|
|
|
|
|
|
my $savpick='';
|
1783
|
0
|
0
|
0
|
|
|
|
if (1==$recurse && ref $pick->[$#{$pick}] eq 'HASH') {
|
|
0
|
|
|
|
|
|
|
1784
|
0
|
|
|
|
|
|
$topmenu=pop @{$pick};
|
|
0
|
|
|
|
|
|
|
1785
|
0
|
|
|
|
|
|
$savpick=pop @{$pick};
|
|
0
|
|
|
|
|
|
|
1786
|
|
|
|
|
|
|
}
|
1787
|
0
|
0
|
0
|
|
|
|
if (wantarray && 1==$recurse) {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1788
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
return @choyce
|
1790
|
0
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY' && -1<$#{$pick} &&
|
|
0
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
$pick->[0]=~/^[{](.*)[}][<]$/) {
|
1792
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1793
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1794
|
|
|
|
|
|
|
} elsif (!$picks_from_parent &&
|
1795
|
|
|
|
|
|
|
!(keys %{$MenuUnit_hash_ref->{Select}})) {
|
1796
|
0
|
0
|
0
|
|
|
|
if (ref $topmenu eq 'HASH' && (keys %{$topmenu->{Select}} &&
|
|
0
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1797
|
|
|
|
|
|
|
$topmenu->{Select} eq 'Many') || (ref $savpick eq 'HASH' &&
|
1798
|
0
|
|
|
|
|
|
exists $topmenu->{Select}->{(keys %{$savpick})[0]})) {
|
1799
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1800
|
0
|
|
|
|
|
|
return @{$pick}
|
|
0
|
|
|
|
|
|
|
1801
|
|
|
|
|
|
|
} else {
|
1802
|
0
|
|
|
|
|
|
return $pick;
|
1803
|
|
|
|
|
|
|
}
|
1804
|
0
|
|
|
|
|
|
} elsif (-1==$#{$pick} &&
|
1805
|
|
|
|
|
|
|
(ref $topmenu eq 'HASH') &&
|
1806
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$topmenu})) {
|
|
0
|
|
|
|
|
|
|
1807
|
0
|
|
|
|
|
|
return [ $topmenu ];
|
1808
|
|
|
|
|
|
|
} else {
|
1809
|
0
|
|
|
|
|
|
return $pick->[0];
|
1810
|
|
|
|
|
|
|
}
|
1811
|
|
|
|
|
|
|
} else {
|
1812
|
0
|
0
|
|
|
|
|
if ($picks_from_parent) {
|
1813
|
0
|
|
|
|
|
|
$pick->[0]=&transform_pmsi($pick->[0],
|
1814
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1815
|
|
|
|
|
|
|
}
|
1816
|
0
|
|
|
|
|
|
return $pick
|
1817
|
|
|
|
|
|
|
}
|
1818
|
0
|
|
|
|
|
|
} elsif ($pick) { return $pick }
|
1819
|
|
|
|
|
|
|
}
|
1820
|
|
|
|
|
|
|
|
1821
|
|
|
|
|
|
|
}
|
1822
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
sub pw {
|
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
## pw [p]ad [w]alker
|
1826
|
|
|
|
|
|
|
#print "PWCALLER=",caller,"\n";
|
1827
|
|
|
|
|
|
|
return $_[0]->{Name} if ref $_[0] eq 'HASH'
|
1828
|
0
|
0
|
0
|
0
|
0
|
|
&& exists $_[0]->{Name};
|
1829
|
0
|
|
|
|
|
|
my @packages=();
|
1830
|
0
|
0
|
0
|
|
|
|
@packages=@{$_[1]} if defined $_[1] && $_[1];
|
|
0
|
|
|
|
|
|
|
1831
|
0
|
|
|
|
|
|
my $name='';
|
1832
|
0
|
0
|
|
|
|
|
unless (ref $_[0] eq 'HASH') {
|
1833
|
0
|
|
|
|
|
|
return '';
|
1834
|
|
|
|
|
|
|
} else {
|
1835
|
0
|
|
|
|
|
|
my $flag=1;
|
1836
|
0
|
|
|
|
|
|
my $n=0;
|
1837
|
0
|
|
|
|
|
|
WH: while (1) {
|
1838
|
|
|
|
|
|
|
{
|
1839
|
0
|
|
|
|
|
|
local $SIG{__DIE__}; # No sigdie handler
|
|
0
|
|
|
|
|
|
|
1840
|
0
|
|
|
|
|
|
eval {
|
1841
|
0
|
|
|
|
|
|
$name=PadWalker::var_name($n++,$_[0]);
|
1842
|
|
|
|
|
|
|
};
|
1843
|
0
|
0
|
|
|
|
|
if ($@) {
|
1844
|
0
|
|
|
|
|
|
undef $@;
|
1845
|
0
|
|
|
|
|
|
my $o=0;
|
1846
|
0
|
|
|
|
|
|
while (1) {
|
1847
|
0
|
|
|
|
|
|
eval {
|
1848
|
0
|
|
|
|
|
|
my $vars=PadWalker::peek_our($o++);
|
1849
|
0
|
|
|
|
|
|
foreach my $key (keys %{$vars}) {
|
|
0
|
|
|
|
|
|
|
1850
|
0
|
0
|
0
|
|
|
|
if (ref $vars->{$key} eq 'HASH' &&
|
1851
|
0
|
|
|
|
|
|
%{$_[0]} eq %{$vars->{$key}}) {
|
|
0
|
|
|
|
|
|
|
1852
|
0
|
|
|
|
|
|
$name=$key;
|
1853
|
0
|
|
|
|
|
|
last;
|
1854
|
|
|
|
|
|
|
}
|
1855
|
|
|
|
|
|
|
}
|
1856
|
|
|
|
|
|
|
};
|
1857
|
0
|
0
|
|
|
|
|
if ($@) {
|
1858
|
0
|
|
|
|
|
|
undef $@;
|
1859
|
0
|
|
|
|
|
|
my $s=0;
|
1860
|
0
|
|
|
|
|
|
unshift @packages, 'main';
|
1861
|
0
|
|
|
|
|
|
PK: foreach my $package (@packages) {
|
1862
|
0
|
|
|
|
|
|
my $obj=Devel::Symdump->rnew($package);
|
1863
|
0
|
|
|
|
|
|
foreach my $hash ($obj->hashes) {
|
1864
|
0
|
0
|
|
|
|
|
next if $hash=~/^_;
|
1865
|
0
|
0
|
|
|
|
|
next if $hash=~/^Term::Menus::/;
|
1866
|
0
|
0
|
|
|
|
|
next if $hash=~/^Config::/;
|
1867
|
0
|
0
|
|
|
|
|
next if $hash=~/^DynaLoader::/;
|
1868
|
0
|
0
|
|
|
|
|
next if $hash=~/^warnings::/;
|
1869
|
0
|
0
|
|
|
|
|
next if $hash=~/^utf8::/;
|
1870
|
0
|
0
|
|
|
|
|
next if $hash=~/^Carp::/;
|
1871
|
0
|
0
|
|
|
|
|
next if $hash=~/^fields::attr/;
|
1872
|
0
|
0
|
|
|
|
|
next if $hash=~/^Text::Balanced::/;
|
1873
|
0
|
0
|
|
|
|
|
next if $hash=~/^Data::Dump::Streamer/;
|
1874
|
0
|
0
|
|
|
|
|
next if $hash=~/^re::EXPORT_OK/;
|
1875
|
0
|
0
|
|
|
|
|
next if $hash=~/^fa_code::email_addresses/;
|
1876
|
0
|
0
|
|
|
|
|
next if $hash=~/^fa_code::email_defaults/;
|
1877
|
0
|
0
|
|
|
|
|
next if $hash=~/^PadWalker::/;
|
1878
|
0
|
0
|
|
|
|
|
next if $hash=~/^Fcntl::/;
|
1879
|
0
|
0
|
|
|
|
|
next if $hash=~/^B::Utils::/;
|
1880
|
0
|
0
|
|
|
|
|
next if $hash=~/^ExtUtils::/;
|
1881
|
0
|
0
|
|
|
|
|
next if $hash=~/^Exporter::/;
|
1882
|
0
|
0
|
|
|
|
|
next if $hash=~/^Moo::/;
|
1883
|
0
|
0
|
|
|
|
|
next if $hash=~/^overload::/;
|
1884
|
0
|
0
|
|
|
|
|
next if $hash=~/^Term::ReadKey::/;
|
1885
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::INC/;
|
1886
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::SIG/;
|
1887
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::ENV/;
|
1888
|
0
|
0
|
|
|
|
|
next if $hash=~/^main[:][^\w]*$/;
|
1889
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::[@]$/;
|
1890
|
0
|
0
|
|
|
|
|
next if $hash=~/^Net::FullAuto::FA_Core::makeplan/;
|
1891
|
0
|
0
|
|
|
|
|
next if $hash=~
|
1892
|
|
|
|
|
|
|
/^Net::FullAuto::FA_Core::admin_menus/;
|
1893
|
0
|
|
|
|
|
|
my %test=eval "%$hash";
|
1894
|
0
|
0
|
|
|
|
|
$name=$hash if %test eq %{$_[0]};
|
|
0
|
|
|
|
|
|
|
1895
|
0
|
0
|
|
|
|
|
last PK if $name;
|
1896
|
|
|
|
|
|
|
}
|
1897
|
|
|
|
|
|
|
}
|
1898
|
0
|
|
0
|
|
|
|
$name||='';
|
1899
|
0
|
|
|
|
|
|
$name=~s/^.*::(.*)$/$1/;
|
1900
|
0
|
|
|
|
|
|
last WH;
|
1901
|
|
|
|
|
|
|
}
|
1902
|
0
|
0
|
|
|
|
|
last WH if $name;
|
1903
|
|
|
|
|
|
|
}
|
1904
|
|
|
|
|
|
|
}
|
1905
|
0
|
0
|
|
|
|
|
last if $name;
|
1906
|
|
|
|
|
|
|
};
|
1907
|
|
|
|
|
|
|
}
|
1908
|
0
|
|
0
|
|
|
|
$name||='';
|
1909
|
0
|
|
|
|
|
|
$name=~s/^%//;
|
1910
|
0
|
0
|
|
|
|
|
return $name if $name;
|
1911
|
|
|
|
|
|
|
}
|
1912
|
|
|
|
|
|
|
}
|
1913
|
|
|
|
|
|
|
|
1914
|
|
|
|
|
|
|
sub list_module {
|
1915
|
0
|
|
|
0
|
0
|
|
my @modules = @_;
|
1916
|
0
|
|
|
|
|
|
my @result=();
|
1917
|
1
|
|
|
1
|
|
5770
|
no strict 'refs';
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
53678
|
|
1918
|
0
|
|
|
|
|
|
foreach my $module (@modules) {
|
1919
|
0
|
|
|
|
|
|
$module=~s/\.pm$//;
|
1920
|
0
|
|
|
|
|
|
push @result,grep { defined &{"$module\::$_"} } keys %{"$module\::"};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
|
}
|
1922
|
0
|
|
|
|
|
|
return @result;
|
1923
|
|
|
|
|
|
|
}
|
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
sub test_hashref {
|
1926
|
|
|
|
|
|
|
|
1927
|
0
|
|
|
0
|
0
|
|
my $hashref_to_test=$_[0];
|
1928
|
0
|
0
|
|
|
|
|
if (ref $hashref_to_test eq 'HASH') {
|
1929
|
0
|
0
|
0
|
|
|
|
if (grep { /Item_/ } keys %{$hashref_to_test}) {
|
|
0
|
0
|
0
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
1930
|
0
|
|
|
|
|
|
return 1;
|
1931
|
|
|
|
|
|
|
} elsif (exists $hashref_to_test->{Input} &&
|
1932
|
|
|
|
|
|
|
$hashref_to_test->{Input}) {
|
1933
|
0
|
|
|
|
|
|
return 1;
|
1934
|
0
|
|
|
|
|
|
} elsif (!grep { /Item_/ } keys %{$hashref_to_test}
|
1935
|
|
|
|
|
|
|
&& grep { /Banner/ } keys %{$hashref_to_test}) {
|
1936
|
0
|
|
|
|
|
|
return 1;
|
1937
|
|
|
|
|
|
|
} else {
|
1938
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - Unable to verify Menu\n"
|
1939
|
|
|
|
|
|
|
."\n This Error is usually the result of a Menu"
|
1940
|
|
|
|
|
|
|
."\n block that does not contain properly"
|
1941
|
|
|
|
|
|
|
."\n coded Item blocks or was not coded"
|
1942
|
|
|
|
|
|
|
."\n ABOVE the parent Menu hash block"
|
1943
|
|
|
|
|
|
|
."\n (Example: 1), or not coded with"
|
1944
|
|
|
|
|
|
|
."\n GLOBAL scope (Example: 2).\n"
|
1945
|
|
|
|
|
|
|
."\n Example 1:"
|
1946
|
|
|
|
|
|
|
."\n my %Example_Menu=( \# ABOVE parent"
|
1947
|
|
|
|
|
|
|
."\n \# Best Practice"
|
1948
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1949
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1950
|
|
|
|
|
|
|
."\n },"
|
1951
|
|
|
|
|
|
|
."\n );"
|
1952
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
1953
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1954
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1955
|
|
|
|
|
|
|
."\n Result => \%Example_Menu,"
|
1956
|
|
|
|
|
|
|
."\n },"
|
1957
|
|
|
|
|
|
|
."\n );\n"
|
1958
|
|
|
|
|
|
|
."\n"
|
1959
|
|
|
|
|
|
|
."\n Example 2:"
|
1960
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
1961
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1962
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1963
|
|
|
|
|
|
|
."\n Result => \%Example_Menu,"
|
1964
|
|
|
|
|
|
|
."\n },"
|
1965
|
|
|
|
|
|
|
."\n );"
|
1966
|
|
|
|
|
|
|
."\n our %Example_Menu=( \# GLOBAL scope"
|
1967
|
|
|
|
|
|
|
."\n \# Note: 'our' pragma"
|
1968
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1969
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1970
|
|
|
|
|
|
|
."\n },"
|
1971
|
|
|
|
|
|
|
."\n );\n"
|
1972
|
|
|
|
|
|
|
."\n";
|
1973
|
0
|
|
|
|
|
|
die $die;
|
1974
|
|
|
|
|
|
|
}
|
1975
|
0
|
|
|
|
|
|
} else { return 0 }
|
1976
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
}
|
1978
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
sub transform_sicm
|
1980
|
|
|
|
|
|
|
{
|
1981
|
|
|
|
|
|
|
|
1982
|
|
|
|
|
|
|
#print "TRANSFORM_SICM_CALLER=",caller,"\n";
|
1983
|
|
|
|
|
|
|
## sicm - [s]elected [i]tems [c]urrent [m]enu
|
1984
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
1985
|
0
|
|
0
|
|
|
|
my $numbor=$_[1]||-1;
|
1986
|
0
|
|
0
|
|
|
|
my $all_menu_items_array=$_[2]||'';
|
1987
|
0
|
|
0
|
|
|
|
my $picks=$_[3]||'';
|
1988
|
0
|
|
0
|
|
|
|
my $pn=$_[4]||'';
|
1989
|
0
|
|
0
|
|
|
|
my $return_from_child_menu=$_[5]||'';
|
1990
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
1991
|
0
|
|
0
|
|
|
|
my $current_menu_name=$_[7]||'';
|
1992
|
0
|
|
|
|
|
|
my $selected=[];my $replace='';
|
|
0
|
|
|
|
|
|
|
1993
|
0
|
|
|
|
|
|
my $expand_array_flag=0;
|
1994
|
0
|
|
|
|
|
|
my $sicm_regex=
|
1995
|
|
|
|
|
|
|
qr/\](!)?s(?:e+lected[-_]*)*i*(?:t+ems[-_]*)
|
1996
|
|
|
|
|
|
|
*c*(?:u+rrent[-_]*)*m*(?:e+nu[-_]*)*\[/xi;
|
1997
|
0
|
|
|
|
|
|
my $tsmi_regex=qr/\](!)?t(?:e+st[-_]*)*s*(?:e+lected[-_]*)
|
1998
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
1999
|
0
|
0
|
0
|
|
|
|
if ((-1
|
2000
|
0
|
0
|
0
|
|
|
|
unless ($text=~/^\s*\]\[\[\s*/s && $text=~/\s*\]\]\[\s*$/s) {
|
2001
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The --RETURN-ARRAY-- Macro"
|
2002
|
|
|
|
|
|
|
."\n Boundary indicators: '][[' and ']]['"
|
2003
|
|
|
|
|
|
|
."\n are only supported at the beginning"
|
2004
|
|
|
|
|
|
|
."\n and end of the return instructions."
|
2005
|
|
|
|
|
|
|
."\n Nothing but white space should precede"
|
2006
|
|
|
|
|
|
|
."\n the left indicator, nor extend beyond"
|
2007
|
|
|
|
|
|
|
."\n the right indicator.\n"
|
2008
|
|
|
|
|
|
|
."\n Your String:\n"
|
2009
|
|
|
|
|
|
|
."\n $text\n"
|
2010
|
|
|
|
|
|
|
."\n Remedy: Recreate your return instructions"
|
2011
|
|
|
|
|
|
|
."\n to conform to this convention. Also"
|
2012
|
|
|
|
|
|
|
."\n be sure to use the Macro delimiter"
|
2013
|
|
|
|
|
|
|
."\n indicator ']|[' to denote return array"
|
2014
|
|
|
|
|
|
|
."\n element separation boundaries."
|
2015
|
|
|
|
|
|
|
."\n Example:\n"
|
2016
|
|
|
|
|
|
|
."\n '][[ ]S[ ]|[ ]P[{Menu_One} ]|[ SomeString ]]['"
|
2017
|
|
|
|
|
|
|
."\n";
|
2018
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2019
|
|
|
|
|
|
|
-1
|
2020
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2021
|
0
|
|
|
|
|
|
close($log_handle);
|
2022
|
|
|
|
|
|
|
}
|
2023
|
|
|
|
|
|
|
}
|
2024
|
0
|
|
|
|
|
|
$expand_array_flag=1;
|
2025
|
|
|
|
|
|
|
}
|
2026
|
0
|
|
|
|
|
|
my @pks=keys %{$picks};
|
|
0
|
|
|
|
|
|
|
2027
|
0
|
0
|
0
|
|
|
|
if (0<$#pks && !$return_from_child_menu) {
|
2028
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %{$picks}) {
|
|
0
|
|
|
|
|
|
|
2029
|
0
|
|
|
|
|
|
push @{$selected},$all_menu_items_array->[$key-1];
|
|
0
|
|
|
|
|
|
|
2030
|
|
|
|
|
|
|
}
|
2031
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($selected)->Out();
|
2032
|
0
|
|
|
|
|
|
$replace=~s/\$ARRAY\d*\s*=\s*//s;
|
2033
|
0
|
|
|
|
|
|
$replace=~s/\;\s*$//s;
|
2034
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2035
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2036
|
|
|
|
|
|
|
}
|
2037
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2038
|
|
|
|
|
|
|
} else {
|
2039
|
0
|
0
|
|
|
|
|
if (ref $pn eq 'HASH') {
|
|
|
0
|
|
|
|
|
|
2040
|
0
|
|
0
|
|
|
|
$pn->{$numbor}->[1]||=1; #COMEHERE
|
2041
|
0
|
|
|
|
|
|
$replace=$all_menu_items_array->[$pn->{$numbor}->[1]-1];
|
2042
|
|
|
|
|
|
|
} elsif ($pn) {
|
2043
|
0
|
|
|
|
|
|
$replace=$all_menu_items_array->[$pn];
|
2044
|
|
|
|
|
|
|
} else {
|
2045
|
0
|
|
0
|
|
|
|
$replace=$all_menu_items_array->[$numbor-1]||'';
|
2046
|
|
|
|
|
|
|
}
|
2047
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2048
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2049
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2050
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2051
|
|
|
|
|
|
|
}
|
2052
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2053
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tsmi_regex,$sicm_regex) {
|
2054
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2055
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\\\{([^}]+)\})*)/sg) {
|
2056
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2057
|
0
|
|
|
|
|
|
my $esc_one=$1;
|
2058
|
0
|
|
|
|
|
|
my $bang=$2;
|
2059
|
0
|
|
|
|
|
|
my $menu=$3;
|
2060
|
0
|
|
0
|
|
|
|
$menu||='';
|
2061
|
0
|
|
|
|
|
|
$esc_one=~s/\[/\\\[/;$esc_one=~s/\]/\\\]/;
|
|
0
|
|
|
|
|
|
|
2062
|
0
|
0
|
|
|
|
|
$replace=~s/\s*//s if $text=~/[)]\s*$/s;
|
2063
|
0
|
0
|
|
|
|
|
if ($menu) {
|
2064
|
0
|
0
|
|
|
|
|
if (-1
|
2065
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/sg;
|
2066
|
|
|
|
|
|
|
} else {
|
2067
|
0
|
|
|
|
|
|
$test_regx_flag=0;
|
2068
|
|
|
|
|
|
|
}
|
2069
|
0
|
|
|
|
|
|
next;
|
2070
|
|
|
|
|
|
|
}
|
2071
|
0
|
|
|
|
|
|
$text=~s/$esc_one(?![{])/$replace/g;
|
2072
|
|
|
|
|
|
|
}
|
2073
|
|
|
|
|
|
|
}
|
2074
|
0
|
|
|
|
|
|
return $text;
|
2075
|
|
|
|
|
|
|
|
2076
|
|
|
|
|
|
|
}
|
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
sub transform_mbio
|
2079
|
|
|
|
|
|
|
{
|
2080
|
|
|
|
|
|
|
|
2081
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2082
|
0
|
|
0
|
|
|
|
my $input=$_[1]||{};
|
2083
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[2]||{};
|
2084
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[3]||'';
|
2085
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[4]||'';
|
2086
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[5]||'';
|
2087
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
2088
|
0
|
|
|
|
|
|
my $tobi_regex=qr/\](!)?o(?:u+tput[-_]*)*b*(?:a+nner[-_]*)
|
2089
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2090
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2091
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tobi_regex) {
|
2092
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2093
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2094
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2095
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2096
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2097
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2098
|
0
|
|
|
|
|
|
my $esc_two=$esc_one;
|
2099
|
0
|
|
|
|
|
|
$esc_two=~s/\]/\\\]/;$esc_two=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2100
|
0
|
|
|
|
|
|
$esc_one=~s/^\]/\[\]\]/;$esc_one=~s/^(.*?)\[\{/$1\[\[\]{/;
|
|
0
|
|
|
|
|
|
|
2101
|
0
|
|
|
|
|
|
$esc_one=~s/^(.*?[]])[{](.*)[}]$/$1\[\{\]$2\[\}\]/;
|
2102
|
0
|
|
|
|
|
|
my $instructions=$esc_two;
|
2103
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2104
|
0
|
|
|
|
|
|
$instructions=~/^(.*?),(.*?)$/;
|
2105
|
0
|
|
|
|
|
|
my $input_macro=$1;my $code=$2;
|
|
0
|
|
|
|
|
|
|
2106
|
0
|
|
|
|
|
|
$code=~s/["']//g;
|
2107
|
0
|
|
|
|
|
|
$code="\$main::$code";
|
2108
|
0
|
|
|
|
|
|
my $input_text=$input->{$input_macro};
|
2109
|
0
|
|
|
|
|
|
$code=eval $code;
|
2110
|
0
|
|
|
|
|
|
my $cd=&Data::Dump::Streamer::Dump($code)->Out();
|
2111
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
2112
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2113
|
|
|
|
|
|
|
$picks_from_parent);
|
2114
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
2115
|
0
|
|
|
|
|
|
$code=eval $cd;
|
2116
|
0
|
|
|
|
|
|
my $output='';
|
2117
|
0
|
0
|
|
|
|
|
$output=$code->($input_text) if $input_text!~/^\s*$/;
|
2118
|
0
|
|
|
|
|
|
my $out_height=$output=~tr/\n//;
|
2119
|
0
|
|
|
|
|
|
my @output=split /\n/,$output;
|
2120
|
0
|
|
|
|
|
|
my @newtext=();
|
2121
|
0
|
|
|
|
|
|
foreach my $line (split "\n",$text) {
|
2122
|
0
|
0
|
|
|
|
|
if ($line=~/^(.*)$esc_one(.*)$/) {
|
2123
|
0
|
|
|
|
|
|
my $front_of_line=$1;my $back_of_line=$2;
|
|
0
|
|
|
|
|
|
|
2124
|
0
|
|
|
|
|
|
my $frlen=length $front_of_line;
|
2125
|
0
|
|
0
|
|
|
|
my $bottomline=pop @output||'';
|
2126
|
0
|
|
|
|
|
|
$bottomline=$front_of_line.$bottomline.$back_of_line;
|
2127
|
0
|
|
|
|
|
|
foreach my $ln (@output) {
|
2128
|
0
|
|
|
|
|
|
my $pad=sprintf "%-${frlen}s",'';
|
2129
|
0
|
|
|
|
|
|
push @newtext,$pad.$ln;
|
2130
|
|
|
|
|
|
|
}
|
2131
|
0
|
|
|
|
|
|
push @newtext,$bottomline;
|
2132
|
|
|
|
|
|
|
} else {
|
2133
|
0
|
|
|
|
|
|
push @newtext,$line;
|
2134
|
|
|
|
|
|
|
}
|
2135
|
0
|
|
|
|
|
|
} $text=join "\n",@newtext;
|
2136
|
|
|
|
|
|
|
}
|
2137
|
|
|
|
|
|
|
}
|
2138
|
0
|
|
|
|
|
|
return $text,$input;
|
2139
|
|
|
|
|
|
|
|
2140
|
|
|
|
|
|
|
}
|
2141
|
|
|
|
|
|
|
|
2142
|
|
|
|
|
|
|
sub transform_mbir
|
2143
|
|
|
|
|
|
|
{
|
2144
|
|
|
|
|
|
|
|
2145
|
|
|
|
|
|
|
## mbir - [m]enu [b]anner [i]nput [r]esults
|
2146
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2147
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||{};
|
2148
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[2]||'';
|
2149
|
0
|
|
0
|
|
|
|
my $log_handle=$_[3]||'';
|
2150
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2151
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2152
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2153
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tbii_regex) {
|
2154
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2155
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2156
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2157
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2158
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2159
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2160
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2161
|
0
|
|
|
|
|
|
my $instructions=$esc_one;
|
2162
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2163
|
0
|
|
|
|
|
|
$instructions='('.$instructions.')';
|
2164
|
0
|
|
|
|
|
|
my @instructions=eval $instructions;
|
2165
|
0
|
0
|
|
|
|
|
next if $#instructions==2;
|
2166
|
0
|
0
|
|
|
|
|
if ($#instructions==1) {
|
2167
|
0
|
0
|
|
|
|
|
if (exists $Conveyed->{$instructions[0].'_mbir'}) {
|
2168
|
0
|
|
|
|
|
|
my $item=$instructions[0].'_mbir';
|
2169
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$item}->{$instructions[1]};
|
2170
|
0
|
|
|
|
|
|
$esc_one=~s/[{]/\\{/g;
|
2171
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/s;
|
2172
|
|
|
|
|
|
|
}
|
2173
|
|
|
|
|
|
|
}
|
2174
|
|
|
|
|
|
|
}
|
2175
|
0
|
|
|
|
|
|
} return $text;
|
2176
|
|
|
|
|
|
|
}
|
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
sub transform_mbii
|
2179
|
|
|
|
|
|
|
{
|
2180
|
|
|
|
|
|
|
|
2181
|
|
|
|
|
|
|
## mbii - [m]enu [b]anner [i]nput [i]tems
|
2182
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2183
|
0
|
0
|
|
|
|
|
my $numbor=(defined $_[1])?$_[1]:'';
|
2184
|
0
|
|
0
|
|
|
|
my $ikey=$_[2]||'';
|
2185
|
0
|
|
0
|
|
|
|
my $input=$_[3]||{};
|
2186
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[4]||{};
|
2187
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[5]||'';
|
2188
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
2189
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2190
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2191
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2192
|
0
|
0
|
0
|
|
|
|
if ($ikey eq 'TAB' && exists $input->{focus}) {
|
2193
|
0
|
|
|
|
|
|
$input->{focus}->[0]=$input->{focus}->[2]->{$input->{focus}->[0]};
|
2194
|
0
|
|
|
|
|
|
$ikey='';$numbor='';
|
|
0
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
}
|
2196
|
|
|
|
|
|
|
|
2197
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tbii_regex) {
|
2198
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2199
|
0
|
|
|
|
|
|
my $fill_focus=0;
|
2200
|
0
|
0
|
|
|
|
|
$fill_focus=1 unless exists $input->{focus};
|
2201
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2202
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2203
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2204
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2205
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2206
|
0
|
|
|
|
|
|
my $esc_two=$esc_one;
|
2207
|
0
|
|
|
|
|
|
$esc_two=~s/\]/\\\]/;$esc_two=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2208
|
0
|
|
|
|
|
|
$esc_one=~s/^\]/\[\]\]/;$esc_one=~s/^(.*?)\[\{/$1\[\[\]{/;
|
|
0
|
|
|
|
|
|
|
2209
|
0
|
|
|
|
|
|
$esc_one=~s/^(.*?[]])[{](.*)[}]$/$1\[\{\]$2\[\}\]/;
|
2210
|
0
|
|
|
|
|
|
my $instructions=$esc_two;
|
2211
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2212
|
0
|
|
|
|
|
|
$instructions='('.$instructions.')';
|
2213
|
0
|
|
|
|
|
|
my @instructions=eval $instructions;
|
2214
|
0
|
0
|
|
|
|
|
unless (exists $input->{$instructions[0]}) {
|
2215
|
0
|
|
|
|
|
|
$input->{$instructions[0]}=$instructions[1];
|
2216
|
0
|
|
|
|
|
|
$numbor='';
|
2217
|
|
|
|
|
|
|
}
|
2218
|
|
|
|
|
|
|
$input->{$instructions[0]}='' unless defined
|
2219
|
0
|
0
|
|
|
|
|
$input->{$instructions[0]};
|
2220
|
0
|
0
|
|
|
|
|
if ($fill_focus) {
|
2221
|
0
|
0
|
|
|
|
|
unless (exists $input->{focus}) {
|
2222
|
0
|
|
|
|
|
|
my $default_focus=$instructions[0];
|
2223
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Focus} &&
|
2224
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Focus}) {
|
2225
|
0
|
|
|
|
|
|
$default_focus=$MenuUnit_hash_ref->{Focus};
|
2226
|
|
|
|
|
|
|
}
|
2227
|
0
|
|
|
|
|
|
$input->{focus}=[$default_focus,[$instructions[0]],{}];
|
2228
|
|
|
|
|
|
|
} else {
|
2229
|
|
|
|
|
|
|
$input->{focus}->[2]->{
|
2230
|
0
|
|
|
|
|
|
$input->{focus}->[1][$#{$input->{focus}->[1]}]}
|
|
0
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
=$instructions[0];
|
2232
|
0
|
|
|
|
|
|
push @{$input->{focus}->[1]},$instructions[0];
|
|
0
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
$input->{focus}->[2]->{$instructions[0]}=
|
2234
|
0
|
|
|
|
|
|
$input->{focus}->[1]->[0];
|
2235
|
|
|
|
|
|
|
}
|
2236
|
|
|
|
|
|
|
}
|
2237
|
0
|
|
|
|
|
|
my @newtext=();
|
2238
|
0
|
|
|
|
|
|
foreach my $line (split "\n",$text) {
|
2239
|
0
|
0
|
|
|
|
|
if ($line=~/^(.*)$esc_one(.*)$/) {
|
2240
|
0
|
|
|
|
|
|
my $front_of_line=$1;my $back_of_line=$2;
|
|
0
|
|
|
|
|
|
|
2241
|
0
|
|
|
|
|
|
my $box_top_bottom='';my @sides=('| ',' |');
|
|
0
|
|
|
|
|
|
|
2242
|
0
|
0
|
0
|
|
|
|
if ($#instructions==2 and $instructions[2]>0) {
|
2243
|
0
|
0
|
|
|
|
|
if ($input->{focus}->[0] eq $instructions[0]) {
|
2244
|
0
|
|
|
|
|
|
for (1..$instructions[2]) {
|
2245
|
0
|
|
|
|
|
|
$box_top_bottom.='=';
|
2246
|
|
|
|
|
|
|
}
|
2247
|
0
|
|
|
|
|
|
@sides=('[ ',' ]');
|
2248
|
|
|
|
|
|
|
} else {
|
2249
|
0
|
|
|
|
|
|
for (1..$instructions[2]) {
|
2250
|
0
|
|
|
|
|
|
$box_top_bottom.='-';
|
2251
|
|
|
|
|
|
|
}
|
2252
|
|
|
|
|
|
|
}
|
2253
|
|
|
|
|
|
|
}
|
2254
|
0
|
0
|
|
|
|
|
if ($input->{focus}->[0] eq $instructions[0]) {
|
2255
|
0
|
0
|
0
|
|
|
|
if ($ikey eq 'BACKSPACE') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2256
|
0
|
|
|
|
|
|
chop $input->{$instructions[0]};
|
2257
|
|
|
|
|
|
|
} elsif ($ikey eq 'DELETE') {
|
2258
|
0
|
|
|
|
|
|
$input->{$instructions[0]}='';
|
2259
|
|
|
|
|
|
|
} elsif ($ikey ne 'TAB' && defined $numbor) {
|
2260
|
0
|
|
|
|
|
|
my $length_input=length $input->{$instructions[0]};
|
2261
|
0
|
|
|
|
|
|
my $length_box=$instructions[2];
|
2262
|
0
|
0
|
|
|
|
|
if ($length_input>$length_box) {
|
2263
|
0
|
|
|
|
|
|
print "\n\n WARNING! - input exceeds box size!";
|
2264
|
0
|
|
|
|
|
|
print "\n\n You may have forgotten to [TAB] to the".
|
2265
|
|
|
|
|
|
|
"\n next box, or the input for the next box".
|
2266
|
|
|
|
|
|
|
"\n box has a TAB in it - usually at the".
|
2267
|
|
|
|
|
|
|
"\n front of the string. Use a text editor".
|
2268
|
|
|
|
|
|
|
"\n to see and remove it before pasting".
|
2269
|
|
|
|
|
|
|
"\n input.";
|
2270
|
0
|
|
|
|
|
|
print "\n\n Press to continue ...\n\n";
|
2271
|
0
|
|
|
|
|
|
sleep 1;
|
2272
|
0
|
|
|
|
|
|
;
|
2273
|
|
|
|
|
|
|
}
|
2274
|
0
|
|
|
|
|
|
$input->{$instructions[0]}.=$numbor;
|
2275
|
|
|
|
|
|
|
}
|
2276
|
|
|
|
|
|
|
}
|
2277
|
0
|
|
|
|
|
|
my $insert=$sides[0];
|
2278
|
0
|
|
|
|
|
|
$insert.=$input->{$instructions[0]};
|
2279
|
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref).'_mbir'}->
|
2280
|
0
|
|
|
|
|
|
{$instructions[0]}=$input->{$instructions[0]};
|
2281
|
0
|
|
|
|
|
|
my $insert_num_of_spaces=$instructions[2]-2;
|
2282
|
0
|
|
|
|
|
|
$insert=sprintf "%-${insert_num_of_spaces}s",$insert;
|
2283
|
0
|
|
|
|
|
|
$insert.=$sides[1];
|
2284
|
0
|
|
|
|
|
|
my $frlen=length $front_of_line;
|
2285
|
0
|
|
|
|
|
|
my $box_top_line='';
|
2286
|
0
|
|
|
|
|
|
my $box_mid_line='';
|
2287
|
0
|
|
|
|
|
|
my $box_bot_line='';
|
2288
|
0
|
|
|
|
|
|
my $length_of_front_and_macro=$frlen+$length_of_macro;
|
2289
|
0
|
0
|
0
|
|
|
|
if ($#newtext==-1 || $#newtext==0) {
|
2290
|
0
|
|
|
|
|
|
$box_top_line=sprintf "%-${frlen}s",'';
|
2291
|
0
|
|
|
|
|
|
$box_top_line.=$box_top_bottom;
|
2292
|
|
|
|
|
|
|
} else {
|
2293
|
0
|
|
|
|
|
|
my $front_of_box_top=unpack("a$frlen",$newtext[$#newtext-1]);
|
2294
|
0
|
0
|
|
|
|
|
$front_of_box_top=sprintf "%-${frlen}s",$front_of_box_top
|
2295
|
|
|
|
|
|
|
if length $front_of_box_top<$frlen;
|
2296
|
0
|
|
|
|
|
|
my $back_of_box_top='';
|
2297
|
0
|
0
|
|
|
|
|
if ($length_of_front_and_macro<=length
|
2298
|
|
|
|
|
|
|
$newtext[$#newtext-1]) {
|
2299
|
0
|
|
|
|
|
|
$back_of_box_top=unpack("x$length_of_front_and_macro a*",
|
2300
|
|
|
|
|
|
|
$newtext[$#newtext-1]);
|
2301
|
|
|
|
|
|
|
}
|
2302
|
0
|
|
|
|
|
|
$box_top_line=$front_of_box_top.
|
2303
|
|
|
|
|
|
|
$box_top_bottom.$back_of_box_top;
|
2304
|
|
|
|
|
|
|
}
|
2305
|
0
|
0
|
|
|
|
|
if ($#newtext==-1) {
|
2306
|
0
|
|
|
|
|
|
$box_mid_line=sprintf "%-${frlen}s",'';
|
2307
|
0
|
|
|
|
|
|
$box_mid_line.=$insert;
|
2308
|
|
|
|
|
|
|
} else {
|
2309
|
0
|
0
|
|
|
|
|
my $elem=($#newtext==0)?0:$#newtext;
|
2310
|
0
|
|
|
|
|
|
my $front_of_box_mid=sprintf "%-${frlen}s",'';
|
2311
|
0
|
0
|
|
|
|
|
if ($newtext[$elem]!~/^\s*$/) {
|
2312
|
0
|
|
|
|
|
|
$front_of_box_mid=unpack("a$frlen",$newtext[$elem]);
|
2313
|
0
|
0
|
|
|
|
|
$front_of_box_mid=sprintf "%-${frlen}s",$front_of_box_mid
|
2314
|
|
|
|
|
|
|
if length $front_of_box_mid<$frlen;
|
2315
|
|
|
|
|
|
|
}
|
2316
|
0
|
|
|
|
|
|
my $back_of_box_mid='';
|
2317
|
0
|
0
|
|
|
|
|
if ($length_of_front_and_macro<=length $newtext[$elem]) {
|
2318
|
0
|
|
|
|
|
|
$back_of_box_mid=unpack("x$length_of_front_and_macro a*",
|
2319
|
|
|
|
|
|
|
$newtext[$elem]);
|
2320
|
|
|
|
|
|
|
}
|
2321
|
0
|
|
|
|
|
|
$box_mid_line=$front_of_box_mid.
|
2322
|
|
|
|
|
|
|
$insert.$back_of_box_mid;
|
2323
|
|
|
|
|
|
|
}
|
2324
|
0
|
|
|
|
|
|
$box_bot_line=$front_of_line.$box_top_bottom.$back_of_line;
|
2325
|
0
|
0
|
|
|
|
|
if ($#newtext==-1) {
|
|
|
0
|
|
|
|
|
|
2326
|
0
|
|
|
|
|
|
push @newtext,$box_top_line;
|
2327
|
0
|
|
|
|
|
|
push @newtext,$box_mid_line;
|
2328
|
|
|
|
|
|
|
} elsif ($#newtext==0) {
|
2329
|
0
|
|
|
|
|
|
unshift @newtext,$box_top_line;
|
2330
|
0
|
|
|
|
|
|
$newtext[1]=$box_mid_line;
|
2331
|
|
|
|
|
|
|
} else {
|
2332
|
0
|
|
|
|
|
|
$newtext[$#newtext-1]=$box_top_line;
|
2333
|
0
|
|
|
|
|
|
$newtext[$#newtext]=$box_mid_line;
|
2334
|
0
|
|
|
|
|
|
} push @newtext, $box_bot_line;
|
2335
|
|
|
|
|
|
|
} else {
|
2336
|
0
|
|
|
|
|
|
push @newtext,$line;
|
2337
|
|
|
|
|
|
|
}
|
2338
|
0
|
|
|
|
|
|
} $text=join "\n",@newtext;
|
2339
|
|
|
|
|
|
|
}
|
2340
|
0
|
|
|
|
|
|
} return $text, $input;
|
2341
|
|
|
|
|
|
|
}
|
2342
|
|
|
|
|
|
|
|
2343
|
|
|
|
|
|
|
sub transform_pmsi
|
2344
|
|
|
|
|
|
|
{
|
2345
|
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
#print "TRANSFORM_PMSI CALLER=",caller,"\n";
|
2347
|
|
|
|
|
|
|
## pmsi - [p]revious [m]enu [s]elected [i]tems
|
2348
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2349
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||'';
|
2350
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[2]||'';
|
2351
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[3]||'';
|
2352
|
0
|
|
0
|
|
|
|
my $log_handle=$_[4]||'';
|
2353
|
0
|
|
|
|
|
|
my $expand_array_flag=0;
|
2354
|
0
|
|
|
|
|
|
my $tpmi_regex=qr/\](!)?t(?:e+st[-_]*)*p*(?:r+vious[-_]*)
|
2355
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2356
|
0
|
|
|
|
|
|
my $pmsi_regex=qr/\](!)?p(?:r+evious[-_]*)*m*(?:e+nu[-_]*)
|
2357
|
|
|
|
|
|
|
*s*(?:e+lected[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2358
|
0
|
|
|
|
|
|
my $amlm_regex=qr/\]a(n+cestor[-_]*)*m*(e+nu[-_]*)
|
2359
|
|
|
|
|
|
|
*l*(a+bel[-_]*)*m*(a+p[-_]*)*\[/xi;
|
2360
|
0
|
|
|
|
|
|
$text=~s/\s?$//s;
|
2361
|
0
|
0
|
0
|
|
|
|
if ((-1
|
2362
|
0
|
0
|
0
|
|
|
|
unless ($text=~/^\s*\]\[\[\s*/s && $text=~/\s*\]\]\[\s*$/s) {
|
2363
|
0
|
|
|
|
|
|
my $die=<
|
2364
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
FATAL ERROR! - The --RETURN-ARRAY-- Macro
|
2366
|
|
|
|
|
|
|
Boundary indicators: '][[' and ']]['
|
2367
|
|
|
|
|
|
|
are only supported at the beginning
|
2368
|
|
|
|
|
|
|
and end of the return instructions.
|
2369
|
|
|
|
|
|
|
Nothing but white space should precede
|
2370
|
|
|
|
|
|
|
the left indicator, nor extend beyond
|
2371
|
|
|
|
|
|
|
the right indicator.
|
2372
|
|
|
|
|
|
|
Your String:
|
2373
|
|
|
|
|
|
|
$text
|
2374
|
|
|
|
|
|
|
Remedy: Recreate your return instructions
|
2375
|
|
|
|
|
|
|
to conform to this convention. Also
|
2376
|
|
|
|
|
|
|
be sure to use the Macro delimiter
|
2377
|
|
|
|
|
|
|
indicator ']|[' to denote return array
|
2378
|
|
|
|
|
|
|
element separation boundaries.
|
2379
|
|
|
|
|
|
|
Example:
|
2380
|
|
|
|
|
|
|
'][[ ]S[ ]|[ ]P[{Menu_One} ]|[ SomeString ]]['
|
2381
|
|
|
|
|
|
|
DIE
|
2382
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2383
|
|
|
|
|
|
|
-1
|
2384
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2385
|
0
|
|
|
|
|
|
close($log_handle);
|
2386
|
|
|
|
|
|
|
}
|
2387
|
|
|
|
|
|
|
}
|
2388
|
0
|
|
|
|
|
|
$expand_array_flag=1;
|
2389
|
|
|
|
|
|
|
}
|
2390
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2391
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tpmi_regex,$pmsi_regex) {
|
2392
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2393
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2394
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2395
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2396
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2397
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2398
|
0
|
|
|
|
|
|
$esc_one=~s/[{]/\\\{\(/;$esc_one=~s/\}/\)\}/;
|
|
0
|
|
|
|
|
|
|
2399
|
0
|
|
0
|
|
|
|
while ($esc_one=~/[{]/ && $text=~m/$esc_one/) {
|
2400
|
0
|
0
|
0
|
|
|
|
unless (exists $Conveyed->{$1} || $bang || $test_regx_flag) {
|
|
|
|
0
|
|
|
|
|
2401
|
0
|
|
|
|
|
|
my $die="\n\n FATAL ERROR! - The Menu Name: \"$1\""
|
2402
|
|
|
|
|
|
|
."\n describes a Menu that is *NOT* in the"
|
2403
|
|
|
|
|
|
|
."\n invocation history of this process.\n"
|
2404
|
|
|
|
|
|
|
."\n This Error is *usually* the result of a missing,"
|
2405
|
|
|
|
|
|
|
."\n Menu, a Menu block that was not global or"
|
2406
|
|
|
|
|
|
|
."\n was not coded ABOVE the parent Menu hash"
|
2407
|
|
|
|
|
|
|
."\n block. (See Example)\n"
|
2408
|
|
|
|
|
|
|
."\n Also be sure to use a UNIQUE name for every"
|
2409
|
|
|
|
|
|
|
."\n Menu.\n"
|
2410
|
|
|
|
|
|
|
."\n Example: my %Example_Menu=(\n"
|
2411
|
|
|
|
|
|
|
."\n Item_1 => {"
|
2412
|
|
|
|
|
|
|
."\n ... # ]P[ is a Macro 'Previous'"
|
2413
|
|
|
|
|
|
|
."\n Result => sub { return ']P[{Parent_Menu}' },"
|
2414
|
|
|
|
|
|
|
."\n );"
|
2415
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
2416
|
|
|
|
|
|
|
."\n Item_1 => {"
|
2417
|
|
|
|
|
|
|
."\n ..."
|
2418
|
|
|
|
|
|
|
."\n Result => \\%Example_Menu,"
|
2419
|
|
|
|
|
|
|
."\n ..."
|
2420
|
|
|
|
|
|
|
."\n );\n"
|
2421
|
|
|
|
|
|
|
."\n *HOWEVER*: Read the Documentation on \"stepchild\""
|
2422
|
|
|
|
|
|
|
."\n and other deeply nested menus. There are"
|
2423
|
|
|
|
|
|
|
."\n scenarios with dynamically generated menus"
|
2424
|
|
|
|
|
|
|
."\n where Term::Menus simply cannot test for"
|
2425
|
|
|
|
|
|
|
."\n menu stack integrity when it encounters"
|
2426
|
|
|
|
|
|
|
."\n unexpanded macros in defined but ungenerated"
|
2427
|
|
|
|
|
|
|
."\n menus. In these situations this error"
|
2428
|
|
|
|
|
|
|
."\n message should be turned off by using the"
|
2429
|
|
|
|
|
|
|
."\n \"test\" macro ( ]T[ ) or using an"
|
2430
|
|
|
|
|
|
|
."\n exclamation point character with either"
|
2431
|
|
|
|
|
|
|
."\n or both the ]S[ (becomes ]!S[) and ]P["
|
2432
|
|
|
|
|
|
|
."\n (becomes ]!P[) macros.\n\n";
|
2433
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2434
|
|
|
|
|
|
|
-1
|
2435
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2436
|
0
|
|
|
|
|
|
close($log_handle);
|
2437
|
|
|
|
|
|
|
}
|
2438
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
2439
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
2440
|
0
|
|
|
|
|
|
} else { die $die }
|
2441
|
|
|
|
|
|
|
}
|
2442
|
0
|
0
|
|
|
|
|
unless ($Conveyed->{$1}) {
|
2443
|
0
|
|
|
|
|
|
$test_regx_flag=0;
|
2444
|
|
|
|
|
|
|
next FE
|
2445
|
0
|
|
|
|
|
|
}
|
2446
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$1};
|
2447
|
0
|
0
|
|
|
|
|
if (ref $replace) {
|
2448
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($Conveyed->{$1})->Out();
|
2449
|
0
|
|
|
|
|
|
my $type=ref $Conveyed->{$1};
|
2450
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2451
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2452
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2453
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2454
|
|
|
|
|
|
|
}
|
2455
|
|
|
|
|
|
|
}
|
2456
|
0
|
0
|
0
|
|
|
|
if ($text=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2457
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2458
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2459
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2460
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2461
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2462
|
|
|
|
|
|
|
}
|
2463
|
0
|
0
|
0
|
|
|
|
if ($replace=~/^.(?
|
2464
|
0
|
0
|
0
|
|
|
|
$replace='"'.$replace.'"' if
|
2465
|
|
|
|
|
|
|
$text!~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/ &&
|
2466
|
|
|
|
|
|
|
$replace!~/^eval /;
|
2467
|
|
|
|
|
|
|
}
|
2468
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/se;
|
|
0
|
|
|
|
|
|
|
2469
|
|
|
|
|
|
|
}
|
2470
|
0
|
|
|
|
|
|
my $replace='';
|
2471
|
0
|
0
|
|
|
|
|
if (ref $picks_from_parent eq 'ARRAY') {
|
2472
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($picks_from_parent)->Out();
|
2473
|
0
|
|
|
|
|
|
my $type=ref $picks_from_parent;
|
2474
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2475
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2476
|
0
|
0
|
0
|
|
|
|
if ($expand_array_flag) {
|
|
|
0
|
|
|
|
|
|
2477
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2478
|
|
|
|
|
|
|
} elsif ($replace=~/^.(?
|
2479
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2480
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2481
|
|
|
|
|
|
|
}
|
2482
|
|
|
|
|
|
|
} else {
|
2483
|
0
|
|
|
|
|
|
$replace=$picks_from_parent;
|
2484
|
0
|
0
|
0
|
|
|
|
if ($replace=~/^.(?
|
2485
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2486
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2487
|
|
|
|
|
|
|
}
|
2488
|
|
|
|
|
|
|
|
2489
|
|
|
|
|
|
|
}
|
2490
|
0
|
0
|
0
|
|
|
|
if ($text=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2491
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2492
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2493
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2494
|
0
|
0
|
0
|
|
|
|
$replace='"'.$replace.'"' if
|
2495
|
|
|
|
|
|
|
$text!~/^&?(?:.*::)*(\w+)\s*[(]["'].*["'][)]\s*$/ &&
|
2496
|
|
|
|
|
|
|
$replace!~/^eval /;
|
2497
|
|
|
|
|
|
|
}
|
2498
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/s;
|
2499
|
|
|
|
|
|
|
}
|
2500
|
|
|
|
|
|
|
}
|
2501
|
0
|
|
|
|
|
|
while ($text=~m/($amlm_regex(?:\{[^}]+\})*)/sg) {
|
2502
|
0
|
|
|
|
|
|
my $esc_one=$1;
|
2503
|
0
|
0
|
|
|
|
|
last unless $esc_one;
|
2504
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2505
|
0
|
|
|
|
|
|
$esc_one=~s/\{/\{\(/;$esc_one=~s/\}/\)\}/;
|
|
0
|
|
|
|
|
|
|
2506
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$1};
|
2507
|
0
|
0
|
|
|
|
|
if (ref $replace) {
|
2508
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($Conveyed->{$1})->Out();
|
2509
|
0
|
|
|
|
|
|
my $type=ref $Conveyed->{$1};
|
2510
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2511
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2512
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2513
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2514
|
|
|
|
|
|
|
}
|
2515
|
|
|
|
|
|
|
}
|
2516
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/se;
|
|
0
|
|
|
|
|
|
|
2517
|
0
|
|
|
|
|
|
} return $text;
|
2518
|
|
|
|
|
|
|
|
2519
|
|
|
|
|
|
|
}
|
2520
|
|
|
|
|
|
|
|
2521
|
|
|
|
|
|
|
sub pick # USAGE: &pick( ref_to_choices_array,
|
2522
|
|
|
|
|
|
|
# (Optional) banner_string,
|
2523
|
|
|
|
|
|
|
# (Optional) display_this_many_items,
|
2524
|
|
|
|
|
|
|
# (Optional) return_index_only_flag,
|
2525
|
|
|
|
|
|
|
# (Optional) log_file_handle,
|
2526
|
|
|
|
|
|
|
# ----------
|
2527
|
|
|
|
|
|
|
# For Use With Sub-Menus
|
2528
|
|
|
|
|
|
|
# ----------
|
2529
|
|
|
|
|
|
|
# (Optional) MenuUnit_hash_ref,
|
2530
|
|
|
|
|
|
|
# (Optional) recurse_level,
|
2531
|
|
|
|
|
|
|
# (Optional) picks_from_parent,
|
2532
|
|
|
|
|
|
|
# (Optional) parent_menu,
|
2533
|
|
|
|
|
|
|
# (Optional) menus_cfg_file,
|
2534
|
|
|
|
|
|
|
# (Optional) Full_Menu_data_structure,
|
2535
|
|
|
|
|
|
|
# (Optional) Selected_data_structure,
|
2536
|
|
|
|
|
|
|
# (Optional) Conveyed_data_structure,
|
2537
|
|
|
|
|
|
|
# (Optional) SavePick_data_structure,
|
2538
|
|
|
|
|
|
|
# (Optional) SaveMMap_data_structure,
|
2539
|
|
|
|
|
|
|
# (Optional) SaveNext_data_structure,
|
2540
|
|
|
|
|
|
|
# (Optional) Persists_data_structure,
|
2541
|
|
|
|
|
|
|
# (Optional) no_wantarray_flag,
|
2542
|
|
|
|
|
|
|
# (Optional) sorted
|
2543
|
|
|
|
|
|
|
# (Optional) select_many )
|
2544
|
|
|
|
|
|
|
{
|
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
#print "PICKCALLER=",caller," and Argument 7 =>$_[6]<=\n";;
|
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
# "pick" --> This function presents the user with
|
2549
|
|
|
|
|
|
|
# with a list of items from which to choose.
|
2550
|
|
|
|
|
|
|
|
2551
|
0
|
|
|
0
|
1
|
|
my @all_menu_items_array=@{$_[0]};
|
|
0
|
|
|
|
|
|
|
2552
|
0
|
0
|
|
|
|
|
my $banner=defined $_[1] ? $_[1] : "\n Please Pick an Item :";
|
2553
|
0
|
0
|
|
|
|
|
my $display_this_many_items=defined $_[2] ? $_[2] : 10;
|
2554
|
0
|
0
|
|
|
|
|
my $return_index_only_flag=(defined $_[3]) ? 1 : 0;
|
2555
|
0
|
0
|
|
|
|
|
my $log_handle= (defined $_[4]) ? $_[4] : '';
|
2556
|
|
|
|
|
|
|
|
2557
|
|
|
|
|
|
|
# Used Only With Cascasding Menus (Optional)
|
2558
|
0
|
0
|
|
|
|
|
my $MenuUnit_hash_ref= (defined $_[5]) ? $_[5] : {};
|
2559
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
2560
|
0
|
0
|
|
|
|
|
unless (grep { /Item_/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2561
|
0
|
0
|
|
|
|
|
if (grep { /Banner/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2562
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
2563
|
|
|
|
|
|
|
}
|
2564
|
|
|
|
|
|
|
}
|
2565
|
0
|
|
0
|
|
|
|
$MenuUnit_hash_ref->{Select}||={};
|
2566
|
0
|
0
|
|
|
|
|
my $recurse_level= (defined $_[6]) ? $_[6] : 1;
|
2567
|
0
|
0
|
|
|
|
|
my $picks_from_parent= (defined $_[7]) ? $_[7] : '';
|
2568
|
0
|
0
|
|
|
|
|
my $parent_menu= (defined $_[8]) ? $_[8] : '';
|
2569
|
0
|
0
|
|
|
|
|
my $FullMenu= (defined $_[9]) ? $_[9] : {};
|
2570
|
0
|
0
|
|
|
|
|
my $Selected= (defined $_[10]) ? $_[10] : {};
|
2571
|
0
|
0
|
|
|
|
|
my $Conveyed= (defined $_[11]) ? $_[11] : {};
|
2572
|
0
|
0
|
|
|
|
|
my $SavePick= (defined $_[12]) ? $_[12] : {};
|
2573
|
0
|
0
|
|
|
|
|
my $SaveMMap= (defined $_[13]) ? $_[13] : {};
|
2574
|
0
|
0
|
|
|
|
|
my $SaveNext= (defined $_[14]) ? $_[14] : {};
|
2575
|
0
|
0
|
|
|
|
|
my $Persists= (defined $_[15]) ? $_[15] : {};
|
2576
|
0
|
0
|
|
|
|
|
my $no_wantarray= (defined $_[16]) ? $_[16] : 0;
|
2577
|
0
|
0
|
|
|
|
|
my $sorted= (defined $_[17]) ? $_[17] : 0;
|
2578
|
0
|
0
|
|
|
|
|
my $select_many= (defined $_[18]) ? $_[18] : 0;
|
2579
|
|
|
|
|
|
|
|
2580
|
0
|
|
|
|
|
|
my %items=();my %picks=();my %negate=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2581
|
0
|
|
|
|
|
|
my %exclude=();my %include=();my %default=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2582
|
0
|
|
|
|
|
|
my %labels=();
|
2583
|
0
|
|
|
|
|
|
foreach my $menuhash (keys %{$FullMenu}) {
|
|
0
|
|
|
|
|
|
|
2584
|
0
|
|
|
|
|
|
my $name=&pw($FullMenu->{$menuhash}[0]);
|
2585
|
0
|
0
|
|
|
|
|
if ($name) {
|
2586
|
0
|
|
|
|
|
|
$FullMenu->{$menuhash}[0]->{Name}=$name;
|
2587
|
0
|
|
|
|
|
|
} else { next }
|
2588
|
0
|
|
|
|
|
|
$labels{$name}=$FullMenu->{$menuhash}[0];
|
2589
|
|
|
|
|
|
|
}
|
2590
|
0
|
0
|
0
|
|
|
|
if ($SavePick && exists $SavePick->{$MenuUnit_hash_ref}) {
|
2591
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
2592
|
|
|
|
|
|
|
}
|
2593
|
0
|
|
|
|
|
|
my $num_pick=$#all_menu_items_array+1;
|
2594
|
0
|
|
0
|
|
|
|
my $caller=(caller(1))[3]||'';
|
2595
|
0
|
|
|
|
|
|
my $numbor=0; # Number of Item Selected
|
2596
|
0
|
|
|
|
|
|
my $ikey=''; # rawInput Key - key used
|
2597
|
|
|
|
|
|
|
# to end menu. Can be
|
2598
|
|
|
|
|
|
|
# any non-alphanumeric
|
2599
|
|
|
|
|
|
|
# key like Enter or
|
2600
|
|
|
|
|
|
|
# Right Arrow.
|
2601
|
0
|
|
|
|
|
|
my $return_from_child_menu=0;
|
2602
|
|
|
|
|
|
|
|
2603
|
0
|
|
|
|
|
|
my $choose_num='';
|
2604
|
0
|
|
|
|
|
|
my $convey='';
|
2605
|
0
|
|
|
|
|
|
my $menu_output='';
|
2606
|
0
|
|
|
|
|
|
my $hidedefaults=0;
|
2607
|
|
|
|
|
|
|
my $start=($FullMenu->{$MenuUnit_hash_ref}[11])?
|
2608
|
0
|
0
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]:0;
|
2609
|
0
|
|
|
|
|
|
my $got_default=0;
|
2610
|
|
|
|
|
|
|
|
2611
|
|
|
|
|
|
|
sub delete_Selected
|
2612
|
|
|
|
|
|
|
{
|
2613
|
|
|
|
|
|
|
|
2614
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[2];
|
2615
|
0
|
|
|
|
|
|
my $SavePick=$_[3];
|
2616
|
0
|
|
|
|
|
|
my $SaveNext=$_[4];
|
2617
|
0
|
|
|
|
|
|
my $Persists=$_[5];
|
2618
|
0
|
0
|
|
|
|
|
if ($_[1]) {
|
2619
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$_[1]};
|
2620
|
0
|
|
|
|
|
|
delete $Selected->{$_[0]}{$_[1]};
|
2621
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$_[1]};
|
2622
|
0
|
0
|
|
|
|
|
if ($result) {
|
2623
|
0
|
|
|
|
|
|
&delete_Selected($result,'',
|
2624
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext);
|
2625
|
0
|
|
|
|
|
|
} delete $SaveNext->{$_[0]};
|
2626
|
|
|
|
|
|
|
} else {
|
2627
|
0
|
0
|
|
|
|
|
if (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2628
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2629
|
0
|
|
|
|
|
|
delete $Selected->{$_[0]}{$key};
|
2630
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$key};
|
2631
|
0
|
|
|
|
|
|
delete $SaveNext->{$_[0]};
|
2632
|
|
|
|
|
|
|
}
|
2633
|
|
|
|
|
|
|
} else {
|
2634
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SavePick->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2635
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$key};
|
2636
|
0
|
|
|
|
|
|
delete $SaveNext->{$_[0]};
|
2637
|
|
|
|
|
|
|
}
|
2638
|
|
|
|
|
|
|
}
|
2639
|
0
|
|
|
|
|
|
} delete $SaveNext->{$_[0]};
|
2640
|
0
|
|
|
|
|
|
return $SaveNext;
|
2641
|
|
|
|
|
|
|
|
2642
|
|
|
|
|
|
|
}
|
2643
|
|
|
|
|
|
|
|
2644
|
|
|
|
|
|
|
sub find_Selected
|
2645
|
|
|
|
|
|
|
{
|
2646
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[2];
|
2647
|
0
|
0
|
|
|
|
|
if ($_[1]) {
|
2648
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$_[1]};
|
2649
|
0
|
0
|
0
|
|
|
|
if ($result=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2650
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2651
|
0
|
|
|
|
|
|
return 0;
|
2652
|
|
|
|
|
|
|
} else {
|
2653
|
0
|
|
|
|
|
|
return &find_Selected($result,'',$Selected);
|
2654
|
|
|
|
|
|
|
}
|
2655
|
|
|
|
|
|
|
} else {
|
2656
|
0
|
0
|
|
|
|
|
if (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2657
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2658
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$key};
|
2659
|
|
|
|
|
|
|
#return '+' if substr($result,0,1) eq '&';
|
2660
|
0
|
0
|
0
|
|
|
|
if ($result=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2661
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2662
|
0
|
|
|
|
|
|
return '+';
|
2663
|
|
|
|
|
|
|
}
|
2664
|
0
|
|
|
|
|
|
my $output=&find_Selected($result,'',$Selected);
|
2665
|
0
|
0
|
|
|
|
|
return '+' if $output eq '+';
|
2666
|
|
|
|
|
|
|
}
|
2667
|
|
|
|
|
|
|
}
|
2668
|
|
|
|
|
|
|
}
|
2669
|
|
|
|
|
|
|
}
|
2670
|
|
|
|
|
|
|
|
2671
|
|
|
|
|
|
|
sub get_subs_from_menu
|
2672
|
|
|
|
|
|
|
{
|
2673
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[0];
|
2674
|
0
|
|
|
|
|
|
my @subs=();
|
2675
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected}) {
|
|
0
|
|
|
|
|
|
|
2676
|
0
|
|
|
|
|
|
foreach my $item (keys %{$Selected->{$key}}) {
|
|
0
|
|
|
|
|
|
|
2677
|
0
|
|
|
|
|
|
my $seltext=$Selected->{$key}{$item};
|
2678
|
0
|
0
|
0
|
|
|
|
if ($seltext=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
|
|
0
|
|
|
|
|
|
2679
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2680
|
0
|
|
|
|
|
|
push @subs, escape_quotes($seltext);
|
2681
|
|
|
|
|
|
|
} elsif (ref $seltext eq 'CODE') {
|
2682
|
0
|
|
|
|
|
|
push @subs, $seltext;
|
2683
|
|
|
|
|
|
|
}
|
2684
|
|
|
|
|
|
|
}
|
2685
|
|
|
|
|
|
|
}
|
2686
|
0
|
|
|
|
|
|
return @subs;
|
2687
|
|
|
|
|
|
|
}
|
2688
|
|
|
|
|
|
|
|
2689
|
|
|
|
|
|
|
my $get_result = sub {
|
2690
|
|
|
|
|
|
|
|
2691
|
|
|
|
|
|
|
# $_[0] => $MenuUnit_hash_ref
|
2692
|
|
|
|
|
|
|
# $_[1] => \@all_menu_items_array
|
2693
|
|
|
|
|
|
|
# $_[2] => $picks
|
2694
|
|
|
|
|
|
|
# $_[3] => $picks_from_parent
|
2695
|
|
|
|
|
|
|
|
2696
|
0
|
|
|
0
|
|
|
my $convey=[];
|
2697
|
0
|
|
|
|
|
|
my $FullMenu=$_[4];
|
2698
|
0
|
|
|
|
|
|
my $Conveyed=$_[5];
|
2699
|
0
|
|
|
|
|
|
my $Selected=$_[6];
|
2700
|
0
|
|
|
|
|
|
my $SaveNext=$_[7];
|
2701
|
0
|
|
|
|
|
|
my $Persists=$_[8];
|
2702
|
0
|
|
|
|
|
|
my $parent_menu=$_[9];
|
2703
|
0
|
|
0
|
|
|
|
my $pick=(keys %{$_[2]})[0] || 1;
|
2704
|
0
|
|
0
|
|
|
|
$_[1]->[$pick-1]||='';
|
2705
|
|
|
|
|
|
|
my $gotmany=(exists $MenuUnit_hash_ref->{Select} &&
|
2706
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Select}) ? 1 : 0;
|
2707
|
0
|
0
|
|
|
|
|
$FullMenu->{$_[0]}[3]={} unless $gotmany;
|
2708
|
0
|
0
|
0
|
|
|
|
if ($pick && exists $FullMenu->{$_[0]}[3]{$_[1]->[$pick-1]}) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2709
|
0
|
0
|
0
|
|
|
|
if ($pick && exists $_[0]->{$FullMenu->{$_[0]}
|
2710
|
|
|
|
|
|
|
[4]{$_[1]->[$pick-1]}}{Convey}) {
|
2711
|
0
|
|
|
|
|
|
my $contmp='';
|
2712
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %{$_[2]}]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2713
|
0
|
|
|
|
|
|
foreach my $numb (sort numerically keys %{$_[2]}) {
|
|
0
|
|
|
|
|
|
|
2714
|
0
|
|
|
|
|
|
$contmp=${${$FullMenu}{$_[0]}[3]}
|
|
0
|
|
|
|
|
|
|
2715
|
0
|
|
|
|
|
|
{${$_[1]}[$numb-1]}[0];
|
|
0
|
|
|
|
|
|
|
2716
|
0
|
|
|
|
|
|
$contmp=~s/\s?$//s;
|
2717
|
0
|
|
|
|
|
|
push @{$convey}, $contmp;
|
|
0
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
}
|
2719
|
|
|
|
|
|
|
} else {
|
2720
|
0
|
|
|
|
|
|
$convey=${${${$FullMenu}{$_[0]}[3]}{${$_[1]}[$pick-1]}}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2721
|
|
|
|
|
|
|
#$convey=$FullMenu->{$_[0]}[3]->{$_[1]->[$pick-1]}->[0];
|
2722
|
0
|
|
|
|
|
|
$convey=~s/\s?$//s;
|
2723
|
|
|
|
|
|
|
}
|
2724
|
0
|
0
|
|
|
|
|
$convey='SKIP' if $convey eq '';
|
2725
|
0
|
0
|
0
|
|
|
|
if (ref $convey eq 'ARRAY' && $#{$convey}==0) {
|
|
0
|
|
|
|
|
|
|
2726
|
0
|
|
|
|
|
|
$convey=$convey->[0];
|
2727
|
|
|
|
|
|
|
}
|
2728
|
|
|
|
|
|
|
}
|
2729
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2730
|
|
|
|
|
|
|
} elsif ($pick) {
|
2731
|
0
|
|
|
|
|
|
$convey=${$_[1]}[$pick-1];
|
|
0
|
|
|
|
|
|
|
2732
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2733
|
|
|
|
|
|
|
} elsif ($_[3]) {
|
2734
|
0
|
|
|
|
|
|
$convey=$_[3];
|
2735
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2736
|
|
|
|
|
|
|
}
|
2737
|
|
|
|
|
|
|
$convey='' if !$convey ||
|
2738
|
0
|
0
|
0
|
|
|
|
(ref $convey eq 'ARRAY' && $#{$convey}==-1);
|
|
0
|
|
0
|
|
|
|
|
2739
|
0
|
|
|
|
|
|
my $test_item='';my $show_banner_only=0;
|
|
0
|
|
|
|
|
|
|
2740
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$_[0]}[2]{'__FA_Banner__'}) {
|
|
|
0
|
|
|
|
|
|
2741
|
0
|
|
|
|
|
|
$test_item=$FullMenu->{$_[0]}[2]{'__FA_Banner__'};
|
2742
|
0
|
|
|
|
|
|
$show_banner_only=1;$pick=0;
|
|
0
|
|
|
|
|
|
|
2743
|
|
|
|
|
|
|
} elsif ($pick) {
|
2744
|
0
|
|
|
|
|
|
$test_item=$FullMenu->{$_[0]}[2]{$_[1]->[$pick-1]};
|
2745
|
|
|
|
|
|
|
}
|
2746
|
0
|
|
0
|
|
|
|
$test_item||='';
|
2747
|
0
|
0
|
0
|
|
|
|
if (($pick &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2748
|
|
|
|
|
|
|
exists $FullMenu->{$_[0]}[2]{$_[1]->[$pick-1]} &&
|
2749
|
|
|
|
|
|
|
(ref $test_item eq 'HASH' &&
|
2750
|
0
|
|
|
|
|
|
(values %{$test_item})[0] ne 'recurse')) ||
|
2751
|
|
|
|
|
|
|
ref $test_item eq 'CODE') {
|
2752
|
0
|
0
|
0
|
|
|
|
if ((ref $test_item eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2753
|
|
|
|
|
|
|
((grep { /Item_/ } keys %{$test_item}) ||
|
2754
|
|
|
|
|
|
|
($show_banner_only && (grep { /Banner/ }
|
2755
|
|
|
|
|
|
|
keys %{$test_item}))))
|
2756
|
|
|
|
|
|
|
|| ($test_item=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/
|
2757
|
0
|
|
|
|
|
|
&& grep { $1 eq $_ } list_module(
|
2758
|
|
|
|
|
|
|
'main',$Term::Menus::fa_code))
|
2759
|
|
|
|
|
|
|
|| ref $test_item eq 'CODE' ||
|
2760
|
|
|
|
|
|
|
&test_hashref($test_item)) {
|
2761
|
0
|
|
|
|
|
|
my $con_regex=qr/\]c(o+nvey)*\[/i;
|
2762
|
0
|
|
|
|
|
|
my $tpmi_regex=qr/\](!)?t(?:e+st[-_]*)*p*(?:r+vious[-_]*)
|
2763
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2764
|
0
|
|
|
|
|
|
my $sicm_regex=
|
2765
|
|
|
|
|
|
|
qr/\]s(e+lected[-_]*)*i*(t+ems[-_]*)
|
2766
|
|
|
|
|
|
|
*c*(u+rrent[-_]*)*m*(e+nu[-_]*)*\[/xi;
|
2767
|
0
|
|
|
|
|
|
my $pmsi_regex=qr/\](!)?p(?:r+evious[-_]*)*m*(?:e+nu[-_]*)
|
2768
|
|
|
|
|
|
|
*s*(?:e+lected[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2769
|
0
|
|
|
|
|
|
my $amlm_regex=qr/\]a(n+cestor[-_]*)*m*(e+nu[-_]*)
|
2770
|
|
|
|
|
|
|
*l*(a+bel[-_]*)*m*(a+p[-_]*)*\[/xi;
|
2771
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2772
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2773
|
0
|
0
|
|
|
|
|
if ($test_item=~/$con_regex|$pmsi_regex|
|
|
|
0
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
$amlm_regex|$sicm_regex|$tpmi_regex|$tbii_regex/x) {
|
2775
|
0
|
|
|
|
|
|
$test_item=&transform_mbii($test_item,
|
2776
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2777
|
|
|
|
|
|
|
$picks_from_parent,$log_handle);
|
2778
|
|
|
|
|
|
|
$test_item=&transform_sicm($test_item,$numbor,
|
2779
|
|
|
|
|
|
|
\@all_menu_items_array,$_[2],'',
|
2780
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
2781
|
0
|
|
|
|
|
|
$_[0]->{Name});
|
2782
|
0
|
|
|
|
|
|
$test_item=&transform_pmsi($test_item,
|
2783
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2784
|
|
|
|
|
|
|
$picks_from_parent,$log_handle);
|
2785
|
0
|
|
|
|
|
|
$test_item=&transform_mbir($test_item,
|
2786
|
|
|
|
|
|
|
$Conveyed,$MenuUnit_hash_ref,$log_handle);
|
2787
|
|
|
|
|
|
|
} elsif (ref $test_item eq 'CODE') {
|
2788
|
0
|
|
|
|
|
|
my $cd='';
|
2789
|
|
|
|
|
|
|
#if ($Term::Menus::data_dump_streamer && (!$show_banner_only
|
2790
|
|
|
|
|
|
|
# || (exists $MenuUnit_hash_ref->{Input}
|
2791
|
|
|
|
|
|
|
# && $MenuUnit_hash_ref->{Input}==1))) {
|
2792
|
0
|
|
|
|
|
|
$cd=&Data::Dump::Streamer::Dump($test_item)->Out();
|
2793
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
2794
|
|
|
|
|
|
|
\@all_menu_items_array,$_[2],'',
|
2795
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
2796
|
0
|
|
|
|
|
|
$_[0]->{Name});
|
2797
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
2798
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2799
|
|
|
|
|
|
|
$picks_from_parent);
|
2800
|
0
|
|
|
|
|
|
$cd=&transform_mbir($cd,$Conveyed,$MenuUnit_hash_ref,
|
2801
|
|
|
|
|
|
|
$log_handle);
|
2802
|
|
|
|
|
|
|
#}
|
2803
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
2804
|
|
|
|
|
|
|
#print "CD2=$cd<==\n";;
|
2805
|
0
|
|
|
|
|
|
eval { $test_item=eval $cd };
|
|
0
|
|
|
|
|
|
|
2806
|
0
|
0
|
|
|
|
|
if ($@) {
|
2807
|
0
|
0
|
|
|
|
|
if (unpack('a11',$@) eq 'FATAL ERROR') {
|
2808
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2809
|
|
|
|
|
|
|
-1
|
2810
|
0
|
|
|
|
|
|
print $log_handle $@;
|
2811
|
0
|
|
|
|
|
|
close($log_handle);
|
2812
|
|
|
|
|
|
|
}
|
2813
|
0
|
|
|
|
|
|
die $@;
|
2814
|
|
|
|
|
|
|
} else {
|
2815
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
2816
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname Conveyed\n"
|
2817
|
|
|
|
|
|
|
." the Following "
|
2818
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
2819
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
2820
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2821
|
|
|
|
|
|
|
-1
|
2822
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2823
|
0
|
|
|
|
|
|
close($log_handle);
|
2824
|
|
|
|
|
|
|
}
|
2825
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
0
|
0
|
|
|
|
|
2826
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,
|
2827
|
|
|
|
|
|
|
$SaveNext,$Persists,$Selected,
|
2828
|
|
|
|
|
|
|
$convey,$parent_menu;
|
2829
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto) {
|
2830
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
2831
|
0
|
|
|
|
|
|
} else { die $die }
|
2832
|
|
|
|
|
|
|
}
|
2833
|
|
|
|
|
|
|
}
|
2834
|
0
|
0
|
|
|
|
|
my $item=($show_banner_only)?'__FA_Banner__':$pick;
|
2835
|
0
|
|
|
|
|
|
$Selected->{$_[0]}->{$item}=$test_item;
|
2836
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,$SaveNext,
|
2837
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu;
|
2838
|
|
|
|
|
|
|
}
|
2839
|
0
|
0
|
|
|
|
|
if ($test_item=~/Convey\s*=\>/) {
|
2840
|
0
|
0
|
|
|
|
|
if ($convey ne 'SKIP') {
|
2841
|
0
|
|
|
|
|
|
$test_item=~s/Convey\s*=\>/$convey/g;
|
2842
|
|
|
|
|
|
|
} else {
|
2843
|
0
|
|
|
|
|
|
$test_item=~s/Convey\s*=\>/${$_[1]}[$pick-1]/g;
|
|
0
|
|
|
|
|
|
|
2844
|
|
|
|
|
|
|
}
|
2845
|
|
|
|
|
|
|
}
|
2846
|
0
|
0
|
|
|
|
|
if ($test_item=~/Text\s*=\>/) {
|
2847
|
0
|
|
|
|
|
|
$test_item=~s/Text\s*=\>/${$_[1]}[$pick-1]/g;
|
|
0
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
}
|
2849
|
|
|
|
|
|
|
} else {
|
2850
|
|
|
|
|
|
|
my $die="The \"Result3 =>\" Setting\n -> "
|
2851
|
0
|
|
|
|
|
|
.$FullMenu->{$_[0]}[2]{$_[1]->[$_[2]-1]}
|
2852
|
|
|
|
|
|
|
."\n Found in the Menu Unit -> "
|
2853
|
|
|
|
|
|
|
.$MenuUnit_hash_ref
|
2854
|
|
|
|
|
|
|
."\n is not a Menu Unit\,"
|
2855
|
|
|
|
|
|
|
." and Because it Does Not Have"
|
2856
|
|
|
|
|
|
|
."\n an \"&\" as"
|
2857
|
|
|
|
|
|
|
." the Lead Character, $0"
|
2858
|
|
|
|
|
|
|
."\n Cannot Determine "
|
2859
|
|
|
|
|
|
|
."if it is a Valid SubRoutine.\n\n";
|
2860
|
0
|
|
|
|
|
|
die $die;
|
2861
|
|
|
|
|
|
|
}
|
2862
|
|
|
|
|
|
|
}
|
2863
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
2864
|
0
|
|
|
|
|
|
$Selected->{$_[0]}{'__FA_Banner__'}=$test_item;
|
2865
|
0
|
|
|
|
|
|
$SaveNext->{$_[0]}=$FullMenu->{$_[0]}[2]{'__FA_Banner__'};
|
2866
|
|
|
|
|
|
|
} else {
|
2867
|
0
|
0
|
|
|
|
|
chomp($pick) if $pick;
|
2868
|
0
|
0
|
|
|
|
|
$Selected->{$_[0]}{$pick}=$test_item if $pick;
|
2869
|
0
|
0
|
0
|
|
|
|
if ($pick && ref $_[0]->{$FullMenu->{$_[0]}
|
2870
|
|
|
|
|
|
|
[4]{$_[1]->[$pick-1]}}{'Result'} eq 'HASH') {
|
2871
|
|
|
|
|
|
|
$SaveNext->{$_[0]}=$FullMenu->{$_[0]}[2]
|
2872
|
0
|
|
|
|
|
|
{$_[1]->[$pick-1]};
|
2873
|
|
|
|
|
|
|
}
|
2874
|
|
|
|
|
|
|
}
|
2875
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,$SaveNext,
|
2876
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu;
|
2877
|
0
|
|
|
|
|
|
};
|
2878
|
|
|
|
|
|
|
|
2879
|
0
|
|
|
|
|
|
my $filtered_menu=0;my $defaults_exist=0;my $input='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2880
|
0
|
|
|
|
|
|
while (1) {
|
2881
|
0
|
0
|
|
|
|
|
if ($num_pick-$start<=$display_this_many_items) {
|
2882
|
0
|
|
|
|
|
|
$choose_num=$num_pick-$start;
|
2883
|
0
|
|
|
|
|
|
} else { $choose_num=$display_this_many_items }
|
2884
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;my $done=0;my $savechk=0;my %pn=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2885
|
0
|
|
|
|
|
|
my $sorted_flag=0;
|
2886
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}={} unless exists
|
2887
|
0
|
0
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref};
|
2888
|
0
|
0
|
0
|
|
|
|
if (!exists $Persists->{$MenuUnit_hash_ref}{defaults} &&
|
2889
|
0
|
|
|
|
|
|
defined ${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0]) {
|
|
0
|
|
|
|
|
|
|
2890
|
0
|
|
|
|
|
|
my $it=${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2891
|
0
|
|
|
|
|
|
my $def=$FullMenu->{$MenuUnit_hash_ref}[5]{$it};
|
2892
|
0
|
0
|
|
|
|
|
if ($def) {
|
2893
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
2894
|
0
|
|
|
|
|
|
foreach my $item (
|
2895
|
0
|
|
|
|
|
|
@{[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}) {
|
|
0
|
|
|
|
|
|
|
2896
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
2897
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=1;
|
2898
|
|
|
|
|
|
|
}
|
2899
|
|
|
|
|
|
|
}
|
2900
|
|
|
|
|
|
|
}
|
2901
|
|
|
|
|
|
|
}
|
2902
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0 unless exists
|
2903
|
0
|
0
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults};
|
2904
|
0
|
|
|
|
|
|
my $plann='';my $plannn='';
|
|
0
|
|
|
|
|
|
|
2905
|
0
|
0
|
|
|
|
|
if (ref $Net::FullAuto::FA_Core::plan eq 'HASH') {
|
2906
|
0
|
|
|
|
|
|
my $plann=shift @{$Net::FullAuto::FA_Core::plan};
|
|
0
|
|
|
|
|
|
|
2907
|
0
|
|
|
|
|
|
$plannn=$plann->{Item};
|
2908
|
0
|
|
|
|
|
|
my $plan_='';
|
2909
|
0
|
0
|
|
|
|
|
if (substr($plannn,2,5) eq 'ARRAY') {
|
2910
|
0
|
|
|
|
|
|
my $eval_plan=substr($plannn,1,-1);
|
2911
|
0
|
|
|
|
|
|
$plan_=eval $eval_plan;
|
2912
|
0
|
0
|
|
|
|
|
&eval_error($@,$log_handle) if $@;
|
2913
|
|
|
|
|
|
|
} else {
|
2914
|
0
|
|
|
|
|
|
$plan_=$plannn;
|
2915
|
|
|
|
|
|
|
}
|
2916
|
0
|
|
|
|
|
|
return $plan_;
|
2917
|
|
|
|
|
|
|
}
|
2918
|
0
|
|
0
|
|
|
|
while ($numbor=~/\d+/ &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2919
|
|
|
|
|
|
|
($numbor<=$start || $start+$choose_num < $numbor ||
|
2920
|
|
|
|
|
|
|
$numbor eq 'admin') || $input) {
|
2921
|
0
|
|
|
|
|
|
my $menu_text='';my $picknum_for_display='';
|
|
0
|
|
|
|
|
|
|
2922
|
0
|
|
|
|
|
|
my $bout='';
|
2923
|
0
|
|
0
|
|
|
|
($bout,$input)=&banner($MenuUnit_hash_ref->{Banner}||$banner,
|
2924
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent,
|
2925
|
|
|
|
|
|
|
$numbor,$ikey,$input,$MenuUnit_hash_ref,$log_handle);
|
2926
|
0
|
|
|
|
|
|
$menu_text.=$bout."\n";
|
2927
|
0
|
|
|
|
|
|
my $picknum=$start+1;
|
2928
|
0
|
|
|
|
|
|
my $numlist=$choose_num;
|
2929
|
0
|
|
|
|
|
|
my $mark='';
|
2930
|
0
|
|
|
|
|
|
my $mark_len=$FullMenu->{$MenuUnit_hash_ref}[7]{BLANK};
|
2931
|
0
|
|
|
|
|
|
while ($mark_len--) {
|
2932
|
0
|
|
|
|
|
|
$mark.=' ';
|
2933
|
|
|
|
|
|
|
}
|
2934
|
0
|
|
|
|
|
|
my $mark_blank=$mark;
|
2935
|
0
|
|
|
|
|
|
my $mark_flg=0;my $prev_menu=0;
|
|
0
|
|
|
|
|
|
|
2936
|
0
|
0
|
|
|
|
|
$numlist=1 if $numbor eq 'admin';
|
2937
|
0
|
|
|
|
|
|
while (0 < $numlist) {
|
2938
|
0
|
0
|
|
|
|
|
if (exists $picks{$picknum}) {
|
2939
|
0
|
|
|
|
|
|
$mark_flg=1;
|
2940
|
0
|
0
|
|
|
|
|
if ($return_from_child_menu) {
|
2941
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2942
|
0
|
|
|
|
|
|
substr($mark,-1)=$picks{$picknum}=$return_from_child_menu;
|
2943
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%picks;
|
|
0
|
|
|
|
|
|
|
2944
|
0
|
|
|
|
|
|
$prev_menu=$picknum;
|
2945
|
|
|
|
|
|
|
#print "DO WE GET HERE3 and SEL=$MenuUnit_hash_ref->{Select}! and $return_from_child_menu\n";
|
2946
|
|
|
|
|
|
|
} else {
|
2947
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2948
|
0
|
|
|
|
|
|
substr($mark,-1)=$picks{$picknum};
|
2949
|
|
|
|
|
|
|
}
|
2950
|
|
|
|
|
|
|
#print "DO WE GET HERE4 and SEL=$MenuUnit_hash_ref->{Select}!\n";
|
2951
|
|
|
|
|
|
|
my $gotmany=($select_many ||
|
2952
|
0
|
0
|
0
|
|
|
|
(keys %{$MenuUnit_hash_ref->{Select}})) ? 1 : 0;
|
2953
|
0
|
0
|
0
|
|
|
|
if (($gotmany
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2954
|
|
|
|
|
|
|
&& $numbor=~/^[Ff]$/) || ($picks{$picknum} ne
|
2955
|
|
|
|
|
|
|
'+' && $picks{$picknum} ne '-' &&
|
2956
|
|
|
|
|
|
|
!$gotmany)) {
|
2957
|
|
|
|
|
|
|
#print "DO WE GET HERE5! and $MenuUnit_hash_ref->{Select}\n";
|
2958
|
0
|
|
|
|
|
|
$mark_flg=1;
|
2959
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2960
|
0
|
|
|
|
|
|
substr($mark,-1)='*';
|
2961
|
0
|
0
|
0
|
|
|
|
if ((exists $FullMenu->{$MenuUnit_hash_ref}[2]
|
|
|
|
0
|
|
|
|
|
2962
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) && ref
|
2963
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
2964
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]} eq 'HASH' &&
|
2965
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$FullMenu->
|
2966
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[3]})) {
|
2967
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[3]
|
2968
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
2969
|
|
|
|
|
|
|
$convey=$FullMenu->{$MenuUnit_hash_ref}[3]
|
2970
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}->[0];
|
2971
|
0
|
|
|
|
|
|
} else { $convey=$all_menu_items_array[$picknum-1] }
|
2972
|
0
|
|
|
|
|
|
eval {
|
2973
|
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
2974
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu($FullMenu->
|
2975
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
2976
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]},$convey,
|
2977
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
2978
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
2979
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
2980
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
2981
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 1
|
2982
|
0
|
0
|
|
|
|
|
print "MENU RETURN 1\n" if $menu_return_debug;
|
2983
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
2984
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
2985
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2986
|
0
|
|
|
|
|
|
$picks{$picknum}='-';
|
2987
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2988
|
0
|
|
|
|
|
|
substr($mark,-1)='-';
|
2989
|
0
|
|
|
|
|
|
$start=${$FullMenu}{$MenuUnit_hash_ref}[11];
|
|
0
|
|
|
|
|
|
|
2990
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
2991
|
0
|
|
|
|
|
|
$picks{$picknum}='+';
|
2992
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2993
|
0
|
|
|
|
|
|
substr($mark,-1)='+';
|
2994
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
2995
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
2996
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
2997
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
2998
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
2999
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3).'::'
|
3000
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
3001
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3002
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3003
|
0
|
|
|
|
|
|
my @resu=();
|
3004
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3005
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3006
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3007
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'})
|
3008
|
|
|
|
|
|
|
&& defined
|
3009
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan) {
|
3010
|
|
|
|
|
|
|
#print "IN MAKEPLAN1\n";
|
3011
|
0
|
0
|
0
|
|
|
|
if (-1==
|
3012
|
|
|
|
|
|
|
$#{$Net::FullAuto::FA_Core::makeplan{
|
3013
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3014
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3015
|
|
|
|
|
|
|
'Title'}) {
|
3016
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3017
|
0
|
|
|
|
|
|
'Title'}=$pn{$numbor}[0];
|
3018
|
|
|
|
|
|
|
}
|
3019
|
0
|
|
|
|
|
|
my $n='Number';
|
3020
|
|
|
|
|
|
|
my $planid=
|
3021
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3022
|
0
|
|
|
|
|
|
$n};
|
3023
|
0
|
|
|
|
|
|
my $s=$sub;
|
3024
|
0
|
|
|
|
|
|
my $item=
|
3025
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(
|
3026
|
|
|
|
|
|
|
$s)->Out();
|
3027
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3028
|
0
|
|
|
|
|
|
'Plan'}},
|
3029
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3030
|
|
|
|
|
|
|
Number => $numbor,
|
3031
|
|
|
|
|
|
|
PlanID => $planid,
|
3032
|
|
|
|
|
|
|
Item => $item
|
3033
|
|
|
|
|
|
|
}
|
3034
|
|
|
|
|
|
|
}
|
3035
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
3036
|
0
|
0
|
|
|
|
|
if ($@) {
|
3037
|
0
|
0
|
0
|
|
|
|
if (10
|
3038
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3039
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3040
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3041
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,
|
3042
|
|
|
|
|
|
|
$Conveyed,$SavePick,$SaveMMap,
|
3043
|
|
|
|
|
|
|
$SaveNext,$Persists,
|
3044
|
|
|
|
|
|
|
$parent_menu,$@;
|
3045
|
|
|
|
|
|
|
}
|
3046
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3047
|
|
|
|
|
|
|
-1
|
3048
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3049
|
0
|
|
|
|
|
|
close($log_handle);
|
3050
|
|
|
|
|
|
|
}
|
3051
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3052
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3053
|
|
|
|
|
|
|
$@);
|
3054
|
0
|
|
|
|
|
|
} else { die $@ }
|
3055
|
|
|
|
|
|
|
} else {
|
3056
|
0
|
|
|
|
|
|
my $die=''
|
3057
|
|
|
|
|
|
|
."\n FATAL ERROR! - The Local "
|
3058
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname"
|
3059
|
|
|
|
|
|
|
." Conveyed\n"
|
3060
|
|
|
|
|
|
|
." the Following "
|
3061
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3062
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3063
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3064
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3065
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,
|
3066
|
|
|
|
|
|
|
$Conveyed,$SavePick,$SaveMMap,
|
3067
|
|
|
|
|
|
|
$SaveNext,$Persists,
|
3068
|
|
|
|
|
|
|
$parent_menu,$die;
|
3069
|
|
|
|
|
|
|
}
|
3070
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3071
|
|
|
|
|
|
|
-1
|
3072
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3073
|
0
|
|
|
|
|
|
close($log_handle);
|
3074
|
|
|
|
|
|
|
}
|
3075
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3076
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3077
|
|
|
|
|
|
|
$die);
|
3078
|
0
|
|
|
|
|
|
} else { die $die }
|
3079
|
|
|
|
|
|
|
}
|
3080
|
|
|
|
|
|
|
}
|
3081
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3082
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3083
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray &&
|
|
|
|
0
|
|
|
|
|
3084
|
|
|
|
|
|
|
!$no_wantarray) {
|
3085
|
0
|
|
|
|
|
|
return @resu;
|
3086
|
|
|
|
|
|
|
} else {
|
3087
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3088
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3089
|
0
|
|
|
|
|
|
} return 'DONE_SUB';
|
3090
|
|
|
|
|
|
|
}
|
3091
|
|
|
|
|
|
|
}
|
3092
|
0
|
|
|
|
|
|
eval {
|
3093
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
3094
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3095
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3096
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3097
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'})
|
3098
|
|
|
|
|
|
|
&& defined
|
3099
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan) {
|
3100
|
|
|
|
|
|
|
#print "IN MAKEPLAN2\n";
|
3101
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3102
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3103
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3104
|
|
|
|
|
|
|
'Title'}) {
|
3105
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3106
|
0
|
|
|
|
|
|
'Title'}=$pn{$numbor}[0];
|
3107
|
|
|
|
|
|
|
}
|
3108
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3109
|
0
|
|
|
|
|
|
'Plan'}},
|
3110
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3111
|
|
|
|
|
|
|
Number => $numbor,
|
3112
|
|
|
|
|
|
|
PlanID =>
|
3113
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3114
|
0
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
3115
|
|
|
|
|
|
|
}
|
3116
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
3117
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
3118
|
|
|
|
|
|
|
|
3119
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
3120
|
|
|
|
|
|
|
'Undefined subroutine') &&
|
3121
|
|
|
|
|
|
|
(-1
|
3122
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3123
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3124
|
|
|
|
|
|
|
} else {
|
3125
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3126
|
|
|
|
|
|
|
}
|
3127
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
3128
|
0
|
|
|
|
|
|
my $c=$Term::Menus::fa_code;
|
3129
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
3130
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}
|
3131
|
|
|
|
|
|
|
[2]{$all_menu_items_array[
|
3132
|
|
|
|
|
|
|
$numbor-1]}) {
|
3133
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
3134
|
|
|
|
|
|
|
."\n\t\t-> " . $FullMenu->
|
3135
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
3136
|
|
|
|
|
|
|
{$all_menu_items_array[
|
3137
|
|
|
|
|
|
|
$numbor-1]}
|
3138
|
|
|
|
|
|
|
."\n\t\tFound in the Menu "
|
3139
|
|
|
|
|
|
|
."Unit -> "
|
3140
|
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}
|
3141
|
0
|
|
|
|
|
|
."\n\t\t"
|
3142
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
3143
|
|
|
|
|
|
|
." that Does NOT Exist"
|
3144
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
3145
|
|
|
|
|
|
|
.$c.",\n\t\tnor was a routine "
|
3146
|
|
|
|
|
|
|
."with that name\n\t\tlocated"
|
3147
|
|
|
|
|
|
|
." in the main:: script.\n";
|
3148
|
|
|
|
|
|
|
} else {
|
3149
|
0
|
|
|
|
|
|
$die=
|
3150
|
|
|
|
|
|
|
"$firsterr\n $seconderr"
|
3151
|
|
|
|
|
|
|
}
|
3152
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
3153
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3154
|
|
|
|
|
|
|
$die);
|
3155
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
3156
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3157
|
|
|
|
|
|
|
$firsterr);
|
3158
|
|
|
|
|
|
|
}
|
3159
|
|
|
|
|
|
|
} else {
|
3160
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3161
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3162
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3163
|
|
|
|
|
|
|
} else {
|
3164
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3165
|
|
|
|
|
|
|
}
|
3166
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3167
|
|
|
|
|
|
|
}
|
3168
|
|
|
|
|
|
|
};
|
3169
|
0
|
0
|
|
|
|
|
if ($@) {
|
3170
|
0
|
0
|
0
|
|
|
|
if (10
|
3171
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3172
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3173
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3174
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3175
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3176
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3177
|
|
|
|
|
|
|
}
|
3178
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3179
|
|
|
|
|
|
|
-1
|
3180
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3181
|
0
|
|
|
|
|
|
close($log_handle);
|
3182
|
|
|
|
|
|
|
}
|
3183
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3184
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3185
|
0
|
|
|
|
|
|
} else { die $@ }
|
3186
|
|
|
|
|
|
|
} else {
|
3187
|
0
|
|
|
|
|
|
my $die=''
|
3188
|
|
|
|
|
|
|
."\n FATAL ERROR! - The Local "
|
3189
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3190
|
|
|
|
|
|
|
."Conveyed\n"
|
3191
|
|
|
|
|
|
|
." the Following "
|
3192
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3193
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3194
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3195
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3196
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3197
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3198
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3199
|
|
|
|
|
|
|
}
|
3200
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3201
|
|
|
|
|
|
|
-1
|
3202
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3203
|
0
|
|
|
|
|
|
close($log_handle);
|
3204
|
|
|
|
|
|
|
}
|
3205
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3206
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3207
|
|
|
|
|
|
|
$die);
|
3208
|
0
|
|
|
|
|
|
} else { die $die }
|
3209
|
|
|
|
|
|
|
}
|
3210
|
|
|
|
|
|
|
}
|
3211
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3212
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3213
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3214
|
0
|
|
|
|
|
|
return @resu;
|
3215
|
|
|
|
|
|
|
} else {
|
3216
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3217
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3218
|
|
|
|
|
|
|
}
|
3219
|
|
|
|
|
|
|
}
|
3220
|
|
|
|
|
|
|
}
|
3221
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3222
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
3223
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
3224
|
0
|
|
|
|
|
|
return $menu_output;
|
3225
|
|
|
|
|
|
|
} else {
|
3226
|
0
|
|
|
|
|
|
$picks{$picknum}='+';
|
3227
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3228
|
0
|
|
|
|
|
|
substr($mark,-1)='+';
|
3229
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3230
|
|
|
|
|
|
|
}
|
3231
|
|
|
|
|
|
|
}
|
3232
|
|
|
|
|
|
|
}
|
3233
|
|
|
|
|
|
|
} else {
|
3234
|
0
|
|
|
|
|
|
$mark='';
|
3235
|
0
|
|
|
|
|
|
my $mark_len=$FullMenu->{$MenuUnit_hash_ref}[7]{BLANK};
|
3236
|
0
|
|
|
|
|
|
while ($mark_len--) {
|
3237
|
0
|
|
|
|
|
|
$mark.=' ';
|
3238
|
|
|
|
|
|
|
}
|
3239
|
|
|
|
|
|
|
}
|
3240
|
|
|
|
|
|
|
$mark=$FullMenu->{$MenuUnit_hash_ref}[7]
|
3241
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}
|
3242
|
|
|
|
|
|
|
if exists $FullMenu->{$MenuUnit_hash_ref}[7]
|
3243
|
0
|
0
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3244
|
0
|
0
|
0
|
|
|
|
if (!$hidedefaults &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3245
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[5] eq 'HASH'
|
3246
|
|
|
|
|
|
|
&& $FullMenu->{$MenuUnit_hash_ref}[5]
|
3247
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]} && ($FullMenu->
|
3248
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[5]{$all_menu_items_array[$picknum-1]}
|
3249
|
|
|
|
|
|
|
eq '*' || $all_menu_items_array[$picknum-1]=~
|
3250
|
|
|
|
|
|
|
/$FullMenu->{$MenuUnit_hash_ref}[5]{
|
3251
|
|
|
|
|
|
|
$all_menu_items_array[$picknum-1]}/)) {
|
3252
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3253
|
0
|
|
|
|
|
|
substr($mark,-1)='*';$mark_flg=1;
|
|
0
|
|
|
|
|
|
|
3254
|
0
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}{$picknum}='*';
|
3255
|
|
|
|
|
|
|
}
|
3256
|
0
|
|
|
|
|
|
$picknum_for_display=$picknum;
|
3257
|
0
|
0
|
0
|
|
|
|
if (ref $FullMenu->{$MenuUnit_hash_ref}[8] eq 'HASH'
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3258
|
0
|
|
|
|
|
|
&& keys %{$FullMenu->{$MenuUnit_hash_ref}[8]} &&
|
3259
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[8]
|
3260
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}
|
3261
|
|
|
|
|
|
|
&& $FullMenu->{$MenuUnit_hash_ref}[8]
|
3262
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
3263
|
|
|
|
|
|
|
$picknum_for_display=
|
3264
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[8]
|
3265
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3266
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3267
|
0
|
0
|
0
|
|
|
|
if (exists $SavePick->{$MenuUnit_hash_ref}
|
3268
|
|
|
|
|
|
|
{$picknum_for_display} &&
|
3269
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}
|
3270
|
|
|
|
|
|
|
{$picknum_for_display}) {
|
3271
|
|
|
|
|
|
|
substr($mark,-1)=$SavePick->{$MenuUnit_hash_ref}
|
3272
|
0
|
|
|
|
|
|
{$picknum_for_display}
|
3273
|
0
|
|
|
|
|
|
} else { $mark=' ' }
|
3274
|
0
|
0
|
|
|
|
|
$mark_flg=1 unless $mark=~/^ +$/;
|
3275
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=1
|
3276
|
0
|
0
|
|
|
|
|
if $Persists->{$parent_menu}{defaults};
|
3277
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}[9]) {
|
3278
|
0
|
|
|
|
|
|
$filtered_menu=1;
|
3279
|
|
|
|
|
|
|
}
|
3280
|
|
|
|
|
|
|
}
|
3281
|
0
|
|
|
|
|
|
$pn{$picknum_for_display}=
|
3282
|
|
|
|
|
|
|
[ $all_menu_items_array[$picknum-1],$picknum ];
|
3283
|
0
|
|
|
|
|
|
my $scroll=' ';
|
3284
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Scroll}
|
|
|
|
0
|
|
|
|
|
3285
|
|
|
|
|
|
|
&& ($MenuUnit_hash_ref->{Scroll}->[1] eq $picknum
|
3286
|
|
|
|
|
|
|
|| $MenuUnit_hash_ref->{Scroll}->[0] eq $picknum)) {
|
3287
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref->{Scroll}->[0]) {
|
3288
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref->{Scroll}->[0] eq $picknum) {
|
3289
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$picknum;
|
3290
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[0]=0;
|
3291
|
0
|
|
|
|
|
|
$scroll='>';
|
3292
|
|
|
|
|
|
|
}
|
3293
|
|
|
|
|
|
|
} else {
|
3294
|
0
|
|
|
|
|
|
$scroll='>';
|
3295
|
|
|
|
|
|
|
}
|
3296
|
|
|
|
|
|
|
}
|
3297
|
0
|
|
|
|
|
|
my $picknum_display=sprintf "%-7s",$picknum_for_display;
|
3298
|
0
|
|
|
|
|
|
$menu_text.=" $scroll$mark $picknum_display"
|
3299
|
|
|
|
|
|
|
."$all_menu_items_array[$picknum-1]\n";
|
3300
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[6]
|
3301
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
3302
|
|
|
|
|
|
|
my $tstt=$FullMenu->{$MenuUnit_hash_ref}[6]
|
3303
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3304
|
0
|
0
|
|
|
|
|
if ($tstt=~/many/i) {
|
3305
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}{$picknum_for_display}='many';
|
3306
|
|
|
|
|
|
|
}
|
3307
|
|
|
|
|
|
|
}
|
3308
|
0
|
0
|
0
|
|
|
|
if ($mark=~/^ +$/ || (exists $picks{$picknum} ||
|
|
|
|
0
|
|
|
|
|
3309
|
|
|
|
|
|
|
exists $picks{$picknum_for_display})) {
|
3310
|
0
|
|
|
|
|
|
${$_[0]}[$picknum_for_display-1]=
|
|
0
|
|
|
|
|
|
|
3311
|
|
|
|
|
|
|
$all_menu_items_array[$picknum-1];
|
3312
|
|
|
|
|
|
|
}
|
3313
|
0
|
|
|
|
|
|
$picknum++;
|
3314
|
0
|
|
|
|
|
|
$numlist--;
|
3315
|
0
|
|
|
|
|
|
} $hidedefaults=1;$picknum--;
|
|
0
|
|
|
|
|
|
|
3316
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3317
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3318
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
3319
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan &&
|
3320
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults} &&
|
3321
|
|
|
|
|
|
|
!$filtered_menu) {
|
3322
|
0
|
|
|
|
|
|
my %askmenu=(
|
3323
|
|
|
|
|
|
|
|
3324
|
|
|
|
|
|
|
Item_1 => {
|
3325
|
|
|
|
|
|
|
|
3326
|
|
|
|
|
|
|
Text => "Use the result saved with the \"Plan\""
|
3327
|
|
|
|
|
|
|
|
3328
|
|
|
|
|
|
|
},
|
3329
|
|
|
|
|
|
|
Item_2 => {
|
3330
|
|
|
|
|
|
|
|
3331
|
|
|
|
|
|
|
Text => "Use the \"Default\" setting to determine result"
|
3332
|
|
|
|
|
|
|
|
3333
|
|
|
|
|
|
|
},
|
3334
|
|
|
|
|
|
|
NoPlan => 1,
|
3335
|
|
|
|
|
|
|
Banner => " FullAuto has determined that the ".
|
3336
|
|
|
|
|
|
|
&pw($MenuUnit_hash_ref) .
|
3337
|
|
|
|
|
|
|
" Menu has been\n".
|
3338
|
|
|
|
|
|
|
" configured with a \"Default\" setting."
|
3339
|
|
|
|
|
|
|
|
3340
|
|
|
|
|
|
|
);
|
3341
|
0
|
|
|
|
|
|
my $answ=Menu(\%askmenu);
|
3342
|
0
|
0
|
|
|
|
|
if ($answ eq ']quit[') {
|
3343
|
0
|
|
|
|
|
|
return ']quit['
|
3344
|
|
|
|
|
|
|
}
|
3345
|
0
|
0
|
|
|
|
|
if (-1==index $answ,'result saved') {
|
3346
|
|
|
|
|
|
|
#print "IN MAKEPLAN3\n";
|
3347
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
3348
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
3349
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=$pn{$numbor}[0];
|
3350
|
|
|
|
|
|
|
}
|
3351
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
3352
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3353
|
|
|
|
|
|
|
Number => 'Default',
|
3354
|
|
|
|
|
|
|
PlanID =>
|
3355
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3356
|
0
|
|
|
|
|
|
Item => '' };
|
3357
|
0
|
|
|
|
|
|
$got_default=1;
|
3358
|
|
|
|
|
|
|
}
|
3359
|
|
|
|
|
|
|
}
|
3360
|
0
|
0
|
|
|
|
|
unless ($Persists->{unattended}) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3361
|
0
|
0
|
|
|
|
|
if ($^O ne 'cygwin') {
|
3362
|
0
|
0
|
|
|
|
|
unless ($noclear) {
|
3363
|
0
|
0
|
0
|
|
|
|
if ($^O eq 'MSWin32' || $^O eq 'MSWin64') {
|
3364
|
0
|
|
|
|
|
|
system("cmd /c cls");
|
3365
|
0
|
|
|
|
|
|
print "\n";
|
3366
|
|
|
|
|
|
|
} else {
|
3367
|
0
|
|
|
|
|
|
print `${Term::Menus::clearpath}clear`."\n";
|
3368
|
0
|
|
|
|
|
|
print $blanklines
|
3369
|
|
|
|
|
|
|
}
|
3370
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3371
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3372
|
0
|
|
|
|
|
|
print $menu_text;my $ch=0;
|
|
0
|
|
|
|
|
|
|
3373
|
0
|
0
|
0
|
|
|
|
if ($select_many || (keys %{${$MenuUnit_hash_ref}{Select}})) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3374
|
0
|
|
|
|
|
|
print "\n";
|
3375
|
0
|
0
|
|
|
|
|
unless (keys %{$FullMenu->{$MenuUnit_hash_ref}[1]}) {
|
|
0
|
|
|
|
|
|
|
3376
|
0
|
|
|
|
|
|
print " a. Select All";$ch=1;
|
|
0
|
|
|
|
|
|
|
3377
|
|
|
|
|
|
|
}
|
3378
|
0
|
0
|
0
|
|
|
|
if ($mark_flg==1 || $Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3379
|
0
|
|
|
|
|
|
print " c. Clear All";#print "\n" if $ch;
|
3380
|
|
|
|
|
|
|
}
|
3381
|
0
|
|
|
|
|
|
print " f. FINISH\n";
|
3382
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3383
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3384
|
|
|
|
|
|
|
}
|
3385
|
0
|
0
|
0
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults} &&
|
3386
|
|
|
|
|
|
|
!$filtered_menu) {
|
3387
|
0
|
|
|
|
|
|
print "\n == Default Selections Exist! == ",
|
3388
|
|
|
|
|
|
|
"(Type '*' to view them)\n";
|
3389
|
|
|
|
|
|
|
}
|
3390
|
|
|
|
|
|
|
} else {
|
3391
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
|
|
0
|
|
|
|
|
|
3392
|
0
|
|
|
|
|
|
print "\n",
|
3393
|
|
|
|
|
|
|
" c. Clear Default Selection.",
|
3394
|
|
|
|
|
|
|
" f. FINISH with Default Selection.\n";
|
3395
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3396
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3397
|
|
|
|
|
|
|
} else {
|
3398
|
0
|
|
|
|
|
|
print "\n == Default Selection Exists! == ",
|
3399
|
|
|
|
|
|
|
"(Type '*' to view it)\n";
|
3400
|
|
|
|
|
|
|
}
|
3401
|
|
|
|
|
|
|
} elsif ($filtered_menu) {
|
3402
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3403
|
|
|
|
|
|
|
}
|
3404
|
|
|
|
|
|
|
}
|
3405
|
0
|
0
|
|
|
|
|
if ($display_this_many_items<$num_pick) {
|
3406
|
0
|
|
|
|
|
|
my $len=length $num_pick;my $pad='';
|
|
0
|
|
|
|
|
|
|
3407
|
0
|
|
|
|
|
|
foreach my $n (1..$len) {
|
3408
|
0
|
|
|
|
|
|
$pad.=' ';
|
3409
|
|
|
|
|
|
|
}
|
3410
|
0
|
|
|
|
|
|
print $pad,
|
3411
|
|
|
|
|
|
|
"\n $num_pick Total Choices ",
|
3412
|
|
|
|
|
|
|
"[v][^] Scroll with ARROW keys ".
|
3413
|
|
|
|
|
|
|
" [F1] for HELP\n";
|
3414
|
0
|
|
|
|
|
|
} else { print "\n \(Press [F1] for HELP\)\n" }
|
3415
|
0
|
0
|
|
|
|
|
if ($Term::Menus::term_input) {
|
3416
|
0
|
|
|
|
|
|
print "\n";
|
3417
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Input} &&
|
|
|
0
|
|
|
|
|
|
3418
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Input}) {
|
3419
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3420
|
|
|
|
|
|
|
" Press ENTER when finished ",1);
|
3421
|
0
|
0
|
0
|
|
|
|
next unless ($ikey eq 'ENTER' || $ikey eq 'ESC' ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3422
|
|
|
|
|
|
|
$ikey eq 'UPARROW' || $ikey eq 'DOWNARROW' ||
|
3423
|
|
|
|
|
|
|
$ikey eq 'LEFTARROW' || $ikey eq 'RIGHTARROW' ||
|
3424
|
|
|
|
|
|
|
$ikey eq 'F1');
|
3425
|
|
|
|
|
|
|
} elsif ($show_banner_only) {
|
3426
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3427
|
|
|
|
|
|
|
" Press ENTER to continue ... ");
|
3428
|
|
|
|
|
|
|
|
3429
|
|
|
|
|
|
|
} else {
|
3430
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3431
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ");
|
3432
|
|
|
|
|
|
|
}
|
3433
|
0
|
|
|
|
|
|
print "\n";
|
3434
|
|
|
|
|
|
|
} else {
|
3435
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
3436
|
0
|
|
|
|
|
|
print "\n \([ESC] to Quit\)",
|
3437
|
|
|
|
|
|
|
" Press ENTER to continue ... ";
|
3438
|
|
|
|
|
|
|
} else {
|
3439
|
0
|
|
|
|
|
|
print "\n \([ESC] to Quit\)",
|
3440
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ";
|
3441
|
|
|
|
|
|
|
}
|
3442
|
0
|
|
|
|
|
|
$numbor=;
|
3443
|
0
|
|
|
|
|
|
} $picknum_for_display=$numbor;chomp $picknum_for_display;
|
|
0
|
|
|
|
|
|
|
3444
|
0
|
|
|
|
|
|
} elsif ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3445
|
0
|
|
|
|
|
|
$numbor='f';
|
3446
|
0
|
0
|
|
|
|
|
} elsif (wantarray && !$no_wantarray) {
|
3447
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - 'Unattended' mode cannot be\n"
|
3448
|
|
|
|
|
|
|
." used without a Plan or Default\n"
|
3449
|
|
|
|
|
|
|
." Selections being available.";
|
3450
|
0
|
|
|
|
|
|
return '',$die;
|
3451
|
|
|
|
|
|
|
} else {
|
3452
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - 'Unattended' mode cannot be\n"
|
3453
|
|
|
|
|
|
|
." used without a Plan or Default\n"
|
3454
|
|
|
|
|
|
|
." Selections being available.";
|
3455
|
0
|
|
|
|
|
|
die($die);
|
3456
|
|
|
|
|
|
|
}
|
3457
|
0
|
0
|
0
|
|
|
|
if ($numbor=~/^[Ff]$/ &&
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3458
|
|
|
|
|
|
|
($Persists->{$MenuUnit_hash_ref}{defaults} ||
|
3459
|
|
|
|
|
|
|
$filtered_menu)) {
|
3460
|
|
|
|
|
|
|
# FINISH
|
3461
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
3462
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
3463
|
0
|
|
|
|
|
|
my $choice='';my @keys=();
|
|
0
|
|
|
|
|
|
|
3464
|
0
|
|
|
|
|
|
my $chosen='';
|
3465
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3466
|
0
|
|
|
|
|
|
$chosen=$parent_menu;
|
3467
|
0
|
|
|
|
|
|
return '-',
|
3468
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
3469
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3470
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
3471
|
0
|
|
|
|
|
|
} else { $chosen=$MenuUnit_hash_ref }
|
3472
|
0
|
|
|
|
|
|
@keys=keys %picks;
|
3473
|
0
|
0
|
|
|
|
|
if (-1==$#keys) {
|
3474
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3475
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3476
|
0
|
|
|
|
|
|
$chosen=$parent_menu;
|
3477
|
|
|
|
|
|
|
}
|
3478
|
0
|
|
|
|
|
|
my $it=${[keys %{${$FullMenu}{$chosen}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3479
|
0
|
|
|
|
|
|
my $def=${$FullMenu}{$chosen}[5]{$it};
|
|
0
|
|
|
|
|
|
|
3480
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
3481
|
0
|
0
|
|
|
|
|
if ($def) {
|
3482
|
0
|
|
|
|
|
|
my $cnt=1;
|
3483
|
0
|
|
|
|
|
|
foreach my $item (@all_menu_items_array) {
|
3484
|
|
|
|
|
|
|
#sort @{[keys %{${$FullMenu}{$chosen}[5]}]}) {
|
3485
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
3486
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
3487
|
0
|
|
|
|
|
|
push @keys, $item;
|
3488
|
0
|
|
|
|
|
|
} $cnt++
|
3489
|
|
|
|
|
|
|
}
|
3490
|
|
|
|
|
|
|
}
|
3491
|
|
|
|
|
|
|
} else {
|
3492
|
0
|
|
|
|
|
|
@keys=keys %{$SavePick->{$parent_menu}};
|
|
0
|
|
|
|
|
|
|
3493
|
0
|
0
|
|
|
|
|
if (-1==$#keys) {
|
3494
|
0
|
0
|
|
|
|
|
if ($^O ne 'cygwin') {
|
3495
|
0
|
0
|
|
|
|
|
unless ($noclear) {
|
3496
|
0
|
0
|
0
|
|
|
|
if ($^O eq 'MSWin32' || $^O eq 'MSWin64') {
|
3497
|
0
|
|
|
|
|
|
system("cmd /c cls");
|
3498
|
0
|
|
|
|
|
|
print "\n";
|
3499
|
|
|
|
|
|
|
} else {
|
3500
|
0
|
|
|
|
|
|
print `${Term::Menus::clearpath}clear`."\n";
|
3501
|
|
|
|
|
|
|
}
|
3502
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3503
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3504
|
0
|
|
|
|
|
|
print "\n\n Attention USER! :\n\n ",
|
3505
|
|
|
|
|
|
|
"You have selected \"f\" to finish your\n",
|
3506
|
|
|
|
|
|
|
" selections, BUT -> You have not actually\n",
|
3507
|
|
|
|
|
|
|
" selected anything!\n\n Do you wish ",
|
3508
|
|
|
|
|
|
|
"to quit or re-attempt selecting?\n\n ",
|
3509
|
|
|
|
|
|
|
"Press [ESC] to quit or ENTER to continue ... ";
|
3510
|
0
|
0
|
|
|
|
|
if ($Term::Menus::term_input) {
|
3511
|
0
|
|
|
|
|
|
print "\n";
|
3512
|
0
|
|
|
|
|
|
($choice,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3513
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ");
|
3514
|
0
|
|
|
|
|
|
print "\n";
|
3515
|
|
|
|
|
|
|
} else {
|
3516
|
0
|
|
|
|
|
|
print " \([ESC] to Quit\)",
|
3517
|
|
|
|
|
|
|
"\n PLEASE ENTER A CHOICE: ";
|
3518
|
0
|
|
|
|
|
|
$choice=;
|
3519
|
|
|
|
|
|
|
}
|
3520
|
0
|
|
|
|
|
|
chomp($choice);
|
3521
|
0
|
0
|
|
|
|
|
next if lc($choice) ne 'quit';
|
3522
|
0
|
|
|
|
|
|
return ']quit['
|
3523
|
|
|
|
|
|
|
}
|
3524
|
|
|
|
|
|
|
}
|
3525
|
|
|
|
|
|
|
}
|
3526
|
0
|
|
|
|
|
|
my $return_values=0;
|
3527
|
0
|
|
|
0
|
0
|
|
sub numerically { $a <=> $b }
|
3528
|
0
|
|
|
|
|
|
my %dupseen=();my @pickd=();
|
|
0
|
|
|
|
|
|
|
3529
|
0
|
|
|
|
|
|
foreach my $pk (sort numerically keys %picks) {
|
3530
|
|
|
|
|
|
|
$return_values=1 if !exists
|
3531
|
0
|
|
|
|
|
|
${$FullMenu}{$chosen}[2]{${$_[0]}[$pk-1]}
|
|
0
|
|
|
|
|
|
|
3532
|
|
|
|
|
|
|
|| !keys
|
3533
|
0
|
0
|
0
|
|
|
|
%{${$FullMenu}{$chosen}[2]{${$_[0]}[$pk-1]}};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3534
|
0
|
0
|
0
|
|
|
|
if (${${$FullMenu}{$parent_menu}[10]}[$pk-1] &&
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
3535
|
0
|
|
|
|
|
|
!${$_[0]}[$pk-1]) {
|
3536
|
0
|
|
|
|
|
|
my $txt=${${$FullMenu}{$parent_menu}[10]}[$pk-1];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3537
|
0
|
0
|
|
|
|
|
if (-1
|
3538
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3539
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3540
|
|
|
|
|
|
|
}
|
3541
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3542
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3543
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3544
|
0
|
|
|
|
|
|
} elsif (${$_[0]}[$pk-1]) {
|
3545
|
0
|
|
|
|
|
|
my $txt=${$_[0]}[$pk-1];
|
|
0
|
|
|
|
|
|
|
3546
|
0
|
0
|
|
|
|
|
if (-1
|
3547
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3548
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3549
|
|
|
|
|
|
|
}
|
3550
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3551
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3552
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3553
|
|
|
|
|
|
|
} elsif ($pn{$picknum}) {
|
3554
|
0
|
|
|
|
|
|
my $txt=$pn{$picknum}[0];
|
3555
|
0
|
0
|
|
|
|
|
if (-1
|
3556
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3557
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3558
|
|
|
|
|
|
|
}
|
3559
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3560
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3561
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3562
|
|
|
|
|
|
|
}
|
3563
|
|
|
|
|
|
|
}
|
3564
|
0
|
0
|
0
|
|
|
|
if ($return_values && $Term::Menus::fullauto &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3565
|
|
|
|
|
|
|
(!exists ${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3566
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3567
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3568
|
|
|
|
|
|
|
#print "IN MAKEPLAN4\n";
|
3569
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
3570
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
3571
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=
|
3572
|
|
|
|
|
|
|
"Multiple Selections";
|
3573
|
|
|
|
|
|
|
}
|
3574
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
3575
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
3576
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3577
|
|
|
|
|
|
|
Number => 'Multiple',
|
3578
|
|
|
|
|
|
|
PlanID =>
|
3579
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3580
|
0
|
|
|
|
|
|
Item => "'".
|
3581
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(\@pickd)->Out().
|
3582
|
|
|
|
|
|
|
"'" }
|
3583
|
|
|
|
|
|
|
}
|
3584
|
|
|
|
|
|
|
}
|
3585
|
0
|
0
|
|
|
|
|
return \@pickd if $return_values;
|
3586
|
0
|
|
|
|
|
|
return 'DONE';
|
3587
|
|
|
|
|
|
|
} elsif ($numbor=~/^\s*%(.*)/s) {
|
3588
|
|
|
|
|
|
|
# PERCENT SYMBOL SORT ORDER
|
3589
|
0
|
|
0
|
|
|
|
my $one=$1||'';
|
3590
|
0
|
|
|
|
|
|
chomp $one;
|
3591
|
0
|
0
|
|
|
|
|
$one=qr/$one/ if $one;
|
3592
|
0
|
|
|
|
|
|
my @spl=();
|
3593
|
0
|
|
|
|
|
|
chomp $numbor;
|
3594
|
0
|
|
|
|
|
|
my $cnt=0;my $ct=0;my @splice=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3595
|
0
|
|
|
|
|
|
my $sort_ed='';
|
3596
|
0
|
0
|
0
|
|
|
|
if ($one) {
|
|
|
0
|
|
|
|
|
|
3597
|
|
|
|
|
|
|
|
3598
|
|
|
|
|
|
|
} elsif ($sorted && $sorted eq 'forward') {
|
3599
|
0
|
|
|
|
|
|
@spl=reverse @all_menu_items_array;$sort_ed='reverse';
|
|
0
|
|
|
|
|
|
|
3600
|
0
|
|
|
|
|
|
} else { @spl=sort @all_menu_items_array;$sort_ed='forward' }
|
|
0
|
|
|
|
|
|
|
3601
|
0
|
0
|
|
|
|
|
next if $#spl==-1;
|
3602
|
0
|
|
|
|
|
|
my %sort=();
|
3603
|
0
|
|
|
|
|
|
foreach my $line (@all_menu_items_array) {
|
3604
|
0
|
|
|
|
|
|
$cnt++;
|
3605
|
0
|
0
|
0
|
|
|
|
if (exists $pn{$picknum} &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3606
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[8]
|
3607
|
|
|
|
|
|
|
{$pn{$picknum}[0]} && $FullMenu->
|
3608
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$pn{$picknum}[0]} &&
|
3609
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[8]
|
3610
|
|
|
|
|
|
|
{$pn{$picknum}[0]} eq 'HASH' &&
|
3611
|
|
|
|
|
|
|
keys %{$FullMenu->{$MenuUnit_hash_ref}[8]
|
3612
|
0
|
|
|
|
|
|
{$pn{$picknum}[0]}} && $FullMenu->
|
3613
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$pn{$picknum}[0]}) {
|
3614
|
0
|
|
|
|
|
|
$sort{$line}=$FullMenu->{$MenuUnit_hash_ref}[8]{$line};
|
3615
|
0
|
|
|
|
|
|
} else { $sort{$line}=$cnt }
|
3616
|
0
|
|
|
|
|
|
} $cnt=0;
|
3617
|
0
|
|
|
|
|
|
my $chosen='';
|
3618
|
0
|
0
|
|
|
|
|
if (!$sorted) {
|
3619
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
3620
|
|
|
|
|
|
|
$chosen={
|
3621
|
|
|
|
|
|
|
Select => $send_select,
|
3622
|
0
|
|
|
|
|
|
Banner => ${$MenuUnit_hash_ref}{Banner},
|
3623
|
0
|
|
|
|
|
|
};
|
3624
|
0
|
|
|
|
|
|
my $cnt=0;
|
3625
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
3626
|
0
|
|
|
|
|
|
my $num=$sort{$text};
|
3627
|
0
|
|
|
|
|
|
$cnt++;
|
3628
|
0
|
0
|
|
|
|
|
if (exists $picks{$num}) {
|
3629
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3630
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
3631
|
|
|
|
|
|
|
} else {
|
3632
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3633
|
|
|
|
|
|
|
{ Text => $text,__NUM__=>$num };
|
3634
|
|
|
|
|
|
|
}
|
3635
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
3636
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3637
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
3638
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3639
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3640
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Sort}=$sort_ed;
|
3641
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
3642
|
0
|
|
|
|
|
|
} $sorted=$sort_ed;
|
3643
|
|
|
|
|
|
|
} else {
|
3644
|
0
|
|
|
|
|
|
@all_menu_items_array=reverse @all_menu_items_array;
|
3645
|
0
|
|
|
|
|
|
next;
|
3646
|
|
|
|
|
|
|
}
|
3647
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
3648
|
0
|
|
|
|
|
|
my @return_from_filtered_menu=();
|
3649
|
0
|
|
|
|
|
|
eval {
|
3650
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3651
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3652
|
|
|
|
|
|
|
@return_from_filtered_menu)=&Menu(
|
3653
|
|
|
|
|
|
|
$chosen,$picks_from_parent,
|
3654
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
3655
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3656
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3657
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
3658
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 2
|
3659
|
0
|
0
|
|
|
|
|
print "MENU RETURN 2\n" if $menu_return_debug;
|
3660
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3661
|
0
|
0
|
|
|
|
|
if (-1<$#return_from_filtered_menu) {
|
3662
|
0
|
0
|
|
|
|
|
if ((values %{$menu_output})[0] eq 'recurse') {
|
|
0
|
|
|
|
|
|
|
3663
|
0
|
|
|
|
|
|
my %k=%{$menu_output};
|
|
0
|
|
|
|
|
|
|
3664
|
0
|
|
|
|
|
|
delete $k{Menu};
|
3665
|
0
|
|
|
|
|
|
my $lab=(keys %k)[0];
|
3666
|
0
|
|
|
|
|
|
$menu_output=$labels{$lab};
|
3667
|
|
|
|
|
|
|
}
|
3668
|
0
|
|
|
|
|
|
$MenuMap=$Persists->{$MenuUnit_hash_ref};
|
3669
|
0
|
|
|
|
|
|
eval {
|
3670
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3671
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu(
|
3672
|
|
|
|
|
|
|
$menu_output,$FullMenu,
|
3673
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3674
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3675
|
|
|
|
|
|
|
$return_from_filtered_menu[0],
|
3676
|
|
|
|
|
|
|
$MenuUnit_hash_ref,
|
3677
|
|
|
|
|
|
|
$return_from_filtered_menu[2]);
|
3678
|
|
|
|
|
|
|
};
|
3679
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3680
|
|
|
|
|
|
|
}
|
3681
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
3682
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3683
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$chosen}};
|
|
0
|
|
|
|
|
|
|
3684
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3685
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
3686
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$chosen}};
|
|
0
|
|
|
|
|
|
|
3687
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3688
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3689
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
3690
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3691
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
3692
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
3693
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
3694
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
3695
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3696
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3697
|
0
|
|
|
|
|
|
my @resu=();
|
3698
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3699
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3700
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3701
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3702
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3703
|
|
|
|
|
|
|
#print "IN MAKEPLAN5\n";
|
3704
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3705
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3706
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3707
|
|
|
|
|
|
|
'Title'}) {
|
3708
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3709
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3710
|
|
|
|
|
|
|
}
|
3711
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3712
|
0
|
|
|
|
|
|
'Plan'}},
|
3713
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3714
|
|
|
|
|
|
|
Number => $numbor,
|
3715
|
|
|
|
|
|
|
PlanID =>
|
3716
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3717
|
0
|
|
|
|
|
|
'Number'},
|
3718
|
|
|
|
|
|
|
Item =>
|
3719
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
3720
|
|
|
|
|
|
|
}
|
3721
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
3722
|
0
|
0
|
|
|
|
|
if ($@) {
|
3723
|
0
|
0
|
0
|
|
|
|
if (10
|
3724
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3725
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3726
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3727
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3728
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3729
|
|
|
|
|
|
|
}
|
3730
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3731
|
|
|
|
|
|
|
-1
|
3732
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3733
|
0
|
|
|
|
|
|
close($log_handle);
|
3734
|
|
|
|
|
|
|
}
|
3735
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3736
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3737
|
0
|
|
|
|
|
|
} else { die $@ }
|
3738
|
|
|
|
|
|
|
} else {
|
3739
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
3740
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3741
|
|
|
|
|
|
|
."Conveyed\n"
|
3742
|
|
|
|
|
|
|
." the Following "
|
3743
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3744
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3745
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3746
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3747
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3748
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3749
|
|
|
|
|
|
|
}
|
3750
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3751
|
|
|
|
|
|
|
-1
|
3752
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3753
|
0
|
|
|
|
|
|
close($log_handle);
|
3754
|
|
|
|
|
|
|
}
|
3755
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3756
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3757
|
0
|
|
|
|
|
|
} else { die $die }
|
3758
|
|
|
|
|
|
|
}
|
3759
|
|
|
|
|
|
|
}
|
3760
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3761
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3762
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3763
|
0
|
|
|
|
|
|
return @resu;
|
3764
|
|
|
|
|
|
|
} else {
|
3765
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3766
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3767
|
|
|
|
|
|
|
}
|
3768
|
|
|
|
|
|
|
}
|
3769
|
0
|
|
|
|
|
|
$done=1;last
|
3770
|
0
|
|
|
|
|
|
}
|
3771
|
0
|
|
|
|
|
|
eval {
|
3772
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
3773
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3774
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3775
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3776
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3777
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3778
|
|
|
|
|
|
|
#print "IN MAKEPLAN6\n";
|
3779
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3780
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3781
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3782
|
|
|
|
|
|
|
'Title'}) {
|
3783
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3784
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3785
|
|
|
|
|
|
|
}
|
3786
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3787
|
0
|
|
|
|
|
|
'Plan'}},
|
3788
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3789
|
|
|
|
|
|
|
Number => $numbor,
|
3790
|
|
|
|
|
|
|
PlanID =>
|
3791
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3792
|
0
|
|
|
|
|
|
'Number'},
|
3793
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
3794
|
|
|
|
|
|
|
}
|
3795
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
3796
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
3797
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
3798
|
|
|
|
|
|
|
(-1
|
3799
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3800
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3801
|
|
|
|
|
|
|
} else {
|
3802
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3803
|
|
|
|
|
|
|
}
|
3804
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
3805
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
3806
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}
|
3807
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
3808
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
3809
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
3810
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
3811
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
3812
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
3813
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
3814
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
3815
|
|
|
|
|
|
|
." that Does NOT Exist"
|
3816
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
3817
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
3818
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
3819
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
3820
|
|
|
|
|
|
|
." main:: script.\n";
|
3821
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
3822
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
3823
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3824
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
3825
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
3826
|
|
|
|
|
|
|
}
|
3827
|
|
|
|
|
|
|
} else {
|
3828
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3829
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3830
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3831
|
|
|
|
|
|
|
} else {
|
3832
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3833
|
|
|
|
|
|
|
}
|
3834
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3835
|
|
|
|
|
|
|
}
|
3836
|
|
|
|
|
|
|
};
|
3837
|
0
|
0
|
|
|
|
|
if ($@) {
|
3838
|
0
|
0
|
0
|
|
|
|
if (10
|
3839
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3840
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3841
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3842
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3843
|
|
|
|
|
|
|
}
|
3844
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3845
|
|
|
|
|
|
|
-1
|
3846
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3847
|
0
|
|
|
|
|
|
close($log_handle);
|
3848
|
|
|
|
|
|
|
}
|
3849
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3850
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3851
|
0
|
|
|
|
|
|
} else { die $@ }
|
3852
|
|
|
|
|
|
|
} else {
|
3853
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
3854
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3855
|
|
|
|
|
|
|
."Conveyed\n"
|
3856
|
|
|
|
|
|
|
." the Following "
|
3857
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3858
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3859
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3860
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3861
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3862
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3863
|
|
|
|
|
|
|
}
|
3864
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3865
|
|
|
|
|
|
|
-1
|
3866
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3867
|
0
|
|
|
|
|
|
close($log_handle);
|
3868
|
|
|
|
|
|
|
}
|
3869
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3870
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3871
|
0
|
|
|
|
|
|
} else { die $die }
|
3872
|
|
|
|
|
|
|
}
|
3873
|
|
|
|
|
|
|
}
|
3874
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3875
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3876
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3877
|
0
|
|
|
|
|
|
return @resu;
|
3878
|
|
|
|
|
|
|
} else {
|
3879
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3880
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3881
|
|
|
|
|
|
|
}
|
3882
|
|
|
|
|
|
|
}
|
3883
|
|
|
|
|
|
|
}
|
3884
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3885
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
3886
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
3887
|
0
|
|
|
|
|
|
return $menu_output;
|
3888
|
|
|
|
|
|
|
} else {
|
3889
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3890
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3891
|
|
|
|
|
|
|
}
|
3892
|
|
|
|
|
|
|
} elsif ($numbor=~/^\*\s*$/s) {
|
3893
|
|
|
|
|
|
|
# SHOW DEFAULT SELECTIONS using STAR symbol
|
3894
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3895
|
0
|
|
|
|
|
|
print "\n WARNING!: Only -ONE- Level of Filtering",
|
3896
|
|
|
|
|
|
|
" is Supported!\n";
|
3897
|
0
|
|
|
|
|
|
sleep 2;
|
3898
|
0
|
|
|
|
|
|
last;
|
3899
|
|
|
|
|
|
|
}
|
3900
|
0
|
|
|
|
|
|
my @splice=();
|
3901
|
0
|
|
|
|
|
|
my @spl=();
|
3902
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SavePick->{$parent_menu}}) {
|
|
0
|
|
|
|
|
|
|
3903
|
0
|
|
|
|
|
|
$picks{$key}='*';
|
3904
|
|
|
|
|
|
|
}
|
3905
|
0
|
|
0
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}||={};
|
3906
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
3907
|
0
|
0
|
|
|
|
|
if ($parent_menu) {
|
3908
|
0
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='*';
|
3909
|
|
|
|
|
|
|
} else {
|
3910
|
0
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}->{$key}='*';
|
3911
|
|
|
|
|
|
|
}
|
3912
|
|
|
|
|
|
|
}
|
3913
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3914
|
0
|
|
|
|
|
|
my $it=${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3915
|
0
|
|
|
|
|
|
my $def=$FullMenu->{$MenuUnit_hash_ref}[5]{$it};
|
3916
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
3917
|
0
|
0
|
|
|
|
|
if ($def) {
|
3918
|
0
|
|
|
|
|
|
my $cnt=1;
|
3919
|
0
|
|
|
|
|
|
foreach my $item (@all_menu_items_array) {
|
3920
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
3921
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
3922
|
0
|
|
|
|
|
|
} $cnt++
|
3923
|
|
|
|
|
|
|
}
|
3924
|
|
|
|
|
|
|
}
|
3925
|
|
|
|
|
|
|
}
|
3926
|
0
|
|
|
|
|
|
foreach my $pick (sort numerically keys %picks) {
|
3927
|
0
|
|
|
|
|
|
push @splice,($pick-1)
|
3928
|
|
|
|
|
|
|
}
|
3929
|
0
|
|
|
|
|
|
foreach my $spl (@splice) {
|
3930
|
0
|
|
|
|
|
|
push @spl, $FullMenu->{$MenuUnit_hash_ref}[10]->[$spl];
|
3931
|
|
|
|
|
|
|
}
|
3932
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
3933
|
|
|
|
|
|
|
my $chosen={
|
3934
|
|
|
|
|
|
|
Select => $send_select,
|
3935
|
|
|
|
|
|
|
Banner => $MenuUnit_hash_ref->{Banner},
|
3936
|
0
|
|
|
|
|
|
}; my $cnt=0;
|
|
0
|
|
|
|
|
|
|
3937
|
0
|
|
0
|
|
|
|
my $hash_ref=$parent_menu||$MenuUnit_hash_ref;
|
3938
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
3939
|
0
|
|
|
|
|
|
my $num=shift @splice;
|
3940
|
0
|
|
|
|
|
|
$cnt++;
|
3941
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3942
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num+1 };
|
3943
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
3944
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3945
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
3946
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3947
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3948
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
3949
|
|
|
|
|
|
|
}
|
3950
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
3951
|
0
|
|
|
|
|
|
$hidedefaults=1;
|
3952
|
0
|
|
|
|
|
|
eval {
|
3953
|
0
|
|
|
|
|
|
my ($ignore1,$ignore2,$ignore3)=('','','');
|
3954
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3955
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$ignore1,$ignore2,
|
3956
|
|
|
|
|
|
|
$ignore3)
|
3957
|
|
|
|
|
|
|
=&Menu($chosen,$picks_from_parent,
|
3958
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
3959
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3960
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3961
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
3962
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 3
|
3963
|
0
|
0
|
|
|
|
|
print "MENU RETURN 3\n" if $menu_return_debug;
|
3964
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3965
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
3966
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3967
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3968
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3969
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
3970
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3971
|
0
|
|
|
|
|
|
$start=${$FullMenu}{$MenuUnit_hash_ref}[11];
|
|
0
|
|
|
|
|
|
|
3972
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
3973
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3974
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
3975
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
3976
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
3977
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
3978
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3979
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3980
|
0
|
|
|
|
|
|
my @resu=();
|
3981
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3982
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3983
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3984
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3985
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3986
|
|
|
|
|
|
|
#print "IN MAKEPLAN7\n";
|
3987
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3988
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3989
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3990
|
|
|
|
|
|
|
'Title'}) {
|
3991
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3992
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3993
|
|
|
|
|
|
|
}
|
3994
|
0
|
|
|
|
|
|
my $n='Number';
|
3995
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3996
|
0
|
|
|
|
|
|
'Plan'}},
|
3997
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3998
|
|
|
|
|
|
|
Number => $numbor,
|
3999
|
|
|
|
|
|
|
PlanID =>
|
4000
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4001
|
|
|
|
|
|
|
Item =>
|
4002
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4003
|
|
|
|
|
|
|
}
|
4004
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4005
|
0
|
0
|
|
|
|
|
if ($@) {
|
4006
|
0
|
0
|
0
|
|
|
|
if (10
|
4007
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
4008
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4009
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4010
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4011
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4012
|
|
|
|
|
|
|
}
|
4013
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4014
|
|
|
|
|
|
|
-1
|
4015
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4016
|
0
|
|
|
|
|
|
close($log_handle);
|
4017
|
|
|
|
|
|
|
}
|
4018
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4019
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4020
|
0
|
|
|
|
|
|
} else { die $@ }
|
4021
|
|
|
|
|
|
|
} else {
|
4022
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4023
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4024
|
|
|
|
|
|
|
."Conveyed\n"
|
4025
|
|
|
|
|
|
|
." the Following "
|
4026
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4027
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4028
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4029
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4030
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4031
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4032
|
|
|
|
|
|
|
}
|
4033
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4034
|
|
|
|
|
|
|
-1
|
4035
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4036
|
0
|
|
|
|
|
|
close($log_handle);
|
4037
|
|
|
|
|
|
|
}
|
4038
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4039
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4040
|
0
|
|
|
|
|
|
} else { die $die }
|
4041
|
|
|
|
|
|
|
}
|
4042
|
|
|
|
|
|
|
}
|
4043
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4044
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4045
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4046
|
0
|
|
|
|
|
|
return @resu;
|
4047
|
|
|
|
|
|
|
} else {
|
4048
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4049
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4050
|
|
|
|
|
|
|
}
|
4051
|
|
|
|
|
|
|
}
|
4052
|
0
|
|
|
|
|
|
$done=1;last
|
4053
|
0
|
|
|
|
|
|
}
|
4054
|
0
|
|
|
|
|
|
eval {
|
4055
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4056
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4057
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4058
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4059
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4060
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4061
|
|
|
|
|
|
|
#print "IN MAKEPLAN8\n";
|
4062
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4063
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4064
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4065
|
|
|
|
|
|
|
'Title'}) {
|
4066
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4067
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4068
|
|
|
|
|
|
|
}
|
4069
|
0
|
|
|
|
|
|
my $n='Number';
|
4070
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4071
|
0
|
|
|
|
|
|
'Plan'}},
|
4072
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4073
|
|
|
|
|
|
|
Number => $numbor,
|
4074
|
|
|
|
|
|
|
PlanID =>
|
4075
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4076
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4077
|
|
|
|
|
|
|
}
|
4078
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4079
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4080
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4081
|
|
|
|
|
|
|
(-1
|
4082
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4083
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4084
|
|
|
|
|
|
|
} else {
|
4085
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4086
|
|
|
|
|
|
|
}
|
4087
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4088
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4089
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4090
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4091
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4092
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4093
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4094
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4095
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4096
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4097
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4098
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4099
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4100
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4101
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4102
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4103
|
|
|
|
|
|
|
." main:: script.\n";
|
4104
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4105
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4106
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4107
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4108
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4109
|
|
|
|
|
|
|
}
|
4110
|
|
|
|
|
|
|
} else {
|
4111
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4112
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4113
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4114
|
|
|
|
|
|
|
} else {
|
4115
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4116
|
|
|
|
|
|
|
}
|
4117
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4118
|
|
|
|
|
|
|
}
|
4119
|
|
|
|
|
|
|
};
|
4120
|
0
|
0
|
|
|
|
|
if ($@) {
|
4121
|
0
|
0
|
0
|
|
|
|
if (10
|
4122
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4123
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4124
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4125
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4126
|
|
|
|
|
|
|
}
|
4127
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4128
|
|
|
|
|
|
|
-1
|
4129
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4130
|
0
|
|
|
|
|
|
close($log_handle);
|
4131
|
|
|
|
|
|
|
}
|
4132
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4133
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4134
|
0
|
|
|
|
|
|
} else { die $@ }
|
4135
|
|
|
|
|
|
|
} else {
|
4136
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4137
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4138
|
|
|
|
|
|
|
."Conveyed\n"
|
4139
|
|
|
|
|
|
|
." the Following "
|
4140
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4141
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4142
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4143
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4144
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4145
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4146
|
|
|
|
|
|
|
}
|
4147
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4148
|
|
|
|
|
|
|
-1
|
4149
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4150
|
0
|
|
|
|
|
|
close($log_handle);
|
4151
|
|
|
|
|
|
|
}
|
4152
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4153
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4154
|
0
|
|
|
|
|
|
} else { die $die }
|
4155
|
|
|
|
|
|
|
}
|
4156
|
|
|
|
|
|
|
}
|
4157
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4158
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4159
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4160
|
0
|
|
|
|
|
|
return @resu;
|
4161
|
|
|
|
|
|
|
} else {
|
4162
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4163
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4164
|
|
|
|
|
|
|
}
|
4165
|
|
|
|
|
|
|
}
|
4166
|
|
|
|
|
|
|
}
|
4167
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4168
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4169
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4170
|
0
|
|
|
|
|
|
return $menu_output;
|
4171
|
|
|
|
|
|
|
} else {
|
4172
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4173
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4174
|
|
|
|
|
|
|
}
|
4175
|
|
|
|
|
|
|
} elsif ($numbor=~/^\s*\/(.+)$/s) {
|
4176
|
|
|
|
|
|
|
## SLASH SEARCH
|
4177
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
4178
|
0
|
|
|
|
|
|
print "\n WARNING!: ",
|
4179
|
|
|
|
|
|
|
"Only -ONE- Level of Search is Supported!\n";
|
4180
|
0
|
|
|
|
|
|
sleep 2;
|
4181
|
0
|
|
|
|
|
|
last;
|
4182
|
|
|
|
|
|
|
}
|
4183
|
0
|
|
0
|
|
|
|
my $one=$1||'';
|
4184
|
0
|
|
|
|
|
|
chomp $one;
|
4185
|
0
|
|
|
|
|
|
$one=~s/\*/[\*]/g;
|
4186
|
0
|
|
|
|
|
|
$one=~s/\+/[\+]/g;
|
4187
|
0
|
0
|
|
|
|
|
$one=qr/$one/ if $one;
|
4188
|
0
|
|
|
|
|
|
my @spl=();
|
4189
|
0
|
|
|
|
|
|
chomp $numbor;
|
4190
|
0
|
|
|
|
|
|
my $def='';
|
4191
|
0
|
0
|
|
|
|
|
unless (exists $Persists->{$MenuUnit_hash_ref}{defaults}) {
|
4192
|
0
|
|
|
|
|
|
my $it=${[keys %{${$FullMenu}{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4193
|
0
|
|
|
|
|
|
$def=${$FullMenu}{$MenuUnit_hash_ref}[5]{$it};
|
|
0
|
|
|
|
|
|
|
4194
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
4195
|
0
|
0
|
|
|
|
|
if ($def) {
|
4196
|
0
|
|
|
|
|
|
my $cnt=1;
|
4197
|
0
|
|
|
|
|
|
foreach my $item (sort
|
4198
|
0
|
|
|
|
|
|
@{[keys %{${$FullMenu}{$MenuUnit_hash_ref}[5]}]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4199
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
4200
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
4201
|
0
|
|
|
|
|
|
} $cnt++
|
4202
|
|
|
|
|
|
|
}
|
4203
|
|
|
|
|
|
|
}
|
4204
|
|
|
|
|
|
|
}
|
4205
|
|
|
|
|
|
|
|
4206
|
0
|
|
|
|
|
|
my $cnt=0;my $ct=0;my @splice=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4207
|
0
|
|
|
|
|
|
foreach my $pik (@all_menu_items_array) {
|
4208
|
0
|
|
|
|
|
|
$cnt++;
|
4209
|
0
|
0
|
|
|
|
|
if ($pik=~/$one/s) {
|
4210
|
0
|
|
|
|
|
|
push @spl, $pik;
|
4211
|
0
|
|
|
|
|
|
$splice[$ct++]=$cnt;
|
4212
|
|
|
|
|
|
|
}
|
4213
|
|
|
|
|
|
|
}
|
4214
|
0
|
0
|
|
|
|
|
next if $#spl==-1;
|
4215
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
4216
|
|
|
|
|
|
|
my $chosen={
|
4217
|
|
|
|
|
|
|
Select => $send_select,
|
4218
|
0
|
|
|
|
|
|
Banner => ${$MenuUnit_hash_ref}{Banner},
|
4219
|
0
|
|
|
|
|
|
}; $cnt=0;
|
|
0
|
|
|
|
|
|
|
4220
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
4221
|
0
|
|
|
|
|
|
my $num=$splice[$cnt];
|
4222
|
0
|
|
|
|
|
|
$cnt++;
|
4223
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$num}) {
|
|
|
0
|
|
|
|
|
|
4224
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4225
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
4226
|
|
|
|
|
|
|
} elsif ($def && $text=~/$def/) {
|
4227
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4228
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
4229
|
0
|
|
|
|
|
|
$picks{$num}='*';
|
4230
|
|
|
|
|
|
|
} else {
|
4231
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4232
|
|
|
|
|
|
|
{ Text => $text,__NUM__=>$num };
|
4233
|
|
|
|
|
|
|
}
|
4234
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
4235
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${$FullMenu->
|
4236
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
4237
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${$FullMenu->
|
4238
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4239
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
4240
|
|
|
|
|
|
|
}
|
4241
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
4242
|
0
|
|
|
|
|
|
my @return_from_filtered_menu=();
|
4243
|
0
|
|
|
|
|
|
eval {
|
4244
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
4245
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4246
|
|
|
|
|
|
|
@return_from_filtered_menu)=&Menu(
|
4247
|
|
|
|
|
|
|
$chosen,$picks_from_parent,
|
4248
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
4249
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4250
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4251
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
4252
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 4
|
4253
|
0
|
0
|
|
|
|
|
print "MENU RETURN 4\n" if $menu_return_debug;
|
4254
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4255
|
0
|
0
|
|
|
|
|
if (-1<$#return_from_filtered_menu) {
|
4256
|
0
|
0
|
|
|
|
|
if ((values %{$menu_output})[0] eq 'recurse') {
|
|
0
|
|
|
|
|
|
|
4257
|
0
|
|
|
|
|
|
my %k=%{$menu_output};
|
|
0
|
|
|
|
|
|
|
4258
|
0
|
|
|
|
|
|
delete $k{Menu};
|
4259
|
0
|
|
|
|
|
|
my $lab=(keys %k)[0];
|
4260
|
0
|
|
|
|
|
|
$menu_output=$labels{$lab};
|
4261
|
|
|
|
|
|
|
}
|
4262
|
0
|
|
|
|
|
|
$MenuMap=$Persists->{$MenuUnit_hash_ref};
|
4263
|
0
|
|
|
|
|
|
eval {
|
4264
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
4265
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu(
|
4266
|
|
|
|
|
|
|
$menu_output,$FullMenu,
|
4267
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4268
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4269
|
|
|
|
|
|
|
$return_from_filtered_menu[0],
|
4270
|
|
|
|
|
|
|
$MenuUnit_hash_ref,
|
4271
|
|
|
|
|
|
|
$return_from_filtered_menu[2]);
|
4272
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 5
|
4273
|
0
|
0
|
|
|
|
|
print "MENU RETURN 5\n" if $menu_return_debug;
|
4274
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4275
|
|
|
|
|
|
|
}
|
4276
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
4277
|
0
|
0
|
0
|
|
|
|
if (($menu_output eq '-') && exists
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4278
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}) {
|
4279
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4280
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4281
|
|
|
|
|
|
|
} elsif ($menu_output eq '+' && exists
|
4282
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}) {
|
4283
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4284
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4285
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
4286
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4287
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
4288
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
4289
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
4290
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
4291
|
0
|
|
0
|
|
|
|
$subfile||='';
|
4292
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
4293
|
0
|
|
|
|
|
|
my @resu=();
|
4294
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
4295
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4296
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4297
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4298
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4299
|
|
|
|
|
|
|
#print "IN MAKEPLAN9\n";
|
4300
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4301
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4302
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4303
|
|
|
|
|
|
|
'Title'}) {
|
4304
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4305
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4306
|
|
|
|
|
|
|
}
|
4307
|
0
|
|
|
|
|
|
my $n='Number';
|
4308
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4309
|
0
|
|
|
|
|
|
'Plan'}},
|
4310
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4311
|
|
|
|
|
|
|
Number => $numbor,
|
4312
|
|
|
|
|
|
|
PlanID =>
|
4313
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4314
|
|
|
|
|
|
|
Item =>
|
4315
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4316
|
|
|
|
|
|
|
}
|
4317
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4318
|
0
|
0
|
|
|
|
|
if ($@) {
|
4319
|
0
|
0
|
0
|
|
|
|
if (10
|
4320
|
|
|
|
|
|
|
'FATAL ERROR') {
|
4321
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4322
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4323
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4324
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4325
|
|
|
|
|
|
|
}
|
4326
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4327
|
|
|
|
|
|
|
-1
|
4328
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4329
|
0
|
|
|
|
|
|
close($log_handle);
|
4330
|
|
|
|
|
|
|
}
|
4331
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4332
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4333
|
0
|
|
|
|
|
|
} else { die $@ }
|
4334
|
|
|
|
|
|
|
} else {
|
4335
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4336
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4337
|
|
|
|
|
|
|
."Conveyed\n"
|
4338
|
|
|
|
|
|
|
." the Following "
|
4339
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4340
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4341
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4342
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4343
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4344
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4345
|
|
|
|
|
|
|
}
|
4346
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4347
|
|
|
|
|
|
|
-1
|
4348
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4349
|
0
|
|
|
|
|
|
close($log_handle);
|
4350
|
|
|
|
|
|
|
}
|
4351
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4352
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4353
|
0
|
|
|
|
|
|
} else { die $die }
|
4354
|
|
|
|
|
|
|
}
|
4355
|
|
|
|
|
|
|
}
|
4356
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4357
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4358
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4359
|
0
|
|
|
|
|
|
return @resu;
|
4360
|
|
|
|
|
|
|
} else {
|
4361
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4362
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4363
|
|
|
|
|
|
|
}
|
4364
|
|
|
|
|
|
|
}
|
4365
|
0
|
|
|
|
|
|
$done=1;last
|
4366
|
0
|
|
|
|
|
|
}
|
4367
|
0
|
|
|
|
|
|
eval {
|
4368
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4369
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4370
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4371
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4372
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4373
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4374
|
|
|
|
|
|
|
#print "IN MAKEPLAN10\n";
|
4375
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4376
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4377
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4378
|
|
|
|
|
|
|
'Title'}) {
|
4379
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4380
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4381
|
|
|
|
|
|
|
}
|
4382
|
0
|
|
|
|
|
|
my $n='Number';
|
4383
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4384
|
0
|
|
|
|
|
|
'Plan'}},
|
4385
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4386
|
|
|
|
|
|
|
Number => $numbor,
|
4387
|
|
|
|
|
|
|
PlanID =>
|
4388
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4389
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4390
|
|
|
|
|
|
|
}
|
4391
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4392
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4393
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4394
|
|
|
|
|
|
|
(-1
|
4395
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4396
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4397
|
|
|
|
|
|
|
} else {
|
4398
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4399
|
|
|
|
|
|
|
}
|
4400
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4401
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4402
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4403
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4404
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4405
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4406
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4407
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4408
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4409
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4410
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4411
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4412
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4413
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4414
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4415
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4416
|
|
|
|
|
|
|
." main:: script.\n";
|
4417
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4418
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4419
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4420
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4421
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4422
|
|
|
|
|
|
|
}
|
4423
|
|
|
|
|
|
|
} else {
|
4424
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4425
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4426
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4427
|
|
|
|
|
|
|
} else {
|
4428
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4429
|
|
|
|
|
|
|
}
|
4430
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4431
|
|
|
|
|
|
|
}
|
4432
|
|
|
|
|
|
|
};
|
4433
|
0
|
0
|
|
|
|
|
if ($@) {
|
4434
|
0
|
0
|
0
|
|
|
|
if (10
|
4435
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4436
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4437
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4438
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4439
|
|
|
|
|
|
|
}
|
4440
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4441
|
|
|
|
|
|
|
-1
|
4442
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4443
|
0
|
|
|
|
|
|
close($log_handle);
|
4444
|
|
|
|
|
|
|
}
|
4445
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4446
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4447
|
0
|
|
|
|
|
|
} else { die $@ }
|
4448
|
|
|
|
|
|
|
} else {
|
4449
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4450
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4451
|
|
|
|
|
|
|
."Conveyed\n"
|
4452
|
|
|
|
|
|
|
." the Following "
|
4453
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4454
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4455
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4456
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4457
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4458
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4459
|
|
|
|
|
|
|
}
|
4460
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4461
|
|
|
|
|
|
|
-1
|
4462
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4463
|
0
|
|
|
|
|
|
close($log_handle);
|
4464
|
|
|
|
|
|
|
}
|
4465
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4466
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4467
|
0
|
|
|
|
|
|
} else { die $die }
|
4468
|
|
|
|
|
|
|
}
|
4469
|
|
|
|
|
|
|
}
|
4470
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4471
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4472
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4473
|
0
|
|
|
|
|
|
return @resu;
|
4474
|
|
|
|
|
|
|
} else {
|
4475
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4476
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4477
|
|
|
|
|
|
|
}
|
4478
|
|
|
|
|
|
|
}
|
4479
|
|
|
|
|
|
|
}
|
4480
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4481
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4482
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
4483
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
4484
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
4485
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
4486
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4487
|
0
|
|
|
|
|
|
return $menu_output;
|
4488
|
|
|
|
|
|
|
}
|
4489
|
|
|
|
|
|
|
} elsif (($numbor=~/^\ || $ikey eq 'LEFTARROW') && $FullMenu) {
|
4490
|
0
|
0
|
|
|
|
|
if ($recurse_level==1) {
|
|
|
0
|
|
|
|
|
|
4491
|
0
|
|
|
|
|
|
print "\n WARNING! - You are at the First Menu!\n";
|
4492
|
0
|
|
|
|
|
|
sleep 2;
|
4493
|
0
|
|
|
|
|
|
} elsif (grep { /\+|\*/ } values %picks) {
|
4494
|
0
|
|
|
|
|
|
return '+',
|
4495
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4496
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4497
|
|
|
|
|
|
|
$Persists;
|
4498
|
|
|
|
|
|
|
} else {
|
4499
|
0
|
|
|
|
|
|
my %sp_copy=%{$SavePick->{$parent_menu}}
|
4500
|
0
|
0
|
|
|
|
|
if exists $SavePick->{$parent_menu};
|
4501
|
0
|
|
|
|
|
|
foreach my $key (keys %sp_copy) {
|
4502
|
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='-' if
|
4503
|
0
|
0
|
|
|
|
|
$sp_copy{$key} eq '+';
|
4504
|
|
|
|
|
|
|
}
|
4505
|
0
|
|
0
|
|
|
|
$parent_menu->{Scroll}->[1]||=0;
|
4506
|
0
|
|
0
|
|
|
|
$main::maintain_scroll_flag||={};
|
4507
|
0
|
0
|
0
|
|
|
|
if ($parent_menu->{Scroll}->[1]>1 &&
|
4508
|
|
|
|
|
|
|
!exists $main::maintain_scroll_flag->{$parent_menu}) {
|
4509
|
0
|
|
|
|
|
|
--$parent_menu->{Scroll}->[1];
|
4510
|
0
|
|
|
|
|
|
$main::maintain_scroll_flag->{$parent_menu}='';
|
4511
|
|
|
|
|
|
|
}
|
4512
|
0
|
|
|
|
|
|
return '-',
|
4513
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4514
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4515
|
|
|
|
|
|
|
$Persists;
|
4516
|
0
|
|
|
|
|
|
} last;
|
4517
|
|
|
|
|
|
|
} elsif (($numbor=~/^\>/ || $ikey eq 'RIGHTARROW') && exists
|
4518
|
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref} &&
|
4519
|
|
|
|
|
|
|
((grep { /-|\+/ } values %picks) || $show_banner_only)) {
|
4520
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$MenuUnit_hash_ref};
|
4521
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
4522
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
4523
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
4524
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
4525
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
4526
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
4527
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
4528
|
0
|
|
|
|
|
|
my $menu_result='';
|
4529
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$MenuUnit_hash_ref}
|
4530
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
4531
|
|
|
|
|
|
|
$menu_result=$Selected->{$MenuUnit_hash_ref}
|
4532
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
4533
|
0
|
0
|
|
|
|
|
$menu_result=$menu_result->() if ref
|
4534
|
|
|
|
|
|
|
$menu_result eq 'CODE';
|
4535
|
|
|
|
|
|
|
} else {
|
4536
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$MenuUnit_hash_ref}[2]
|
4537
|
0
|
|
|
|
|
|
{$all_menu_items_array[(keys %{$SavePick->
|
4538
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}})[0]-1]};
|
4539
|
|
|
|
|
|
|
}
|
4540
|
0
|
|
|
|
|
|
eval {
|
4541
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
4542
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
4543
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
4544
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
4545
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
4546
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
4547
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4548
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4549
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
4550
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 6
|
4551
|
0
|
0
|
|
|
|
|
print "MENU RETURN 6\n" if $menu_return_debug;
|
4552
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4553
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
4554
|
0
|
0
|
0
|
|
|
|
if (ref $menu_output eq 'ARRAY' &&
|
4555
|
|
|
|
|
|
|
$menu_output->[0]=~/^[{](.*)[}][<]$/) {
|
4556
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
4557
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
4558
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
4559
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
4560
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
4561
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
4562
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
4563
|
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref}[2]
|
4564
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
4565
|
0
|
|
|
|
|
|
%picks=();
|
4566
|
0
|
|
|
|
|
|
next;
|
4567
|
|
|
|
|
|
|
} else {
|
4568
|
0
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref};
|
4569
|
0
|
|
|
|
|
|
return $menu_output,
|
4570
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4571
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4572
|
|
|
|
|
|
|
$Persists;
|
4573
|
|
|
|
|
|
|
}
|
4574
|
|
|
|
|
|
|
} else {
|
4575
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
4576
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
4577
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
4578
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
4579
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
4580
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
4581
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
4582
|
|
|
|
|
|
|
}
|
4583
|
0
|
0
|
|
|
|
|
if ($menu_output eq 'DONE_SUB') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4584
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4585
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
4586
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
4587
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4588
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4589
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4590
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4591
|
|
|
|
|
|
|
#print "IN MAKEPLAN11\n";
|
4592
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
4593
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{
|
4594
|
|
|
|
|
|
|
'Title'}) {
|
4595
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4596
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4597
|
|
|
|
|
|
|
}
|
4598
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
4599
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
4600
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4601
|
|
|
|
|
|
|
Number => $numbor,
|
4602
|
|
|
|
|
|
|
PlanID =>
|
4603
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
4604
|
0
|
|
|
|
|
|
Item => $pn{$numbor}[0] }
|
4605
|
|
|
|
|
|
|
}
|
4606
|
|
|
|
|
|
|
}
|
4607
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
4608
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
4609
|
0
|
|
0
|
|
|
|
$subfile||='';
|
4610
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
4611
|
0
|
|
|
|
|
|
my @resu=();
|
4612
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
4613
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4614
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4615
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4616
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4617
|
|
|
|
|
|
|
#print "IN MAKEPLAN12\n";
|
4618
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4619
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4620
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4621
|
|
|
|
|
|
|
'Title'}) {
|
4622
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4623
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4624
|
|
|
|
|
|
|
}
|
4625
|
0
|
|
|
|
|
|
my $n='Number';
|
4626
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4627
|
0
|
|
|
|
|
|
'Plan'}},
|
4628
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4629
|
|
|
|
|
|
|
Number => $numbor,
|
4630
|
|
|
|
|
|
|
PlanID =>
|
4631
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4632
|
|
|
|
|
|
|
Item =>
|
4633
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4634
|
|
|
|
|
|
|
}
|
4635
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4636
|
0
|
0
|
|
|
|
|
if ($@) {
|
4637
|
0
|
0
|
0
|
|
|
|
if (10
|
4638
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
4639
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4640
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4641
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4642
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4643
|
|
|
|
|
|
|
}
|
4644
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4645
|
|
|
|
|
|
|
-1
|
4646
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4647
|
0
|
|
|
|
|
|
close($log_handle);
|
4648
|
|
|
|
|
|
|
}
|
4649
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4650
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4651
|
0
|
|
|
|
|
|
} else { die $@ }
|
4652
|
|
|
|
|
|
|
} else {
|
4653
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4654
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4655
|
|
|
|
|
|
|
."Conveyed\n"
|
4656
|
|
|
|
|
|
|
." the Following "
|
4657
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4658
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4659
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4660
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4661
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4662
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4663
|
|
|
|
|
|
|
}
|
4664
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4665
|
|
|
|
|
|
|
-1
|
4666
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4667
|
0
|
|
|
|
|
|
close($log_handle);
|
4668
|
|
|
|
|
|
|
}
|
4669
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4670
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4671
|
0
|
|
|
|
|
|
} else { die $die }
|
4672
|
|
|
|
|
|
|
}
|
4673
|
|
|
|
|
|
|
}
|
4674
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4675
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4676
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4677
|
0
|
|
|
|
|
|
return @resu;
|
4678
|
|
|
|
|
|
|
} else {
|
4679
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4680
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4681
|
|
|
|
|
|
|
}
|
4682
|
|
|
|
|
|
|
}
|
4683
|
0
|
|
|
|
|
|
$done=1;last
|
4684
|
0
|
|
|
|
|
|
}
|
4685
|
0
|
|
|
|
|
|
eval {
|
4686
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4687
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4688
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4689
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4690
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4691
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4692
|
|
|
|
|
|
|
#print "IN MAKEPLAN13\n";
|
4693
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4694
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4695
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4696
|
|
|
|
|
|
|
'Title'}) {
|
4697
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4698
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4699
|
|
|
|
|
|
|
}
|
4700
|
0
|
|
|
|
|
|
my $n='Number';
|
4701
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4702
|
0
|
|
|
|
|
|
'Plan'}},
|
4703
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4704
|
|
|
|
|
|
|
Number => $numbor,
|
4705
|
|
|
|
|
|
|
PlanID =>
|
4706
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4707
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4708
|
|
|
|
|
|
|
}
|
4709
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4710
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4711
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4712
|
|
|
|
|
|
|
(-1
|
4713
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4714
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4715
|
|
|
|
|
|
|
} else {
|
4716
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4717
|
|
|
|
|
|
|
}
|
4718
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4719
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4720
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4721
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4722
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4723
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4724
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4725
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4726
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4727
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4728
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4729
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4730
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4731
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4732
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4733
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4734
|
|
|
|
|
|
|
." main:: script.\n";
|
4735
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4736
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4737
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4738
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4739
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4740
|
|
|
|
|
|
|
}
|
4741
|
|
|
|
|
|
|
} else {
|
4742
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4743
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4744
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4745
|
|
|
|
|
|
|
} else {
|
4746
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4747
|
|
|
|
|
|
|
}
|
4748
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4749
|
|
|
|
|
|
|
}
|
4750
|
|
|
|
|
|
|
};
|
4751
|
0
|
0
|
|
|
|
|
if ($@) {
|
4752
|
0
|
0
|
0
|
|
|
|
if (10
|
4753
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4754
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4755
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4756
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4757
|
|
|
|
|
|
|
}
|
4758
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4759
|
|
|
|
|
|
|
-1
|
4760
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4761
|
0
|
|
|
|
|
|
close($log_handle);
|
4762
|
|
|
|
|
|
|
}
|
4763
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4764
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4765
|
0
|
|
|
|
|
|
} else { die $@ }
|
4766
|
|
|
|
|
|
|
} else {
|
4767
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4768
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4769
|
|
|
|
|
|
|
."Conveyed\n"
|
4770
|
|
|
|
|
|
|
." the Following "
|
4771
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4772
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4773
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4774
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4775
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4776
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4777
|
|
|
|
|
|
|
}
|
4778
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4779
|
|
|
|
|
|
|
-1
|
4780
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4781
|
0
|
|
|
|
|
|
close($log_handle);
|
4782
|
|
|
|
|
|
|
}
|
4783
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4784
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4785
|
0
|
|
|
|
|
|
} else { die $die }
|
4786
|
|
|
|
|
|
|
}
|
4787
|
|
|
|
|
|
|
}
|
4788
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4789
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4790
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4791
|
0
|
|
|
|
|
|
return @resu;
|
4792
|
|
|
|
|
|
|
} else {
|
4793
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4794
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4795
|
|
|
|
|
|
|
}
|
4796
|
|
|
|
|
|
|
}
|
4797
|
|
|
|
|
|
|
}
|
4798
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4799
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4800
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
4801
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
4802
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
4803
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
4804
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4805
|
0
|
|
|
|
|
|
return $menu_output;
|
4806
|
|
|
|
|
|
|
}
|
4807
|
|
|
|
|
|
|
} elsif ($ikey eq 'ESC' || $numbor=~/^quit|exit|bye$/i) {
|
4808
|
0
|
0
|
|
|
|
|
print "\n" if $^O ne 'cygwin';
|
4809
|
0
|
|
|
|
|
|
return ']quit['
|
4810
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto and $ikey eq 'F1' ||
|
4811
|
|
|
|
|
|
|
$numbor=~/^help$/i) {
|
4812
|
0
|
|
|
|
|
|
system('man Net::FullAuto');
|
4813
|
|
|
|
|
|
|
} elsif ($ikey eq 'F1' || $numbor=~/^help$/i) {
|
4814
|
0
|
|
|
|
|
|
system('man Term::Menus');
|
4815
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto and $numbor=~/^admin$/i) {
|
4816
|
0
|
0
|
|
|
|
|
if (!exists $Net::FullAuto::FA_Core::admin_menus{
|
4817
|
|
|
|
|
|
|
&pw($MenuUnit_hash_ref)}) {
|
4818
|
0
|
|
|
|
|
|
while (1) {
|
4819
|
0
|
0
|
|
|
|
|
my @menu_output=Menu($Net::FullAuto::FA_Core::admin_menu->())
|
4820
|
|
|
|
|
|
|
if $Net::FullAuto::FA_Core::admin_menu;
|
4821
|
0
|
0
|
0
|
|
|
|
last if $menu_output[0] ne '-' && $menu_output[0] ne '+';
|
4822
|
|
|
|
|
|
|
}
|
4823
|
|
|
|
|
|
|
} else {
|
4824
|
0
|
|
|
|
|
|
return ['{admin}<'],$FullMenu,$Selected,$Conveyed,
|
4825
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
4826
|
|
|
|
|
|
|
}
|
4827
|
0
|
|
|
|
|
|
} elsif (!keys %{$FullMenu->{$MenuUnit_hash_ref}[1]}
|
4828
|
|
|
|
|
|
|
&& $numbor=~/^[Aa]$/) {
|
4829
|
0
|
0
|
0
|
|
|
|
if (!$select_many && !(keys %{$MenuUnit_hash_ref->{Select}})) {
|
|
0
|
|
|
|
|
|
|
4830
|
0
|
|
|
|
|
|
print "\n ERROR: Cannot Select All Items\n".
|
4831
|
|
|
|
|
|
|
" When 'Select' is NOT set to 'Many'\n";
|
4832
|
0
|
|
|
|
|
|
sleep 2;next;
|
|
0
|
|
|
|
|
|
|
4833
|
|
|
|
|
|
|
}
|
4834
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
4835
|
0
|
|
|
|
|
|
foreach my $num (0..$#all_menu_items_array) {
|
4836
|
0
|
|
|
|
|
|
$picks{$num+1}='*';
|
4837
|
|
|
|
|
|
|
}
|
4838
|
0
|
|
|
|
|
|
foreach my $key (keys %{$FullMenu->{$MenuUnit_hash_ref}[8]}) {
|
|
0
|
|
|
|
|
|
|
4839
|
|
|
|
|
|
|
$SavePick->{$parent_menu}{$FullMenu->
|
4840
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$key}}='*';
|
4841
|
|
|
|
|
|
|
}
|
4842
|
|
|
|
|
|
|
} else {
|
4843
|
0
|
|
|
|
|
|
my $nmp=$num_pick-1;
|
4844
|
0
|
|
|
|
|
|
foreach my $pck (0..$nmp) {
|
4845
|
0
|
0
|
0
|
|
|
|
if ($select_many ||
|
4846
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[6]->{
|
4847
|
|
|
|
|
|
|
$all_menu_items_array[$pck]}) {
|
4848
|
0
|
|
|
|
|
|
$picks{$pck+1}='*'
|
4849
|
|
|
|
|
|
|
}
|
4850
|
|
|
|
|
|
|
}
|
4851
|
|
|
|
|
|
|
}
|
4852
|
|
|
|
|
|
|
} elsif ($numbor=~/^[Cc]$/) {
|
4853
|
|
|
|
|
|
|
## CLEAR ALL CLEARALL
|
4854
|
0
|
|
|
|
|
|
foreach my $key (keys %{${$FullMenu}{$MenuUnit_hash_ref}[8]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4855
|
0
|
|
|
|
|
|
delete ${$SavePick}{$parent_menu}{${$FullMenu}
|
|
0
|
|
|
|
|
|
|
4856
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$key}};
|
4857
|
|
|
|
|
|
|
}
|
4858
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
4859
|
0
|
0
|
|
|
|
|
if (exists $picks{$pick}) {
|
4860
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
4861
|
0
|
|
|
|
|
|
delete $items{$pick};
|
4862
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$pick};
|
4863
|
0
|
|
|
|
|
|
delete $Selected->{$parent_menu}{$pick};
|
4864
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$pick};
|
4865
|
0
|
|
|
|
|
|
delete $SavePick->{$parent_menu}{$pick};
|
4866
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
4867
|
|
|
|
|
|
|
}
|
4868
|
0
|
|
|
|
|
|
} $FullMenu->{$parent_menu}[5]='';
|
4869
|
0
|
|
|
|
|
|
$return_from_child_menu=0;
|
4870
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
4871
|
0
|
0
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0 if defined $parent_menu;
|
4872
|
|
|
|
|
|
|
}
|
4873
|
0
|
0
|
0
|
|
|
|
if ($numbor=~/^u$/i || $ikey eq 'UPARROW' || $ikey eq 'PAGEUP') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4874
|
0
|
0
|
0
|
|
|
|
if ($ikey ne 'PAGEUP' && exists $MenuUnit_hash_ref->{Scroll}
|
|
|
0
|
0
|
|
|
|
|
4875
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll}) {
|
4876
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]-- if
|
4877
|
0
|
0
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]!=1;
|
4878
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
4879
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $display_this_many_items if $num_pick;
|
4880
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
4881
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4882
|
0
|
0
|
0
|
|
|
|
if ($curscreennum-$remainder==
|
|
|
0
|
|
|
|
|
|
4883
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1] &&
|
4884
|
|
|
|
|
|
|
$curscreennum==$num_pick) {
|
4885
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4886
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4887
|
|
|
|
|
|
|
} elsif ($start==$MenuUnit_hash_ref->{Scroll}->[1]) {
|
4888
|
0
|
0
|
0
|
|
|
|
if ($display_this_many_items<$num_pick-$start
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4889
|
|
|
|
|
|
|
|| $remainder || (!$remainder &&
|
4890
|
|
|
|
|
|
|
(($num_pick==$start+1) ||
|
4891
|
|
|
|
|
|
|
($num_pick==$start+$display_this_many_items)))) {
|
4892
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4893
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4894
|
|
|
|
|
|
|
}
|
4895
|
0
|
|
|
|
|
|
} else { next }
|
4896
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4897
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4898
|
0
|
|
|
|
|
|
last;
|
4899
|
|
|
|
|
|
|
} elsif (0<=$start-$display_this_many_items) {
|
4900
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4901
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=
|
4902
|
|
|
|
|
|
|
$start+$display_this_many_items
|
4903
|
|
|
|
|
|
|
if $ikey eq 'PAGEUP' &&
|
4904
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
4905
|
0
|
0
|
0
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll};
|
|
|
|
0
|
|
|
|
|
4906
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4907
|
|
|
|
|
|
|
} else {
|
4908
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
4909
|
|
|
|
|
|
|
}
|
4910
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4911
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4912
|
0
|
|
|
|
|
|
last;
|
4913
|
|
|
|
|
|
|
} elsif ($ikey eq 'END') {
|
4914
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$num_pick;
|
4915
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$num_pick if
|
4916
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll} &&
|
4917
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Scroll};
|
4918
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4919
|
0
|
0
|
|
|
|
|
if ($num_pick==$start+$choose_num) {
|
4920
|
0
|
|
|
|
|
|
next;
|
4921
|
|
|
|
|
|
|
}
|
4922
|
0
|
|
|
|
|
|
my $remainder=$num_pick % $choose_num;
|
4923
|
0
|
0
|
|
|
|
|
if ($remainder) {
|
4924
|
0
|
|
|
|
|
|
$start=$num_pick-$remainder;
|
4925
|
|
|
|
|
|
|
} else {
|
4926
|
0
|
|
|
|
|
|
$start=$num_pick-$display_this_many_items;
|
4927
|
|
|
|
|
|
|
}
|
4928
|
0
|
|
|
|
|
|
last;
|
4929
|
|
|
|
|
|
|
} elsif ($ikey eq 'HOME') {
|
4930
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
4931
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=1 if
|
4932
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll} &&
|
4933
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Scroll};
|
4934
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4935
|
0
|
|
|
|
|
|
$start=0;
|
4936
|
0
|
|
|
|
|
|
last;
|
4937
|
|
|
|
|
|
|
} elsif ($numbor && unpack('a1',$numbor) eq '!') {
|
4938
|
|
|
|
|
|
|
# SHELLOUT shellout
|
4939
|
0
|
|
0
|
|
|
|
my $username=getlogin || getpwuid($<);
|
4940
|
0
|
|
|
|
|
|
my $cmd=unpack('x1 a*',$numbor);
|
4941
|
0
|
|
|
|
|
|
print "\n";
|
4942
|
0
|
0
|
|
|
|
|
unless ($^O eq 'cygwin') {
|
4943
|
0
|
|
|
|
|
|
system("su -l -c$cmd $username");
|
4944
|
|
|
|
|
|
|
} else {
|
4945
|
0
|
|
|
|
|
|
system($cmd);
|
4946
|
|
|
|
|
|
|
}
|
4947
|
0
|
|
|
|
|
|
print "\nPress ENTER to continue";;
|
|
0
|
|
|
|
|
|
|
4948
|
0
|
|
|
|
|
|
next;
|
4949
|
|
|
|
|
|
|
} elsif (((!$ikey || $ikey eq 'ENTER') &&
|
4950
|
|
|
|
|
|
|
($numbor=~/^()$/ || $numbor=~/^\n/)) || $numbor=~/^d$/i
|
4951
|
|
|
|
|
|
|
|| $ikey eq 'DOWNARROW' || $ikey eq 'PAGEDOWN') {
|
4952
|
0
|
|
0
|
|
|
|
$ikey||='ENTER';
|
4953
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
4954
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
4955
|
0
|
0
|
0
|
|
|
|
if (($ikey eq 'DOWNARROW' || $numbor=~/^d$/i) &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4956
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
4957
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll}) {
|
4958
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
4959
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $choose_num if $num_pick;
|
4960
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
4961
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4962
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]++
|
4963
|
0
|
0
|
|
|
|
|
if $MenuUnit_hash_ref->{Scroll}->[1]!=$num_pick;
|
4964
|
0
|
0
|
|
|
|
|
if ($curscreennum<$MenuUnit_hash_ref->{Scroll}->[1]) {
|
4965
|
0
|
0
|
|
|
|
|
if ($display_this_many_items<$num_pick-$start) {
|
4966
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
4967
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4968
|
|
|
|
|
|
|
} else {
|
4969
|
0
|
|
|
|
|
|
$start=$start+$remainder;
|
4970
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$num_pick;
|
4971
|
|
|
|
|
|
|
}
|
4972
|
0
|
|
|
|
|
|
} else { next }
|
4973
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4974
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4975
|
0
|
|
|
|
|
|
last;
|
4976
|
|
|
|
|
|
|
} elsif ($ikey eq 'ENTER' && exists $MenuUnit_hash_ref->{Scroll}
|
4977
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll} && !$show_banner_only) {
|
4978
|
0
|
|
|
|
|
|
$numbor=$MenuUnit_hash_ref->{Scroll}->[1];
|
4979
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]++
|
4980
|
0
|
0
|
|
|
|
|
if $MenuUnit_hash_ref->{Scroll}->[1]!=$num_pick;
|
4981
|
|
|
|
|
|
|
} else {
|
4982
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4983
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
4984
|
0
|
|
|
|
|
|
$numbor='f';
|
4985
|
0
|
|
|
|
|
|
$picks{'__FA_Banner__'}='';
|
4986
|
0
|
|
|
|
|
|
my $remainder=0;
|
4987
|
0
|
0
|
|
|
|
|
$remainder=$choose_num % $num_pick if $num_pick;
|
4988
|
0
|
0
|
|
|
|
|
my $curscreennum=($start+$remainder==$num_pick)?
|
4989
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4990
|
0
|
|
|
|
|
|
my $numpick=0;
|
4991
|
0
|
0
|
0
|
|
|
|
if ($parent_menu and exists $parent_menu->{Scroll}) {
|
4992
|
0
|
0
|
|
|
|
|
if (ref $parent_menu->{Scroll} eq 'ARRAY') {
|
4993
|
0
|
|
|
|
|
|
$numpick=$#{[keys %{$FullMenu->{$parent_menu}[2]}]};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4994
|
0
|
0
|
0
|
|
|
|
if ($curscreennum+$display_this_many_items
|
4995
|
|
|
|
|
|
|
<$parent_menu->{Scroll}->[1] &&
|
4996
|
|
|
|
|
|
|
$parent_menu->{Scroll}->[1]<$numpick) {
|
4997
|
|
|
|
|
|
|
$FullMenu->{$parent_menu}[11]=
|
4998
|
0
|
|
|
|
|
|
$parent_menu->{Scroll}->[1];
|
4999
|
|
|
|
|
|
|
}
|
5000
|
|
|
|
|
|
|
}
|
5001
|
0
|
|
0
|
|
|
|
$parent_menu->{Scroll}->[1]||=0;
|
5002
|
|
|
|
|
|
|
}
|
5003
|
|
|
|
|
|
|
} else {
|
5004
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5005
|
|
|
|
|
|
|
}
|
5006
|
|
|
|
|
|
|
} elsif ($display_this_many_items<$num_pick-$start) {
|
5007
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
5008
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$start+1 if
|
5009
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
5010
|
0
|
0
|
0
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll};
|
5011
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
5012
|
|
|
|
|
|
|
} elsif ($ikey ne 'PAGEDOWN') {
|
5013
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
5014
|
|
|
|
|
|
|
}
|
5015
|
0
|
0
|
0
|
|
|
|
unless ($show_banner_only || $numbor!~/^\d+/) {
|
5016
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5017
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
5018
|
0
|
|
|
|
|
|
last;
|
5019
|
|
|
|
|
|
|
}
|
5020
|
|
|
|
|
|
|
}
|
5021
|
0
|
|
|
|
|
|
} chomp $numbor;
|
5022
|
0
|
0
|
0
|
|
|
|
if (!((keys %picks) && $numbor=~/^[Ff]$/) &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5023
|
|
|
|
|
|
|
$numbor!~/^\d+|admin$/ && !$return_from_child_menu) {
|
5024
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
5025
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
5026
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
5027
|
0
|
|
|
|
|
|
last;
|
5028
|
|
|
|
|
|
|
} elsif (exists $pn{$numbor} || ((keys %picks) && $numbor=~/^[Ff]$/)) {
|
5029
|
|
|
|
|
|
|
# NUMBOR CHOSEN
|
5030
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
5031
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
5032
|
0
|
0
|
|
|
|
|
delete $picks{'__FA_Banner__'} if exists $picks{'__FA_Banner__'};
|
5033
|
0
|
0
|
|
|
|
|
%pn=() unless %pn;
|
5034
|
0
|
|
|
|
|
|
my $callertest=__PACKAGE__."::Menu";
|
5035
|
0
|
0
|
0
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults} && !$filtered_menu) {
|
5036
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
5037
|
0
|
0
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0 if $parent_menu;
|
5038
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
5039
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$pick} && !$picks{$numbor}) {
|
5040
|
0
|
0
|
|
|
|
|
if ($picks{$pick} eq '*') {
|
|
|
0
|
|
|
|
|
|
5041
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5042
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5043
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$pick};
|
5044
|
|
|
|
|
|
|
} elsif ($picks{$pick} eq '+') {
|
5045
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$pick,
|
5046
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5047
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5048
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5049
|
|
|
|
|
|
|
}
|
5050
|
|
|
|
|
|
|
}
|
5051
|
0
|
|
|
|
|
|
} $FullMenu->{$MenuUnit_hash_ref}[5]='';
|
5052
|
|
|
|
|
|
|
}
|
5053
|
0
|
|
0
|
|
|
|
$pn{$numbor}[1]||=1;
|
5054
|
0
|
0
|
|
|
|
|
my $digital_numbor=($numbor=~/^\d+$/) ? $numbor : 1;
|
5055
|
0
|
|
0
|
|
|
|
$all_menu_items_array[0]||='';
|
5056
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result} &&
|
5057
|
|
|
|
|
|
|
!defined $MenuUnit_hash_ref->{Result}) {
|
5058
|
0
|
|
|
|
|
|
my $name=$MenuUnit_hash_ref->{Name};
|
5059
|
0
|
|
|
|
|
|
print "\n\n";
|
5060
|
0
|
|
|
|
|
|
my $fatal_error=<
|
5061
|
|
|
|
|
|
|
|
5062
|
|
|
|
|
|
|
FATAL ERROR!: The Menu Block \"$name\" :
|
5063
|
|
|
|
|
|
|
|
5064
|
|
|
|
|
|
|
END
|
5065
|
0
|
|
|
|
|
|
$fatal_error.=<<'END';
|
5066
|
|
|
|
|
|
|
has a Result => undef element defined, but not instantiated.
|
5067
|
|
|
|
|
|
|
There may be a couple reasons for this, having to do with scope
|
5068
|
|
|
|
|
|
|
and where code blocks are located in relation to each other in
|
5069
|
|
|
|
|
|
|
the script. It could also be that you didn't provide a value
|
5070
|
|
|
|
|
|
|
for the element. If blocks are locally scoped with "my" than
|
5071
|
|
|
|
|
|
|
the result block must exist ABOVE the calling block:
|
5072
|
|
|
|
|
|
|
|
5073
|
|
|
|
|
|
|
my $block_being_called = { ... };
|
5074
|
|
|
|
|
|
|
my $block_doing_calling = { Result => $block_being_called, };
|
5075
|
|
|
|
|
|
|
|
5076
|
|
|
|
|
|
|
However, with more complex menu implementations, this
|
5077
|
|
|
|
|
|
|
convenience is not always possible or workable. In this
|
5078
|
|
|
|
|
|
|
situation, the approach is different. It will be necessary to
|
5079
|
|
|
|
|
|
|
globally scope code blocks, and use full package naming
|
5080
|
|
|
|
|
|
|
conventions when calling code blocks:
|
5081
|
|
|
|
|
|
|
|
5082
|
|
|
|
|
|
|
our $block_doing_calling = {
|
5083
|
|
|
|
|
|
|
|
5084
|
|
|
|
|
|
|
Result => $Full::Package::Name::Of::block_being_called,
|
5085
|
|
|
|
|
|
|
|
5086
|
|
|
|
|
|
|
};
|
5087
|
|
|
|
|
|
|
our $block_being_called = { ... };
|
5088
|
|
|
|
|
|
|
|
5089
|
|
|
|
|
|
|
---------------------------------------------------------------
|
5090
|
|
|
|
|
|
|
|
5091
|
|
|
|
|
|
|
Result => elements MUST have a value. A NULL value will work:
|
5092
|
|
|
|
|
|
|
|
5093
|
|
|
|
|
|
|
my|our $block_being_called = { Result => '', }
|
5094
|
|
|
|
|
|
|
|
5095
|
|
|
|
|
|
|
END
|
5096
|
0
|
|
|
|
|
|
die $fatal_error;
|
5097
|
|
|
|
|
|
|
}
|
5098
|
0
|
0
|
0
|
|
|
|
if (($select_many ||
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5099
|
|
|
|
|
|
|
(exists ${$MenuUnit_hash_ref}{Select}{$numbor}))
|
5100
|
|
|
|
|
|
|
&& $numbor!~/^[Ff]$/) {
|
5101
|
0
|
0
|
0
|
|
|
|
if ($filtered_menu && (exists
|
|
|
0
|
|
|
|
|
|
5102
|
|
|
|
|
|
|
$SavePick->{$parent_menu}{$numbor})) {
|
5103
|
0
|
0
|
|
|
|
|
if ($Persists->{$parent_menu}{defaults}) {
|
5104
|
0
|
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0;
|
5105
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
5106
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
5107
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$pick} && !$picks{$numbor}) {
|
5108
|
0
|
0
|
|
|
|
|
if ($picks{$pick} eq '*') {
|
|
|
0
|
|
|
|
|
|
5109
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5110
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5111
|
0
|
|
|
|
|
|
delete $Selected->{$parent_menu}{$pick};
|
5112
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5113
|
|
|
|
|
|
|
} elsif ($picks{$pick} eq '+') {
|
5114
|
0
|
|
|
|
|
|
&delete_Selected($parent_menu,$pick,
|
5115
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5116
|
0
|
|
|
|
|
|
$SaveNext={%{$SavePick}};
|
|
0
|
|
|
|
|
|
|
5117
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5118
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5119
|
|
|
|
|
|
|
}
|
5120
|
|
|
|
|
|
|
}
|
5121
|
0
|
|
|
|
|
|
} $FullMenu->{$MenuUnit_hash_ref}[5]='';
|
5122
|
|
|
|
|
|
|
}
|
5123
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$numbor};
|
5124
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5125
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5126
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5127
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5128
|
0
|
|
|
|
|
|
delete $SavePick->{$parent_menu}{$numbor};
|
5129
|
|
|
|
|
|
|
} elsif (exists $picks{$numbor}) {
|
5130
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
5131
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5132
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5133
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$numbor};
|
5134
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5135
|
0
|
0
|
|
|
|
|
delete $SavePick->{$parent_menu}{$numbor}
|
5136
|
|
|
|
|
|
|
if $filtered_menu;
|
5137
|
|
|
|
|
|
|
} else {
|
5138
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$numbor,
|
5139
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5140
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5141
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5142
|
|
|
|
|
|
|
}
|
5143
|
|
|
|
|
|
|
} else {
|
5144
|
|
|
|
|
|
|
$items{$numbor}=$FullMenu->{$MenuUnit_hash_ref}
|
5145
|
0
|
|
|
|
|
|
[4]{$all_menu_items_array[$numbor-1]};
|
5146
|
0
|
0
|
|
|
|
|
$SavePick->{$parent_menu}{$numbor}='*'
|
5147
|
|
|
|
|
|
|
if $filtered_menu;
|
5148
|
0
|
|
|
|
|
|
my $skip=0;
|
5149
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5150
|
0
|
0
|
0
|
|
|
|
if (defined $all_menu_items_array[$key-1] &&
|
|
|
0
|
0
|
|
|
|
|
5151
|
0
|
|
|
|
|
|
exists ${$FullMenu}{$MenuUnit_hash_ref}[1]->{
|
5152
|
|
|
|
|
|
|
$all_menu_items_array[$key-1]}
|
5153
|
0
|
|
|
|
|
|
&& (grep { $items{$numbor} eq $_ }
|
5154
|
0
|
|
|
|
|
|
@{${$FullMenu}{$MenuUnit_hash_ref}[1]->{
|
5155
|
0
|
|
|
|
|
|
$all_menu_items_array[$key-1]}})) {
|
5156
|
0
|
|
|
|
|
|
my $warn="\n WARNING! You Cannot Select ";
|
5157
|
0
|
|
|
|
|
|
$warn.="Line $numbor while Line $key is Selected!\n";
|
5158
|
0
|
|
|
|
|
|
print "$warn";sleep 2;
|
|
0
|
|
|
|
|
|
|
5159
|
0
|
|
|
|
|
|
$skip=1;
|
5160
|
|
|
|
|
|
|
} elsif ($picks{$key} eq '-') {
|
5161
|
0
|
|
|
|
|
|
delete ${$Selected}{$MenuUnit_hash_ref}{$key};
|
|
0
|
|
|
|
|
|
|
5162
|
0
|
|
|
|
|
|
delete $picks{$key};
|
5163
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5164
|
|
|
|
|
|
|
}
|
5165
|
|
|
|
|
|
|
}
|
5166
|
0
|
0
|
|
|
|
|
if ($skip==0) {
|
5167
|
0
|
|
|
|
|
|
$picks{$numbor}='*';
|
5168
|
|
|
|
|
|
|
$negate{$numbor}=
|
5169
|
0
|
|
|
|
|
|
${${$FullMenu}{$MenuUnit_hash_ref}[1]}
|
|
0
|
|
|
|
|
|
|
5170
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5171
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%picks;
|
|
0
|
|
|
|
|
|
|
5172
|
|
|
|
|
|
|
}
|
5173
|
|
|
|
|
|
|
}
|
5174
|
0
|
0
|
0
|
|
|
|
if ($prev_menu && $prev_menu!=$numbor) {
|
5175
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$prev_menu,
|
5176
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5177
|
0
|
|
|
|
|
|
delete $picks{$prev_menu};
|
5178
|
0
|
|
|
|
|
|
delete $items{$prev_menu};
|
5179
|
|
|
|
|
|
|
}
|
5180
|
|
|
|
|
|
|
} elsif (($show_banner_only && exists $MenuUnit_hash_ref->
|
5181
|
|
|
|
|
|
|
{Result} and ref $MenuUnit_hash_ref->
|
5182
|
|
|
|
|
|
|
{Result} eq 'HASH') || ($numbor=~/^\d+$/ &&
|
5183
|
|
|
|
|
|
|
(ref $FullMenu->{$MenuUnit_hash_ref}[2]
|
5184
|
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]||
|
5185
|
|
|
|
|
|
|
$all_menu_items_array[$pn{$digital_numbor}[1]-1]}
|
5186
|
|
|
|
|
|
|
eq 'HASH')) || ($numbor=~/^[Ff]$/ &&
|
5187
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[2]
|
5188
|
|
|
|
|
|
|
{$all_menu_items_array[((keys %picks)[0]||1)-1]}
|
5189
|
|
|
|
|
|
|
eq 'HASH')) {
|
5190
|
0
|
|
|
|
|
|
my $numbor_is_eff=0;
|
5191
|
0
|
0
|
|
|
|
|
if ($numbor=~/^[Ff]$/) {
|
5192
|
0
|
|
|
|
|
|
$numbor=(keys %picks)[0];
|
5193
|
0
|
|
|
|
|
|
$numbor_is_eff=1;
|
5194
|
|
|
|
|
|
|
}
|
5195
|
0
|
0
|
|
|
|
|
if (grep { /Item_/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5196
|
0
|
|
|
|
|
|
my @items=();
|
5197
|
0
|
|
|
|
|
|
foreach my $key (keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
5198
|
0
|
0
|
|
|
|
|
next unless $key=~/Item_/;
|
5199
|
0
|
|
|
|
|
|
push @items, $MenuUnit_hash_ref->{$key};
|
5200
|
|
|
|
|
|
|
}
|
5201
|
0
|
0
|
0
|
|
|
|
if ($#items==0 && ref $items[0] eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5202
|
0
|
|
|
|
|
|
(!grep { /Item_/ } keys %{$items[0]}) &&
|
|
0
|
|
|
|
|
|
|
5203
|
0
|
|
|
|
|
|
grep { /Banner/ } keys %{$items[0]}) {
|
|
0
|
|
|
|
|
|
|
5204
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
5205
|
|
|
|
|
|
|
}
|
5206
|
|
|
|
|
|
|
}
|
5207
|
0
|
0
|
0
|
|
|
|
if ($show_banner_only ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5208
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$FullMenu->{
|
5209
|
|
|
|
|
|
|
$MenuUnit_hash_ref}[2]{$all_menu_items_array[
|
5210
|
|
|
|
|
|
|
$numbor-1]||$all_menu_items_array[
|
5211
|
0
|
|
0
|
|
|
|
$pn{$numbor}[1]-1]}})|| exists $labels{
|
5212
|
|
|
|
|
|
|
(keys %{$FullMenu->{$MenuUnit_hash_ref}[2]
|
5213
|
0
|
|
0
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]
|
5214
|
|
|
|
|
|
|
||''}})[0]or[]}||
|
5215
|
|
|
|
|
|
|
&test_hashref($FullMenu->{$MenuUnit_hash_ref}[2]
|
5216
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]||
|
5217
|
|
|
|
|
|
|
$all_menu_items_array[$pn{$numbor}[1]-1]})) {
|
5218
|
0
|
|
|
|
|
|
my $menyou='';
|
5219
|
0
|
0
|
|
|
|
|
my $cur_menu=($filtered_menu)?$parent_menu:$MenuUnit_hash_ref;
|
5220
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
5221
|
0
|
|
|
|
|
|
my @all_copy=@all_menu_items_array;
|
5222
|
0
|
|
|
|
|
|
@all_menu_items_array=();
|
5223
|
0
|
|
|
|
|
|
my $pstart=0;
|
5224
|
0
|
|
|
|
|
|
my $pstop=0;
|
5225
|
0
|
|
|
|
|
|
foreach my $pik (sort numerically keys %pn) {
|
5226
|
0
|
|
|
|
|
|
$pstop=$pik-2;
|
5227
|
0
|
|
|
|
|
|
foreach my $item ($pstart..$pstop) {
|
5228
|
0
|
|
|
|
|
|
push @all_menu_items_array,'';
|
5229
|
|
|
|
|
|
|
}
|
5230
|
0
|
|
|
|
|
|
push @all_menu_items_array, shift @all_copy;
|
5231
|
0
|
|
|
|
|
|
$pstart=$pstop+2;
|
5232
|
0
|
|
|
|
|
|
$pstop=0;
|
5233
|
|
|
|
|
|
|
}
|
5234
|
0
|
|
|
|
|
|
while (my $pst=$pstart--) {
|
5235
|
0
|
0
|
|
|
|
|
if ($pst=~/0$/) {
|
5236
|
0
|
|
|
|
|
|
$FullMenu->{$cur_menu}[11]=$pst;
|
5237
|
0
|
|
|
|
|
|
last;
|
5238
|
|
|
|
|
|
|
}
|
5239
|
|
|
|
|
|
|
}
|
5240
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
5241
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5242
|
|
|
|
|
|
|
}
|
5243
|
0
|
0
|
|
|
|
|
if (!$filtered_menu) {
|
5244
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
|
|
0
|
|
|
|
|
|
5245
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
5246
|
|
|
|
|
|
|
{'__FA_Banner__'}
|
5247
|
0
|
|
|
|
|
|
=$MenuUnit_hash_ref->{Result};
|
5248
|
|
|
|
|
|
|
} elsif (exists $labels{(keys %{$FullMenu->
|
5249
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5250
|
0
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]}})[0]}) {
|
5251
|
0
|
|
|
|
|
|
my %men_result=%{$FullMenu->
|
5252
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5253
|
0
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]}};
|
5254
|
|
|
|
|
|
|
$menyou=&Data::Dump::Streamer::Dump($labels{
|
5255
|
0
|
|
|
|
|
|
(keys %men_result)[0]})->Out();
|
5256
|
|
|
|
|
|
|
#print "MENYOU=$menyou<==\n";;
|
5257
|
0
|
|
|
|
|
|
$menyou=~s/\$HASH\d*\s*=\s*//s;
|
5258
|
0
|
|
|
|
|
|
my $mnyou=eval $menyou;
|
5259
|
|
|
|
|
|
|
#print "WHAT IS THE CONVEY=$mnyou->{Item_1}->{Convey}<==\n";
|
5260
|
|
|
|
|
|
|
$FullMenu->
|
5261
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5262
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}=$mnyou;
|
5263
|
|
|
|
|
|
|
my $itemnum=$FullMenu->{$MenuUnit_hash_ref}[4]
|
5264
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5265
|
|
|
|
|
|
|
}
|
5266
|
|
|
|
|
|
|
}
|
5267
|
0
|
0
|
|
|
|
|
chomp($numbor) if $numbor;
|
5268
|
0
|
0
|
0
|
|
|
|
unless ($numbor_is_eff) {
|
5269
|
0
|
0
|
|
|
|
|
if (exists $picks{$numbor}) {
|
5270
|
|
|
|
|
|
|
#$FullMenu->{$cur_menu}[5]='ERASE';
|
5271
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5272
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SaveNext}) {
|
|
0
|
|
|
|
|
|
|
5273
|
0
|
|
|
|
|
|
delete $SaveNext->{$key};
|
5274
|
|
|
|
|
|
|
}
|
5275
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
|
|
0
|
|
|
|
|
|
5276
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5277
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5278
|
0
|
|
|
|
|
|
delete $Selected->{$cur_menu}{$numbor};
|
5279
|
|
|
|
|
|
|
} elsif ($picks{$numbor} ne ' ') {
|
5280
|
0
|
|
|
|
|
|
&delete_Selected($cur_menu,$numbor,
|
5281
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5282
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5283
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5284
|
|
|
|
|
|
|
}
|
5285
|
|
|
|
|
|
|
}
|
5286
|
0
|
0
|
0
|
|
|
|
if ($prev_menu && $prev_menu!=$numbor) {
|
5287
|
|
|
|
|
|
|
#$FullMenu->{$cur_menu}[5]='ERASE';
|
5288
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5289
|
0
|
|
|
|
|
|
&delete_Selected($cur_menu,$prev_menu,
|
5290
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5291
|
0
|
|
|
|
|
|
delete $picks{$prev_menu};
|
5292
|
0
|
|
|
|
|
|
delete $items{$prev_menu};
|
5293
|
|
|
|
|
|
|
}
|
5294
|
|
|
|
|
|
|
} elsif (!$show_banner_only) {
|
5295
|
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5296
|
|
|
|
|
|
|
if (($start<=$key) || ($key<=$start+$choose_num)) {
|
5297
|
|
|
|
|
|
|
$numbor=$key;
|
5298
|
|
|
|
|
|
|
last;
|
5299
|
|
|
|
|
|
|
}
|
5300
|
|
|
|
|
|
|
}
|
5301
|
|
|
|
|
|
|
}
|
5302
|
0
|
|
|
|
|
|
my $next_menu_ref='';
|
5303
|
0
|
0
|
|
|
|
|
unless ($show_banner_only) {
|
5304
|
|
|
|
|
|
|
$next_menu_ref=$FullMenu->
|
5305
|
|
|
|
|
|
|
{$cur_menu}[2]
|
5306
|
0
|
0
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5307
|
|
|
|
|
|
|
unless $filtered_menu;
|
5308
|
0
|
|
0
|
|
|
|
$next_menu_ref||='';
|
5309
|
0
|
0
|
|
|
|
|
delete $SavePick->{$next_menu_ref}
|
5310
|
|
|
|
|
|
|
unless $filtered_menu;
|
5311
|
0
|
0
|
|
|
|
|
$FullMenu->{$next_menu_ref}[11]=0
|
5312
|
|
|
|
|
|
|
unless $filtered_menu;
|
5313
|
|
|
|
|
|
|
%picks=() if (!$select_many &&
|
5314
|
0
|
0
|
0
|
|
|
|
!exists ${$MenuUnit_hash_ref}{Select}{$numbor});
|
|
0
|
|
|
|
|
|
|
5315
|
0
|
0
|
0
|
|
|
|
$picks{$numbor}='-' if !(keys %picks) || $numbor!~/^[Ff]$/;
|
5316
|
|
|
|
|
|
|
}
|
5317
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,$Selected,
|
5318
|
|
|
|
|
|
|
$convey,$parent_menu)
|
5319
|
|
|
|
|
|
|
=$get_result->($cur_menu,
|
5320
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,
|
5321
|
|
|
|
|
|
|
$picks_from_parent,$FullMenu,$Conveyed,$Selected,
|
5322
|
|
|
|
|
|
|
$SaveNext,$Persists,$parent_menu);
|
5323
|
0
|
|
|
|
|
|
%{$SavePick->{$cur_menu}}=%picks;
|
|
0
|
|
|
|
|
|
|
5324
|
0
|
|
|
|
|
|
$Conveyed->{&pw($cur_menu)}=[];
|
5325
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
0
|
|
|
|
|
|
5326
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %picks) {
|
5327
|
0
|
|
|
|
|
|
push @{$Conveyed->{&pw($cur_menu)}},
|
|
0
|
|
|
|
|
|
|
5328
|
|
|
|
|
|
|
$all_menu_items_array[$key-1];
|
5329
|
|
|
|
|
|
|
}
|
5330
|
|
|
|
|
|
|
} elsif ($numbor) {
|
5331
|
0
|
|
|
|
|
|
$Conveyed->{&pw($cur_menu)}=
|
5332
|
|
|
|
|
|
|
$all_menu_items_array[$numbor-1];
|
5333
|
|
|
|
|
|
|
}
|
5334
|
0
|
|
|
|
|
|
my $mcount=0;
|
5335
|
0
|
0
|
|
|
|
|
unless (exists $SaveMMap->{$cur_menu}) {
|
5336
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
5337
|
0
|
|
|
|
|
|
my $pmap=[];
|
5338
|
0
|
|
|
|
|
|
foreach my $kee (keys %{$SaveMMap}) {
|
|
0
|
|
|
|
|
|
|
5339
|
|
|
|
|
|
|
my $map=&Data::Dump::Streamer::Dump(
|
5340
|
0
|
|
|
|
|
|
$SaveMMap->{$kee})->Out();
|
5341
|
0
|
|
|
|
|
|
$map=~s/\$ARRAY\d*\s*=\s*//s;
|
5342
|
0
|
|
|
|
|
|
my $m=eval $map;
|
5343
|
0
|
0
|
|
|
|
|
$pmap=$m if $#{$pmap}<$#{$m};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5344
|
|
|
|
|
|
|
}
|
5345
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=$pmap;
|
5346
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
5347
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu});
|
5348
|
|
|
|
|
|
|
} elsif ($parent_menu) {
|
5349
|
|
|
|
|
|
|
my $parent_map=&Data::Dump::Streamer::Dump(
|
5350
|
0
|
|
|
|
|
|
$SaveMMap->{$parent_menu})->Out();
|
5351
|
0
|
|
|
|
|
|
$parent_map=~s/\$ARRAY\d*\s*=\s*//s;
|
5352
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=eval $parent_map;
|
5353
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
5354
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu});
|
5355
|
|
|
|
|
|
|
} else {
|
5356
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=[];
|
5357
|
|
|
|
|
|
|
}
|
5358
|
|
|
|
|
|
|
}
|
5359
|
0
|
0
|
|
|
|
|
if (ref $convey eq 'ARRAY') {
|
5360
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$cur_menu}},
|
|
0
|
|
|
|
|
|
|
5361
|
|
|
|
|
|
|
[ ++$mcount, $convey->[0] ];
|
5362
|
|
|
|
|
|
|
} else {
|
5363
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$cur_menu}},
|
|
0
|
|
|
|
|
|
|
5364
|
|
|
|
|
|
|
[ ++$mcount, $convey ];
|
5365
|
|
|
|
|
|
|
}
|
5366
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
5367
|
|
|
|
|
|
|
return $FullMenu->
|
5368
|
|
|
|
|
|
|
{$cur_menu}[2]
|
5369
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]},$convey,
|
5370
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
5371
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
5372
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
5373
|
|
|
|
|
|
|
$cur_menu,$no_wantarray;
|
5374
|
|
|
|
|
|
|
}
|
5375
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$cur_menu};
|
5376
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
5377
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
5378
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
5379
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
5380
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
5381
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
5382
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
5383
|
0
|
|
|
|
|
|
my $menu_result='';
|
5384
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$cur_menu}
|
5385
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
5386
|
|
|
|
|
|
|
$menu_result=$Selected->{$cur_menu}
|
5387
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
5388
|
0
|
0
|
|
|
|
|
$menu_result=$menu_result->() if ref
|
5389
|
|
|
|
|
|
|
$menu_result eq 'CODE';
|
5390
|
|
|
|
|
|
|
} else {
|
5391
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$cur_menu}[2]
|
5392
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5393
|
|
|
|
|
|
|
}
|
5394
|
0
|
|
|
|
|
|
eval {
|
5395
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
5396
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
5397
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
5398
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
5399
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
5400
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
5401
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
5402
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
5403
|
|
|
|
|
|
|
$cur_menu,$no_wantarray);
|
5404
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 7
|
5405
|
0
|
0
|
|
|
|
|
print "MENU RETURN 7\n" if $menu_return_debug;
|
5406
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
5407
|
0
|
0
|
0
|
|
|
|
if (ref $menu_output eq 'ARRAY' &&
|
5408
|
|
|
|
|
|
|
$menu_output->[0]=~/^[{](.*)[}][<]$/) {
|
5409
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
5410
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
5411
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
5412
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
5413
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5414
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
5415
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
5416
|
0
|
|
|
|
|
|
%picks=();
|
5417
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
5418
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $choose_num if $num_pick;
|
5419
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
5420
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
5421
|
0
|
0
|
0
|
|
|
|
if ($curscreennum<$MenuUnit_hash_ref->{Scroll}->[1]
|
5422
|
|
|
|
|
|
|
&& $display_this_many_items<$num_pick-$start) {
|
5423
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
5424
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
5425
|
0
|
0
|
|
|
|
|
if ($start+$remainder==$num_pick) {
|
5426
|
0
|
|
|
|
|
|
$choose_num=$num_pick-$start;
|
5427
|
|
|
|
|
|
|
} else {
|
5428
|
0
|
|
|
|
|
|
$choose_num=$display_this_many_items;
|
5429
|
|
|
|
|
|
|
}
|
5430
|
|
|
|
|
|
|
}
|
5431
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5432
|
0
|
|
|
|
|
|
next;
|
5433
|
|
|
|
|
|
|
} else {
|
5434
|
0
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref};
|
5435
|
0
|
|
|
|
|
|
return $menu_output,
|
5436
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5437
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5438
|
|
|
|
|
|
|
$Persists;
|
5439
|
|
|
|
|
|
|
}
|
5440
|
|
|
|
|
|
|
} else {
|
5441
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
5442
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
5443
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
5444
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
5445
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
5446
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
5447
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
5448
|
|
|
|
|
|
|
}
|
5449
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
5450
|
0
|
0
|
0
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
5451
|
0
|
0
|
|
|
|
|
if (grep { /\+|\*/ } values %picks) {
|
|
0
|
|
|
|
|
|
|
5452
|
0
|
|
|
|
|
|
return '+',
|
5453
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5454
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5455
|
|
|
|
|
|
|
$Persists;
|
5456
|
|
|
|
|
|
|
} else {
|
5457
|
0
|
|
|
|
|
|
my %sp_copy=%{$SavePick->{$parent_menu}}
|
5458
|
0
|
0
|
|
|
|
|
if exists $SavePick->{$parent_menu};
|
5459
|
0
|
|
|
|
|
|
foreach my $key (keys %sp_copy) {
|
5460
|
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='-' if
|
5461
|
0
|
0
|
|
|
|
|
$sp_copy{$key} eq '+';
|
5462
|
|
|
|
|
|
|
}
|
5463
|
0
|
|
|
|
|
|
return '-',
|
5464
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5465
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5466
|
|
|
|
|
|
|
$Persists;
|
5467
|
|
|
|
|
|
|
}
|
5468
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
5469
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
5470
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
5471
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
5472
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
5473
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5474
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE' and 1<$recurse_level) {
|
5475
|
0
|
|
|
|
|
|
return 'DONE';
|
5476
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
5477
|
0
|
|
|
|
|
|
return $menu_output;
|
5478
|
|
|
|
|
|
|
} else {
|
5479
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5480
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5481
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5482
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5483
|
|
|
|
|
|
|
#print "IN MAKEPLAN14\n";
|
5484
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}}
|
|
0
|
|
|
|
|
|
|
5485
|
|
|
|
|
|
|
&& !exists
|
5486
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
5487
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5488
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5489
|
|
|
|
|
|
|
}
|
5490
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
5491
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
5492
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5493
|
|
|
|
|
|
|
Number => $numbor,
|
5494
|
|
|
|
|
|
|
PlanID =>
|
5495
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
5496
|
0
|
|
|
|
|
|
Item => $all_menu_items_array[$numbor-1] }
|
5497
|
|
|
|
|
|
|
}
|
5498
|
|
|
|
|
|
|
}
|
5499
|
0
|
0
|
|
|
|
|
my $subfile=substr(
|
5500
|
|
|
|
|
|
|
$Term::Menus::fa_code,0,-3).'::'
|
5501
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
5502
|
0
|
|
0
|
|
|
|
$subfile||='';
|
5503
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
5504
|
0
|
|
|
|
|
|
my @resu=();
|
5505
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
5506
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5507
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5508
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5509
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5510
|
|
|
|
|
|
|
#print "IN MAKEPLAN15\n";
|
5511
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5512
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5513
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5514
|
|
|
|
|
|
|
'Title'}) {
|
5515
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5516
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5517
|
|
|
|
|
|
|
}
|
5518
|
0
|
|
|
|
|
|
my $n='Numbor';
|
5519
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5520
|
0
|
|
|
|
|
|
'Plan'}},
|
5521
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5522
|
|
|
|
|
|
|
Number => $numbor,
|
5523
|
|
|
|
|
|
|
PlanID =>
|
5524
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5525
|
|
|
|
|
|
|
Item =>
|
5526
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out()
|
5527
|
|
|
|
|
|
|
}
|
5528
|
|
|
|
|
|
|
}
|
5529
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5530
|
0
|
0
|
|
|
|
|
if ($@) {
|
5531
|
0
|
0
|
0
|
|
|
|
if (10
|
5532
|
|
|
|
|
|
|
'FATAL ERROR') {
|
5533
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray &&
|
|
|
|
0
|
|
|
|
|
5534
|
|
|
|
|
|
|
!$no_wantarray) {
|
5535
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5536
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5537
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5538
|
|
|
|
|
|
|
}
|
5539
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5540
|
|
|
|
|
|
|
-1
|
5541
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5542
|
0
|
|
|
|
|
|
close($log_handle);
|
5543
|
|
|
|
|
|
|
}
|
5544
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5545
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5546
|
0
|
|
|
|
|
|
} else { die $@ }
|
5547
|
|
|
|
|
|
|
} else {
|
5548
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5549
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5550
|
|
|
|
|
|
|
."Conveyed\n"
|
5551
|
|
|
|
|
|
|
." the Following "
|
5552
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5553
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5554
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray &&
|
|
|
|
0
|
|
|
|
|
5555
|
|
|
|
|
|
|
!$no_wantarray) {
|
5556
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5557
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5558
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5559
|
|
|
|
|
|
|
}
|
5560
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5561
|
|
|
|
|
|
|
-1
|
5562
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5563
|
0
|
|
|
|
|
|
close($log_handle);
|
5564
|
|
|
|
|
|
|
}
|
5565
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5566
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5567
|
0
|
|
|
|
|
|
} else { die $die }
|
5568
|
|
|
|
|
|
|
}
|
5569
|
|
|
|
|
|
|
}
|
5570
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5571
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') {
|
5572
|
0
|
|
|
|
|
|
%picks=();
|
5573
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5574
|
|
|
|
|
|
|
next
|
5575
|
0
|
|
|
|
|
|
}
|
5576
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5577
|
0
|
|
|
|
|
|
return @resu;
|
5578
|
|
|
|
|
|
|
} else {
|
5579
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5580
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5581
|
|
|
|
|
|
|
}
|
5582
|
|
|
|
|
|
|
}
|
5583
|
0
|
|
|
|
|
|
$done=1;last
|
5584
|
0
|
|
|
|
|
|
}
|
5585
|
0
|
|
|
|
|
|
eval {
|
5586
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
5587
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5588
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5589
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5590
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5591
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5592
|
|
|
|
|
|
|
#print "IN MAKEPLAN16\n";
|
5593
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5594
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5595
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5596
|
|
|
|
|
|
|
'Title'}) {
|
5597
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5598
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5599
|
|
|
|
|
|
|
}
|
5600
|
0
|
|
|
|
|
|
my $n='Number';
|
5601
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5602
|
0
|
|
|
|
|
|
'Plan'}},
|
5603
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5604
|
|
|
|
|
|
|
Number => $numbor,
|
5605
|
|
|
|
|
|
|
PlanID =>
|
5606
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5607
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
5608
|
|
|
|
|
|
|
}
|
5609
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
5610
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
5611
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
5612
|
|
|
|
|
|
|
(-1
|
5613
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5614
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5615
|
|
|
|
|
|
|
} else {
|
5616
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5617
|
|
|
|
|
|
|
}
|
5618
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
5619
|
0
|
|
|
|
|
|
my $c=$Term::Menus::fa_code;
|
5620
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
5621
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}[2]
|
|
0
|
|
|
|
|
|
|
5622
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}) {
|
5623
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
5624
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
5625
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5626
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5627
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
5628
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
5629
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
5630
|
|
|
|
|
|
|
." that Does NOT Exist"
|
5631
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
5632
|
|
|
|
|
|
|
.$c.",\n\t\tnor was a routine with "
|
5633
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
5634
|
|
|
|
|
|
|
." main:: script.\n";
|
5635
|
|
|
|
|
|
|
} else {
|
5636
|
0
|
|
|
|
|
|
$die="$firsterr\n $seconderr"
|
5637
|
|
|
|
|
|
|
}
|
5638
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
5639
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5640
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5641
|
|
|
|
|
|
|
} else {
|
5642
|
0
|
|
|
|
|
|
die $die;
|
5643
|
|
|
|
|
|
|
}
|
5644
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
5645
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5646
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
5647
|
|
|
|
|
|
|
$firsterr);
|
5648
|
|
|
|
|
|
|
} else {
|
5649
|
0
|
|
|
|
|
|
die $firsterr;
|
5650
|
|
|
|
|
|
|
}
|
5651
|
|
|
|
|
|
|
}
|
5652
|
|
|
|
|
|
|
} else {
|
5653
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5654
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5655
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5656
|
|
|
|
|
|
|
} else {
|
5657
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5658
|
|
|
|
|
|
|
}
|
5659
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
5660
|
|
|
|
|
|
|
}
|
5661
|
|
|
|
|
|
|
};
|
5662
|
0
|
0
|
|
|
|
|
if ($@) {
|
5663
|
0
|
0
|
0
|
|
|
|
if (10
|
5664
|
|
|
|
|
|
|
'FATAL ERROR') {
|
5665
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5666
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5667
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5668
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5669
|
|
|
|
|
|
|
}
|
5670
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5671
|
|
|
|
|
|
|
-1
|
5672
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5673
|
0
|
|
|
|
|
|
close($log_handle);
|
5674
|
|
|
|
|
|
|
}
|
5675
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5676
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5677
|
0
|
|
|
|
|
|
} else { die $@ }
|
5678
|
|
|
|
|
|
|
} else {
|
5679
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5680
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5681
|
|
|
|
|
|
|
."Conveyed\n"
|
5682
|
|
|
|
|
|
|
." the Following "
|
5683
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5684
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5685
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5686
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5687
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5688
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5689
|
|
|
|
|
|
|
}
|
5690
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5691
|
|
|
|
|
|
|
-1
|
5692
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5693
|
0
|
|
|
|
|
|
close($log_handle);
|
5694
|
|
|
|
|
|
|
}
|
5695
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5696
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5697
|
0
|
|
|
|
|
|
} else { die $die }
|
5698
|
|
|
|
|
|
|
}
|
5699
|
|
|
|
|
|
|
}
|
5700
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5701
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') {
|
5702
|
0
|
|
|
|
|
|
%picks=();
|
5703
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5704
|
|
|
|
|
|
|
next
|
5705
|
0
|
|
|
|
|
|
}
|
5706
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5707
|
0
|
|
|
|
|
|
return @resu;
|
5708
|
|
|
|
|
|
|
} else {
|
5709
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5710
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5711
|
|
|
|
|
|
|
}
|
5712
|
|
|
|
|
|
|
}
|
5713
|
|
|
|
|
|
|
}
|
5714
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5715
|
|
|
|
|
|
|
}
|
5716
|
|
|
|
|
|
|
}
|
5717
|
|
|
|
|
|
|
} elsif ($FullMenu && $caller eq $callertest &&
|
5718
|
|
|
|
|
|
|
($select_many || (keys %{$MenuUnit_hash_ref->{Select}}))) {
|
5719
|
0
|
0
|
0
|
|
|
|
if ($numbor!~/^[Ff]$/ && exists $picks{$numbor}) {
|
5720
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
5721
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5722
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5723
|
0
|
|
|
|
|
|
delete ${$Selected}{$MenuUnit_hash_ref}{$numbor};
|
|
0
|
|
|
|
|
|
|
5724
|
|
|
|
|
|
|
} else {
|
5725
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$numbor,
|
5726
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5727
|
0
|
|
|
|
|
|
$SaveNext={%{$SavePick}};
|
|
0
|
|
|
|
|
|
|
5728
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5729
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5730
|
0
|
|
|
|
|
|
} last;
|
5731
|
|
|
|
|
|
|
}
|
5732
|
0
|
0
|
|
|
|
|
if (keys %{$FullMenu->{$MenuUnit_hash_ref}[2]}) {
|
|
0
|
|
|
|
|
|
|
5733
|
0
|
0
|
|
|
|
|
$numbor=(keys %picks)[0] if $numbor=~/^[Ff]$/;
|
5734
|
|
|
|
|
|
|
my $test_result=
|
5735
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
5736
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5737
|
0
|
0
|
0
|
|
|
|
if (ref $test_result eq 'CODE') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
5738
|
0
|
|
|
|
|
|
my $cd='';
|
5739
|
|
|
|
|
|
|
my $sub=$FullMenu->{$MenuUnit_hash_ref}[2]
|
5740
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
5741
|
0
|
|
|
|
|
|
my $select_ed=[];
|
5742
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
|
|
|
|
|
|
5743
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5744
|
0
|
|
|
|
|
|
push @{$select_ed}, $pn{$key}[0];
|
|
0
|
|
|
|
|
|
|
5745
|
|
|
|
|
|
|
}
|
5746
|
|
|
|
|
|
|
} else {
|
5747
|
0
|
|
|
|
|
|
$select_ed=$pn{$numbor}[0];
|
5748
|
|
|
|
|
|
|
}
|
5749
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
5750
|
0
|
|
|
|
|
|
$cd=&Data::Dump::Streamer::Dump($sub)->Out();
|
5751
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
5752
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,'',
|
5753
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
5754
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
5755
|
|
|
|
|
|
|
#print "CD3=$cd\n<=CD\n";;
|
5756
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
5757
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
5758
|
|
|
|
|
|
|
$picks_from_parent);
|
5759
|
|
|
|
|
|
|
#print "CD4=$cd\n<=CD2\n";;
|
5760
|
|
|
|
|
|
|
}
|
5761
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
5762
|
0
|
|
|
|
|
|
$sub=eval $cd;
|
5763
|
0
|
|
|
|
|
|
my @resu=();
|
5764
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5765
|
0
|
0
|
|
|
|
|
if ($@) {
|
5766
|
0
|
0
|
0
|
|
|
|
if (10
|
5767
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5768
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5769
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5770
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5771
|
|
|
|
|
|
|
}
|
5772
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5773
|
|
|
|
|
|
|
-1
|
5774
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5775
|
0
|
|
|
|
|
|
close($log_handle);
|
5776
|
|
|
|
|
|
|
}
|
5777
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5778
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5779
|
0
|
|
|
|
|
|
} else { die $@ }
|
5780
|
|
|
|
|
|
|
} else {
|
5781
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5782
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5783
|
|
|
|
|
|
|
."Conveyed\n"
|
5784
|
|
|
|
|
|
|
." the Following "
|
5785
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5786
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5787
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5788
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5789
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5790
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5791
|
|
|
|
|
|
|
}
|
5792
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5793
|
|
|
|
|
|
|
-1
|
5794
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5795
|
0
|
|
|
|
|
|
close($log_handle);
|
5796
|
|
|
|
|
|
|
}
|
5797
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5798
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5799
|
0
|
|
|
|
|
|
} else { die $die }
|
5800
|
|
|
|
|
|
|
}
|
5801
|
|
|
|
|
|
|
}
|
5802
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5803
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5804
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5805
|
0
|
|
|
|
|
|
return @resu;
|
5806
|
|
|
|
|
|
|
} else {
|
5807
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5808
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5809
|
|
|
|
|
|
|
}
|
5810
|
|
|
|
|
|
|
}
|
5811
|
|
|
|
|
|
|
} elsif ($test_result &&
|
5812
|
|
|
|
|
|
|
($test_result!~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ ||
|
5813
|
|
|
|
|
|
|
(!grep { $1 eq $_ } list_module('main',
|
5814
|
|
|
|
|
|
|
$Term::Menus::fa_code) && $picks{$numbor} ne '*'))) {
|
5815
|
0
|
|
|
|
|
|
my $die="The \"Result12 =>\" Setting\n -> "
|
5816
|
|
|
|
|
|
|
."$test_result\n Found in the Menu "
|
5817
|
|
|
|
|
|
|
."Unit -> ".$MenuUnit_hash_ref
|
5818
|
|
|
|
|
|
|
."\n is NOT a Menu Unit\,"
|
5819
|
|
|
|
|
|
|
."\ and it is NOT a Valid Subroutine.\n\n"
|
5820
|
|
|
|
|
|
|
."\n Cannot Determine "
|
5821
|
|
|
|
|
|
|
."if it is a Valid SubRoutine.\n\n";
|
5822
|
0
|
|
|
|
|
|
die $die;
|
5823
|
|
|
|
|
|
|
} elsif (!defined $pn{$numbor}[0] ||
|
5824
|
|
|
|
|
|
|
!exists ${$FullMenu}{$MenuUnit_hash_ref}[2]{
|
5825
|
|
|
|
|
|
|
$pn{$numbor}[0]}) {
|
5826
|
0
|
|
|
|
|
|
my @resu=map { $all_menu_items_array[$_-1] }
|
|
0
|
|
|
|
|
|
|
5827
|
|
|
|
|
|
|
sort numerically keys %picks;
|
5828
|
0
|
|
|
|
|
|
push @resu,\%picks,$MenuUnit_hash_ref;
|
5829
|
0
|
0
|
0
|
|
|
|
if (wantarray && !$no_wantarray) {
|
|
|
0
|
|
|
|
|
|
5830
|
0
|
|
|
|
|
|
return @resu;
|
5831
|
|
|
|
|
|
|
} elsif ($#resu==0) {
|
5832
|
0
|
|
|
|
|
|
return @resu;
|
5833
|
|
|
|
|
|
|
} else {
|
5834
|
0
|
|
|
|
|
|
return \@resu;
|
5835
|
|
|
|
|
|
|
}
|
5836
|
|
|
|
|
|
|
}
|
5837
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}[2]
|
|
0
|
|
|
|
|
|
|
5838
|
|
|
|
|
|
|
{$pn{$numbor}[0]}) { }
|
5839
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,
|
5840
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu)
|
5841
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
5842
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
5843
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
5844
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
5845
|
0
|
|
|
|
|
|
my %pick=();
|
5846
|
0
|
|
|
|
|
|
$pick{$numbor}='*';
|
5847
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%pick;
|
|
0
|
|
|
|
|
|
|
5848
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5849
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
5850
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
5851
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5852
|
|
|
|
|
|
|
#print "IN MAKEPLAN17\n";
|
5853
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
5854
|
|
|
|
|
|
|
!exists
|
5855
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
5856
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5857
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5858
|
|
|
|
|
|
|
}
|
5859
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
5860
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
5861
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5862
|
|
|
|
|
|
|
Number => $numbor,
|
5863
|
|
|
|
|
|
|
PlanID =>
|
5864
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
5865
|
0
|
|
|
|
|
|
Item => $pn{$numbor}[0] }
|
5866
|
|
|
|
|
|
|
}
|
5867
|
|
|
|
|
|
|
}
|
5868
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
5869
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
5870
|
0
|
|
0
|
|
|
|
$subfile||='';
|
5871
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
5872
|
0
|
|
|
|
|
|
my @resu=();
|
5873
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
5874
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5875
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5876
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5877
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5878
|
|
|
|
|
|
|
#print "IN MAKEPLAN18\n";
|
5879
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5880
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5881
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5882
|
|
|
|
|
|
|
'Title'}) {
|
5883
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5884
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5885
|
|
|
|
|
|
|
}
|
5886
|
0
|
|
|
|
|
|
my $n='Number';
|
5887
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5888
|
0
|
|
|
|
|
|
'Plan'}},
|
5889
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5890
|
|
|
|
|
|
|
Number => $numbor,
|
5891
|
|
|
|
|
|
|
PlanID =>
|
5892
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5893
|
|
|
|
|
|
|
Item =>
|
5894
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out()
|
5895
|
|
|
|
|
|
|
}
|
5896
|
|
|
|
|
|
|
}
|
5897
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5898
|
0
|
0
|
|
|
|
|
if ($@) {
|
5899
|
0
|
0
|
0
|
|
|
|
if (10
|
5900
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
5901
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5902
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5903
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5904
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5905
|
|
|
|
|
|
|
}
|
5906
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5907
|
|
|
|
|
|
|
-1
|
5908
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5909
|
0
|
|
|
|
|
|
close($log_handle);
|
5910
|
|
|
|
|
|
|
}
|
5911
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5912
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5913
|
0
|
|
|
|
|
|
} else { die $@ }
|
5914
|
|
|
|
|
|
|
} else {
|
5915
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5916
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5917
|
|
|
|
|
|
|
."Conveyed\n"
|
5918
|
|
|
|
|
|
|
." the Following "
|
5919
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5920
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5921
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5922
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5923
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5924
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5925
|
|
|
|
|
|
|
}
|
5926
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5927
|
|
|
|
|
|
|
-1
|
5928
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5929
|
0
|
|
|
|
|
|
close($log_handle);
|
5930
|
|
|
|
|
|
|
}
|
5931
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5932
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5933
|
0
|
|
|
|
|
|
} else { die $die }
|
5934
|
|
|
|
|
|
|
}
|
5935
|
|
|
|
|
|
|
}
|
5936
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5937
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5938
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5939
|
0
|
|
|
|
|
|
return @resu;
|
5940
|
|
|
|
|
|
|
} else {
|
5941
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5942
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5943
|
|
|
|
|
|
|
}
|
5944
|
|
|
|
|
|
|
}
|
5945
|
0
|
|
|
|
|
|
$done=1;last
|
5946
|
0
|
|
|
|
|
|
}
|
5947
|
0
|
|
|
|
|
|
eval {
|
5948
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
5949
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5950
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5951
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5952
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5953
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5954
|
|
|
|
|
|
|
#print "IN MAKEPLAN19\n";
|
5955
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5956
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5957
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5958
|
|
|
|
|
|
|
'Title'}) {
|
5959
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5960
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5961
|
|
|
|
|
|
|
}
|
5962
|
0
|
|
|
|
|
|
my $n='Number';
|
5963
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5964
|
0
|
|
|
|
|
|
'Plan'}},
|
5965
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5966
|
|
|
|
|
|
|
Number => $numbor,
|
5967
|
|
|
|
|
|
|
PlanID =>
|
5968
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5969
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
5970
|
|
|
|
|
|
|
}
|
5971
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
5972
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
5973
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
5974
|
|
|
|
|
|
|
(-1
|
5975
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5976
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5977
|
|
|
|
|
|
|
} else {
|
5978
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5979
|
|
|
|
|
|
|
}
|
5980
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
5981
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
5982
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
5983
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
5984
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
5985
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
5986
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5987
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5988
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
5989
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
5990
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
5991
|
|
|
|
|
|
|
." that Does NOT Exist"
|
5992
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
5993
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
5994
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
5995
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
5996
|
|
|
|
|
|
|
." main:: script.\n";
|
5997
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
5998
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
5999
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6000
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
6001
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
6002
|
|
|
|
|
|
|
}
|
6003
|
|
|
|
|
|
|
} else {
|
6004
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6005
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6006
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6007
|
|
|
|
|
|
|
} else {
|
6008
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6009
|
|
|
|
|
|
|
}
|
6010
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
6011
|
|
|
|
|
|
|
}
|
6012
|
|
|
|
|
|
|
};
|
6013
|
0
|
0
|
|
|
|
|
if ($@) {
|
6014
|
0
|
0
|
0
|
|
|
|
if (10
|
6015
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6016
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6017
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6018
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6019
|
|
|
|
|
|
|
}
|
6020
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6021
|
|
|
|
|
|
|
-1
|
6022
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6023
|
0
|
|
|
|
|
|
close($log_handle);
|
6024
|
|
|
|
|
|
|
}
|
6025
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6026
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6027
|
0
|
|
|
|
|
|
} else { die $@ }
|
6028
|
|
|
|
|
|
|
} else {
|
6029
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6030
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6031
|
|
|
|
|
|
|
."Conveyed\n"
|
6032
|
|
|
|
|
|
|
." the Following "
|
6033
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6034
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6035
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6036
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6037
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6038
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6039
|
|
|
|
|
|
|
}
|
6040
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6041
|
|
|
|
|
|
|
-1
|
6042
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6043
|
0
|
|
|
|
|
|
close($log_handle);
|
6044
|
|
|
|
|
|
|
}
|
6045
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6046
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6047
|
0
|
|
|
|
|
|
} else { die $die }
|
6048
|
|
|
|
|
|
|
}
|
6049
|
|
|
|
|
|
|
}
|
6050
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6051
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6052
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6053
|
0
|
|
|
|
|
|
return @resu;
|
6054
|
|
|
|
|
|
|
} else {
|
6055
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6056
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6057
|
|
|
|
|
|
|
}
|
6058
|
|
|
|
|
|
|
}
|
6059
|
0
|
|
|
|
|
|
$done=1;last
|
6060
|
0
|
|
|
|
|
|
}
|
6061
|
0
|
|
|
|
|
|
} else { $done=1;last }
|
|
0
|
|
|
|
|
|
|
6062
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6063
|
|
|
|
|
|
|
} elsif (($show_banner_only && exists $MenuUnit_hash_ref->
|
6064
|
|
|
|
|
|
|
{Result} && ref $MenuUnit_hash_ref->{Result}
|
6065
|
0
|
|
|
|
|
|
eq 'CODE')||(keys %{$FullMenu->{$MenuUnit_hash_ref}[2]}
|
6066
|
|
|
|
|
|
|
&& exists $FullMenu->{$MenuUnit_hash_ref}[2]
|
6067
|
|
|
|
|
|
|
{$pn{$numbor}[0]})) {
|
6068
|
0
|
|
|
|
|
|
my $test_result='';
|
6069
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
6070
|
0
|
|
|
|
|
|
$test_result=$MenuUnit_hash_ref->{Result};
|
6071
|
0
|
|
|
|
|
|
$numbor=1;
|
6072
|
|
|
|
|
|
|
} else {
|
6073
|
|
|
|
|
|
|
$test_result=
|
6074
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$pn{$numbor}[0]};
|
6075
|
|
|
|
|
|
|
}
|
6076
|
0
|
0
|
0
|
|
|
|
if (ref $test_result eq 'CODE') {
|
|
|
0
|
|
|
|
|
|
6077
|
0
|
|
|
|
|
|
my @resu=();
|
6078
|
0
|
|
|
|
|
|
my $test_result_loop=$test_result;
|
6079
|
0
|
|
|
|
|
|
while (1) {
|
6080
|
0
|
|
|
|
|
|
my $look_at_test_result=
|
6081
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(
|
6082
|
|
|
|
|
|
|
$test_result_loop)->Out();
|
6083
|
0
|
|
|
|
|
|
my $tspmi_regex=qr/\](!)?t(?:e+st[-_]*)*[p|s]*
|
6084
|
|
|
|
|
|
|
(?:r+vious[-_]*|e+lected[-_]*)
|
6085
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
6086
|
0
|
|
|
|
|
|
my $sicm_regex=
|
6087
|
|
|
|
|
|
|
qr/\](!)?s(?:e+lected[-_]*)*i*(?:t+ems[-_]*)
|
6088
|
|
|
|
|
|
|
*c*(?:u+rrent[-_]*)*m*(?:e+nu[-_]*)*\[/xi;
|
6089
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
6090
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
6091
|
0
|
|
|
|
|
|
my $trim_look=$look_at_test_result;
|
6092
|
0
|
|
|
|
|
|
$trim_look=~s/^.*(\$CODE\d+\s*=\s*.*$)/$1/s;
|
6093
|
0
|
0
|
0
|
|
|
|
if ((($trim_look!~/Item_/s &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6094
|
|
|
|
|
|
|
$trim_look!~/[']Result['][,]/s) ||
|
6095
|
|
|
|
|
|
|
$trim_look=~/=\s*[']Item_/s) ||
|
6096
|
|
|
|
|
|
|
$look_at_test_result=~/$tspmi_regex/ ||
|
6097
|
|
|
|
|
|
|
$trim_look=~/$sicm_regex/ ||
|
6098
|
|
|
|
|
|
|
$trim_look=~/$tbii_regex/) {
|
6099
|
0
|
0
|
|
|
|
|
%picks=() unless $select_many;
|
6100
|
0
|
|
|
|
|
|
$picks{$numbor}='';
|
6101
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,
|
6102
|
|
|
|
|
|
|
$Selected,$convey,$parent_menu)
|
6103
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
6104
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
6105
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
6106
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
6107
|
0
|
0
|
|
|
|
|
my $item=($show_banner_only)?'__FA_Banner__':$numbor;
|
6108
|
|
|
|
|
|
|
$test_result_loop=
|
6109
|
|
|
|
|
|
|
$Selected->{$MenuUnit_hash_ref}->{$item}
|
6110
|
0
|
0
|
|
|
|
|
if $Selected->{$MenuUnit_hash_ref}->{$item};
|
6111
|
0
|
|
|
|
|
|
my $cd=&Data::Dump::Streamer::Dump(
|
6112
|
|
|
|
|
|
|
$test_result_loop)->Out();
|
6113
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
6114
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6115
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6116
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6117
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
6118
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6119
|
|
|
|
|
|
|
$picks_from_parent);
|
6120
|
0
|
|
|
|
|
|
$cd=&transform_mbir($cd,$Conveyed,$MenuUnit_hash_ref,
|
6121
|
|
|
|
|
|
|
$log_handle);
|
6122
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
6123
|
0
|
|
|
|
|
|
eval { $test_result_loop=eval $cd };
|
|
0
|
|
|
|
|
|
|
6124
|
|
|
|
|
|
|
}
|
6125
|
0
|
|
|
|
|
|
eval { @resu=$test_result_loop->() };
|
|
0
|
|
|
|
|
|
|
6126
|
0
|
0
|
|
|
|
|
if ($@) {
|
6127
|
0
|
0
|
0
|
|
|
|
if (10
|
6128
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6129
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6130
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6131
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6132
|
|
|
|
|
|
|
}
|
6133
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6134
|
|
|
|
|
|
|
-1
|
6135
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6136
|
0
|
|
|
|
|
|
close($log_handle);
|
6137
|
|
|
|
|
|
|
}
|
6138
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6139
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6140
|
0
|
|
|
|
|
|
} else { die $@ }
|
6141
|
|
|
|
|
|
|
} else {
|
6142
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6143
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6144
|
|
|
|
|
|
|
."Conveyed\n"
|
6145
|
|
|
|
|
|
|
." the Following "
|
6146
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6147
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6148
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6149
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6150
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6151
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6152
|
|
|
|
|
|
|
}
|
6153
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6154
|
|
|
|
|
|
|
-1
|
6155
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6156
|
0
|
|
|
|
|
|
close($log_handle);
|
6157
|
|
|
|
|
|
|
}
|
6158
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6159
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6160
|
0
|
|
|
|
|
|
} else { die $die }
|
6161
|
|
|
|
|
|
|
}
|
6162
|
|
|
|
|
|
|
}
|
6163
|
0
|
0
|
0
|
|
|
|
if (0==$#resu && ref $resu[0] eq 'CODE') {
|
6164
|
0
|
|
|
|
|
|
$test_result_loop=$resu[0];
|
6165
|
0
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref}=$resu[0];
|
6166
|
0
|
|
|
|
|
|
next;
|
6167
|
|
|
|
|
|
|
} else {
|
6168
|
0
|
|
|
|
|
|
last;
|
6169
|
|
|
|
|
|
|
}
|
6170
|
|
|
|
|
|
|
}
|
6171
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6172
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6173
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
0
|
0
|
|
|
|
|
6174
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
6175
|
0
|
|
|
|
|
|
return \@resu;
|
6176
|
|
|
|
|
|
|
} else {
|
6177
|
0
|
|
|
|
|
|
return @resu;
|
6178
|
|
|
|
|
|
|
}
|
6179
|
|
|
|
|
|
|
} elsif (ref $resu[0] eq 'HASH') {
|
6180
|
0
|
0
|
0
|
|
|
|
if (grep { /Item_/ } keys %{$resu[0]} && $parent_menu) {
|
|
0
|
|
|
|
|
|
|
6181
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$parent_menu}[2]
|
6182
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
6183
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
6184
|
0
|
|
|
|
|
|
{'__FA_Banner__'}=$resu[0];
|
6185
|
|
|
|
|
|
|
} else {
|
6186
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
6187
|
0
|
|
|
|
|
|
{$pn{$numbor}[0]}=$resu[0];
|
6188
|
|
|
|
|
|
|
}
|
6189
|
|
|
|
|
|
|
} else {
|
6190
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{'__FA_Banner__'}=
|
6191
|
|
|
|
|
|
|
$resu[0];
|
6192
|
|
|
|
|
|
|
}
|
6193
|
|
|
|
|
|
|
} else {
|
6194
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6195
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6196
|
|
|
|
|
|
|
}
|
6197
|
|
|
|
|
|
|
}
|
6198
|
|
|
|
|
|
|
} elsif ($test_result!~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ ||
|
6199
|
|
|
|
|
|
|
!grep { $1 eq $_ } list_module(
|
6200
|
|
|
|
|
|
|
'main',$Term::Menus::fa_code)) {
|
6201
|
0
|
|
|
|
|
|
my $die="The \"Result14 =>\" Setting\n -> "
|
6202
|
|
|
|
|
|
|
.$test_result
|
6203
|
|
|
|
|
|
|
."\n Found in the Menu Unit -> "
|
6204
|
|
|
|
|
|
|
.$MenuUnit_hash_ref
|
6205
|
|
|
|
|
|
|
."\n is not a Menu Unit\,"
|
6206
|
|
|
|
|
|
|
." and not a Valid SubRoutine.\n\n";
|
6207
|
0
|
|
|
|
|
|
die $die;
|
6208
|
|
|
|
|
|
|
}
|
6209
|
0
|
0
|
|
|
|
|
%picks=() unless $select_many;
|
6210
|
0
|
|
|
|
|
|
$picks{$numbor}='';
|
6211
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,
|
6212
|
|
|
|
|
|
|
$Selected,$convey,$parent_menu)
|
6213
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
6214
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
6215
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
6216
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
6217
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
6218
|
0
|
|
|
|
|
|
my $test_item='';
|
6219
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$MenuUnit_hash_ref}{'__FA_Banner__'}) {
|
6220
|
0
|
|
|
|
|
|
$test_item=$Selected->{$MenuUnit_hash_ref}{'__FA_Banner__'};
|
6221
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
6222
|
|
|
|
|
|
|
} else {
|
6223
|
|
|
|
|
|
|
$test_item=$FullMenu->{$MenuUnit_hash_ref}[2]
|
6224
|
0
|
|
|
|
|
|
{$pn{$numbor}[0]};
|
6225
|
|
|
|
|
|
|
}
|
6226
|
0
|
|
0
|
|
|
|
$test_item||='';
|
6227
|
0
|
0
|
0
|
|
|
|
if ((ref $test_item eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
6228
|
0
|
|
|
|
|
|
grep { /Item_/ } keys %{$test_item}) ||
|
|
0
|
|
|
|
|
|
|
6229
|
|
|
|
|
|
|
$show_banner_only) {
|
6230
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=[];
|
6231
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
|
|
|
|
|
|
6232
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %picks) {
|
6233
|
0
|
|
|
|
|
|
push @{$Conveyed->{&pw($MenuUnit_hash_ref)}},
|
|
0
|
|
|
|
|
|
|
6234
|
|
|
|
|
|
|
$all_menu_items_array[$key-1];
|
6235
|
|
|
|
|
|
|
}
|
6236
|
|
|
|
|
|
|
} else {
|
6237
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=
|
6238
|
|
|
|
|
|
|
$all_menu_items_array[$numbor-1];
|
6239
|
|
|
|
|
|
|
}
|
6240
|
0
|
|
|
|
|
|
my $mcount=0;
|
6241
|
0
|
0
|
|
|
|
|
unless (exists $SaveMMap->{$MenuUnit_hash_ref}) {
|
6242
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
6243
|
0
|
|
|
|
|
|
my $pmap=[];
|
6244
|
0
|
|
|
|
|
|
foreach my $kee (keys %{$SaveMMap}) {
|
|
0
|
|
|
|
|
|
|
6245
|
|
|
|
|
|
|
my $map=&Data::Dump::Streamer::Dump(
|
6246
|
0
|
|
|
|
|
|
$SaveMMap->{$kee})->Out();
|
6247
|
0
|
|
|
|
|
|
$map=~s/\$ARRAY\d*\s*=\s*//s;
|
6248
|
0
|
|
|
|
|
|
my $m=eval $map;
|
6249
|
0
|
0
|
|
|
|
|
$pmap=$m if $#{$pmap}<$#{$m};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6250
|
|
|
|
|
|
|
}
|
6251
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=$pmap;
|
6252
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
6253
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref});
|
6254
|
|
|
|
|
|
|
} elsif ($parent_menu) {
|
6255
|
|
|
|
|
|
|
my $parent_map=&Data::Dump::Streamer::Dump(
|
6256
|
0
|
|
|
|
|
|
$SaveMMap->{$parent_menu})->Out();
|
6257
|
0
|
|
|
|
|
|
$parent_map=~s/\$ARRAY\d*\s*=\s*//s;
|
6258
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=eval $parent_map;
|
6259
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
6260
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref});
|
6261
|
|
|
|
|
|
|
} else {
|
6262
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=[];
|
6263
|
|
|
|
|
|
|
}
|
6264
|
|
|
|
|
|
|
}
|
6265
|
0
|
0
|
|
|
|
|
if (ref $convey eq 'ARRAY') {
|
6266
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$MenuUnit_hash_ref}},
|
|
0
|
|
|
|
|
|
|
6267
|
|
|
|
|
|
|
[ ++$mcount, $convey->[0] ];
|
6268
|
|
|
|
|
|
|
} else {
|
6269
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$MenuUnit_hash_ref}},
|
|
0
|
|
|
|
|
|
|
6270
|
|
|
|
|
|
|
[ ++$mcount, $convey ];
|
6271
|
|
|
|
|
|
|
}
|
6272
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$MenuUnit_hash_ref};
|
6273
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
6274
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
6275
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
6276
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
6277
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
6278
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
6279
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
6280
|
0
|
|
|
|
|
|
my $menu_result='';
|
6281
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
6282
|
0
|
|
|
|
|
|
$menu_result=$test_item;
|
6283
|
|
|
|
|
|
|
} else {
|
6284
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$MenuUnit_hash_ref}[2]
|
6285
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
6286
|
|
|
|
|
|
|
}
|
6287
|
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref}=$menu_result
|
6288
|
0
|
0
|
|
|
|
|
unless exists $SaveNext->{$MenuUnit_hash_ref};
|
6289
|
0
|
|
|
|
|
|
eval {
|
6290
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
6291
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
6292
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
6293
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
6294
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
6295
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
6296
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
6297
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
6298
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
6299
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 8
|
6300
|
0
|
0
|
|
|
|
|
print "MENU RETURN 8\n" if $menu_return_debug;
|
6301
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
6302
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
6303
|
0
|
|
|
|
|
|
my $test_for_menu_name=$MenuUnit_hash_ref->{Name};
|
6304
|
0
|
0
|
0
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
6305
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
6306
|
0
|
|
|
|
|
|
next;
|
6307
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
6308
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
6309
|
0
|
|
|
|
|
|
next;
|
6310
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
6311
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6312
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE' and 1<$recurse_level) {
|
6313
|
0
|
|
|
|
|
|
return 'DONE';
|
6314
|
|
|
|
|
|
|
} elsif (ref $menu_output eq 'ARRAY' &&
|
6315
|
|
|
|
|
|
|
$menu_output->[0]=~
|
6316
|
|
|
|
|
|
|
/^[{]$test_for_menu_name[}][<]$/) {
|
6317
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
6318
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
6319
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
6320
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
6321
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
6322
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
6323
|
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref}[2]
|
6324
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
6325
|
0
|
|
|
|
|
|
%picks=();
|
6326
|
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]-1 if
|
6327
|
0
|
0
|
|
|
|
|
$start+$choose_num<$FullMenu->{$MenuUnit_hash_ref}[11];
|
6328
|
0
|
0
|
|
|
|
|
$choose_num=$num_pick-$start if
|
6329
|
|
|
|
|
|
|
$display_this_many_items>=$num_pick-$start;
|
6330
|
0
|
|
|
|
|
|
next;
|
6331
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
6332
|
0
|
|
|
|
|
|
return $menu_output;
|
6333
|
|
|
|
|
|
|
} else {
|
6334
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
6335
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
6336
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
6337
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
6338
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
6339
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
6340
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
6341
|
|
|
|
|
|
|
}
|
6342
|
|
|
|
|
|
|
}
|
6343
|
0
|
|
|
|
|
|
my %pick=();
|
6344
|
0
|
|
|
|
|
|
$pick{$numbor}='*';
|
6345
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%pick;
|
|
0
|
|
|
|
|
|
|
6346
|
0
|
0
|
|
|
|
|
my $subfile=($Term::Menus::fullauto)
|
6347
|
|
|
|
|
|
|
?substr($Term::Menus::fa_code,0,-3).'::'
|
6348
|
|
|
|
|
|
|
:'';
|
6349
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
6350
|
0
|
|
|
|
|
|
my @resu=();
|
6351
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
6352
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6353
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
6354
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
6355
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6356
|
|
|
|
|
|
|
#print "IN MAKEPLAN20\n";
|
6357
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
6358
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
6359
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
6360
|
|
|
|
|
|
|
'Title'}) {
|
6361
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
6362
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
6363
|
|
|
|
|
|
|
}
|
6364
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
6365
|
0
|
|
|
|
|
|
'Plan'}},
|
6366
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6367
|
|
|
|
|
|
|
Number => $numbor,
|
6368
|
|
|
|
|
|
|
PlanID =>
|
6369
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
6370
|
0
|
|
|
|
|
|
Item =>
|
6371
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
6372
|
|
|
|
|
|
|
}
|
6373
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
6374
|
0
|
0
|
|
|
|
|
if ($@) {
|
6375
|
0
|
0
|
0
|
|
|
|
if (10
|
6376
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6377
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6378
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6379
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6380
|
|
|
|
|
|
|
}
|
6381
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6382
|
|
|
|
|
|
|
-1
|
6383
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6384
|
0
|
|
|
|
|
|
close($log_handle);
|
6385
|
|
|
|
|
|
|
}
|
6386
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6387
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6388
|
0
|
|
|
|
|
|
} else { die $@ }
|
6389
|
|
|
|
|
|
|
} else {
|
6390
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6391
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6392
|
|
|
|
|
|
|
."Conveyed\n"
|
6393
|
|
|
|
|
|
|
." the Following "
|
6394
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6395
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6396
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6397
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6398
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6399
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6400
|
|
|
|
|
|
|
}
|
6401
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6402
|
|
|
|
|
|
|
-1
|
6403
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6404
|
0
|
|
|
|
|
|
close($log_handle);
|
6405
|
|
|
|
|
|
|
}
|
6406
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6407
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6408
|
0
|
|
|
|
|
|
} else { die $die }
|
6409
|
|
|
|
|
|
|
}
|
6410
|
|
|
|
|
|
|
}
|
6411
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6412
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6413
|
0
|
0
|
|
|
|
|
if ($resu[0]=~/^[{](.*)[}][<]$/) {
|
6414
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
6415
|
0
|
|
|
|
|
|
%picks=();next;
|
|
0
|
|
|
|
|
|
|
6416
|
|
|
|
|
|
|
} else {
|
6417
|
0
|
|
|
|
|
|
return $resu[0];
|
6418
|
|
|
|
|
|
|
}
|
6419
|
|
|
|
|
|
|
}
|
6420
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6421
|
0
|
|
|
|
|
|
return @resu;
|
6422
|
|
|
|
|
|
|
} else {
|
6423
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6424
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6425
|
|
|
|
|
|
|
}
|
6426
|
|
|
|
|
|
|
}
|
6427
|
0
|
|
|
|
|
|
$done=1;last
|
6428
|
0
|
|
|
|
|
|
}
|
6429
|
0
|
|
|
|
|
|
eval {
|
6430
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
6431
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6432
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6433
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
6434
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
6435
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6436
|
|
|
|
|
|
|
#print "IN MAKEPLAN21\n";
|
6437
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
6438
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
6439
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
6440
|
|
|
|
|
|
|
'Title'}) {
|
6441
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
6442
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
6443
|
|
|
|
|
|
|
}
|
6444
|
0
|
|
|
|
|
|
my $n='Number';
|
6445
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
6446
|
0
|
|
|
|
|
|
'Plan'}},
|
6447
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6448
|
|
|
|
|
|
|
Number => $numbor,
|
6449
|
|
|
|
|
|
|
PlanID =>
|
6450
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
6451
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
6452
|
|
|
|
|
|
|
}
|
6453
|
|
|
|
|
|
|
$sub=&transform_sicm($sub,$numbor,
|
6454
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6455
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6456
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6457
|
0
|
|
|
|
|
|
$sub=&transform_pmsi($sub,
|
6458
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6459
|
|
|
|
|
|
|
$picks_from_parent);
|
6460
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
6461
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
6462
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
6463
|
|
|
|
|
|
|
(-1
|
6464
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6465
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6466
|
|
|
|
|
|
|
} else {
|
6467
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6468
|
|
|
|
|
|
|
}
|
6469
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
6470
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
6471
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
6472
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
6473
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
6474
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
6475
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
6476
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
6477
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
6478
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
6479
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
6480
|
|
|
|
|
|
|
." that Does NOT Exist"
|
6481
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
6482
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
6483
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
6484
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
6485
|
|
|
|
|
|
|
." main:: script.\n";
|
6486
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
6487
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
6488
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die.
|
6489
|
|
|
|
|
|
|
"\n\n line ".__LINE__);
|
6490
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
6491
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6492
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr.
|
6493
|
|
|
|
|
|
|
"\n\n line ".__LINE__);
|
6494
|
|
|
|
|
|
|
} else {
|
6495
|
0
|
|
|
|
|
|
die "$firsterr\n\n line ".__LINE__;
|
6496
|
|
|
|
|
|
|
}
|
6497
|
|
|
|
|
|
|
}
|
6498
|
|
|
|
|
|
|
} else {
|
6499
|
|
|
|
|
|
|
$sub=&transform_sicm($sub,$numbor,
|
6500
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6501
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6502
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6503
|
0
|
|
|
|
|
|
$sub=&transform_pmsi($sub,
|
6504
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6505
|
|
|
|
|
|
|
$picks_from_parent);
|
6506
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6507
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6508
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6509
|
|
|
|
|
|
|
} else {
|
6510
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6511
|
|
|
|
|
|
|
}
|
6512
|
0
|
0
|
|
|
|
|
if ($@) {
|
6513
|
0
|
|
|
|
|
|
my $er=$@."\n line ";
|
6514
|
0
|
|
|
|
|
|
die $er.__LINE__;
|
6515
|
|
|
|
|
|
|
}
|
6516
|
|
|
|
|
|
|
}
|
6517
|
|
|
|
|
|
|
};
|
6518
|
0
|
0
|
|
|
|
|
if ($@) {
|
6519
|
0
|
0
|
0
|
|
|
|
if (10
|
6520
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6521
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6522
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6523
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6524
|
|
|
|
|
|
|
}
|
6525
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6526
|
|
|
|
|
|
|
-1
|
6527
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6528
|
0
|
|
|
|
|
|
close($log_handle);
|
6529
|
|
|
|
|
|
|
}
|
6530
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6531
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6532
|
0
|
|
|
|
|
|
} else { die $@ }
|
6533
|
|
|
|
|
|
|
} else {
|
6534
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6535
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6536
|
|
|
|
|
|
|
."Conveyed\n"
|
6537
|
|
|
|
|
|
|
." the Following "
|
6538
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6539
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6540
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6541
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6542
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6543
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6544
|
|
|
|
|
|
|
}
|
6545
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6546
|
|
|
|
|
|
|
-1
|
6547
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6548
|
0
|
|
|
|
|
|
close($log_handle);
|
6549
|
|
|
|
|
|
|
}
|
6550
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6551
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6552
|
0
|
|
|
|
|
|
} else { die $die }
|
6553
|
|
|
|
|
|
|
}
|
6554
|
|
|
|
|
|
|
}
|
6555
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6556
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6557
|
0
|
0
|
|
|
|
|
if ($resu[0]=~/^[{](.*)[}][<]$/) {
|
6558
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
6559
|
0
|
|
|
|
|
|
%picks=();next;
|
|
0
|
|
|
|
|
|
|
6560
|
|
|
|
|
|
|
} else {
|
6561
|
0
|
|
|
|
|
|
return $resu[0];
|
6562
|
|
|
|
|
|
|
}
|
6563
|
|
|
|
|
|
|
}
|
6564
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6565
|
0
|
|
|
|
|
|
return @resu;
|
6566
|
|
|
|
|
|
|
} else {
|
6567
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6568
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6569
|
|
|
|
|
|
|
}
|
6570
|
|
|
|
|
|
|
}
|
6571
|
0
|
|
|
|
|
|
$done=1;last
|
6572
|
0
|
|
|
|
|
|
}
|
6573
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6574
|
|
|
|
|
|
|
} elsif ($return_from_child_menu &&
|
6575
|
|
|
|
|
|
|
!exists $SavePick->{$MenuUnit_hash_ref}->{$pn{$numbor}}) {
|
6576
|
0
|
|
|
|
|
|
delete_Selected($MenuUnit_hash_ref);
|
6577
|
0
|
|
|
|
|
|
$done=1;last;
|
|
0
|
|
|
|
|
|
|
6578
|
0
|
|
|
|
|
|
} else { $done=1 }
|
6579
|
0
|
0
|
|
|
|
|
last if !$return_from_child_menu;
|
6580
|
|
|
|
|
|
|
}
|
6581
|
0
|
0
|
|
|
|
|
} last if $done;
|
6582
|
|
|
|
|
|
|
}
|
6583
|
0
|
0
|
0
|
|
|
|
if ($select_many ||
|
|
|
|
0
|
|
|
|
|
6584
|
0
|
|
|
|
|
|
(exists ${$MenuUnit_hash_ref}{Select}{(keys %picks)[0]||''})) {
|
6585
|
0
|
|
|
|
|
|
my @picks=();
|
6586
|
0
|
|
|
|
|
|
foreach (sort numerically keys %picks) {
|
6587
|
0
|
|
|
|
|
|
my $pik=$all_menu_items_array[$_-1];
|
6588
|
0
|
|
|
|
|
|
push @picks, $pik;
|
6589
|
0
|
|
|
|
|
|
} undef @all_menu_items_array;
|
6590
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref) {
|
6591
|
0
|
|
|
|
|
|
push @picks,\%picks;
|
6592
|
0
|
|
|
|
|
|
push @picks,$MenuUnit_hash_ref;
|
6593
|
0
|
|
|
|
|
|
return \@picks,
|
6594
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
6595
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6596
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
6597
|
|
|
|
|
|
|
} else {
|
6598
|
0
|
|
|
|
|
|
return @picks;
|
6599
|
|
|
|
|
|
|
}
|
6600
|
|
|
|
|
|
|
}
|
6601
|
0
|
|
|
|
|
|
my $pick='';
|
6602
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
6603
|
0
|
|
|
|
|
|
$pick=${$FullMenu}{$MenuUnit_hash_ref}[10]->[$numbor-1];
|
|
0
|
|
|
|
|
|
|
6604
|
|
|
|
|
|
|
} elsif ($numbor=~/^\d+$/) {
|
6605
|
0
|
|
|
|
|
|
$pick=$all_menu_items_array[$numbor-1];
|
6606
|
|
|
|
|
|
|
}
|
6607
|
0
|
|
|
|
|
|
undef @all_menu_items_array;
|
6608
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists ${$MenuUnit_hash_ref}{'NoPlan'} ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6609
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
6610
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6611
|
|
|
|
|
|
|
#print "IN MAKEPLAN23\n";
|
6612
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
6613
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
6614
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=$pick;
|
6615
|
|
|
|
|
|
|
}
|
6616
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
6617
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
6618
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6619
|
|
|
|
|
|
|
Number => $numbor,
|
6620
|
|
|
|
|
|
|
PlanID =>
|
6621
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
6622
|
0
|
|
|
|
|
|
Item => $pick }
|
6623
|
|
|
|
|
|
|
}
|
6624
|
|
|
|
|
|
|
}
|
6625
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
6626
|
0
|
|
|
|
|
|
return $pick,
|
6627
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
6628
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6629
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
6630
|
|
|
|
|
|
|
} else {
|
6631
|
0
|
|
|
|
|
|
return $pick;
|
6632
|
|
|
|
|
|
|
}
|
6633
|
|
|
|
|
|
|
|
6634
|
|
|
|
|
|
|
}
|
6635
|
|
|
|
|
|
|
|
6636
|
|
|
|
|
|
|
sub return_result {
|
6637
|
|
|
|
|
|
|
|
6638
|
0
|
|
|
0
|
0
|
|
my $result_string=$_[0];
|
6639
|
0
|
|
|
|
|
|
my $MenuUnit_hash_ref=$_[1];
|
6640
|
0
|
|
|
|
|
|
my $Conveyed=$_[2];
|
6641
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=$result_string;
|
6642
|
0
|
|
|
|
|
|
my $result_array=[];
|
6643
|
0
|
0
|
0
|
|
|
|
if ((-1
|
6644
|
|
|
|
|
|
|
(-1
|
6645
|
0
|
|
|
|
|
|
$result_string=~s/^\s*\]\[\[\s*//s;
|
6646
|
0
|
|
|
|
|
|
$result_string=~s/\s*\]\]\[\s*$//s;
|
6647
|
0
|
|
|
|
|
|
my @elems=split /\s*\]\|\[\s*/,$result_string;
|
6648
|
0
|
|
|
|
|
|
foreach my $elem (@elems) {
|
6649
|
0
|
0
|
|
|
|
|
if (unpack('a5',$elem) eq 'eval ') {
|
6650
|
0
|
|
|
|
|
|
$elem=unpack('x5 a*',$elem);
|
6651
|
0
|
|
|
|
|
|
push @{$result_array}, eval $elem;
|
|
0
|
|
|
|
|
|
|
6652
|
|
|
|
|
|
|
} else {
|
6653
|
0
|
|
|
|
|
|
push @{$result_array}, $elem;
|
|
0
|
|
|
|
|
|
|
6654
|
|
|
|
|
|
|
}
|
6655
|
|
|
|
|
|
|
}
|
6656
|
0
|
|
|
|
|
|
} return [ $result_string ];
|
6657
|
|
|
|
|
|
|
|
6658
|
|
|
|
|
|
|
}
|
6659
|
|
|
|
|
|
|
|
6660
|
|
|
|
|
|
|
sub escape_quotes {
|
6661
|
|
|
|
|
|
|
|
6662
|
0
|
|
|
0
|
0
|
|
my $sub=$_[0];
|
6663
|
0
|
0
|
|
|
|
|
return $sub if -1==index $sub,'"';
|
6664
|
0
|
|
|
|
|
|
my $routine=substr($sub,0,(index $sub,'(')+1);
|
6665
|
0
|
|
|
|
|
|
my $args=substr($sub,(index $sub,'(')+1,-1);
|
6666
|
0
|
|
|
|
|
|
$args=~s/[']/!%!'%!%/g;
|
6667
|
0
|
|
|
|
|
|
$args=~s/^\s*(["]|!%!)//;$args=~s/(["]|%!%)\s*$//;
|
|
0
|
|
|
|
|
|
|
6668
|
0
|
|
|
|
|
|
my @args=split /(?:["]|%!%)\s*,\s*(?:["]|!%!)/, $args;
|
6669
|
0
|
|
|
|
|
|
my @newargs=();
|
6670
|
0
|
|
|
|
|
|
foreach my $arg (@args) {
|
6671
|
0
|
|
|
|
|
|
$arg=~s/(!%!|%!%)//g;
|
6672
|
0
|
0
|
|
|
|
|
if ($arg=~/^[']/) {
|
6673
|
0
|
|
|
|
|
|
push @newargs, $arg;
|
6674
|
|
|
|
|
|
|
} else {
|
6675
|
0
|
|
|
|
|
|
$arg=~s/["]/\\"/g;
|
6676
|
0
|
|
|
|
|
|
push @newargs, '"'.$arg.'"';
|
6677
|
|
|
|
|
|
|
}
|
6678
|
|
|
|
|
|
|
}
|
6679
|
0
|
|
|
|
|
|
$sub=$routine;
|
6680
|
0
|
|
|
|
|
|
foreach my $arg (@newargs) {
|
6681
|
0
|
|
|
|
|
|
$sub.=$arg.",";
|
6682
|
|
|
|
|
|
|
}
|
6683
|
0
|
|
|
|
|
|
chop $sub;
|
6684
|
0
|
|
|
|
|
|
$sub.=')';
|
6685
|
0
|
|
|
|
|
|
return $sub;
|
6686
|
|
|
|
|
|
|
|
6687
|
|
|
|
|
|
|
}
|
6688
|
|
|
|
|
|
|
|
6689
|
|
|
|
|
|
|
1;
|
6690
|
|
|
|
|
|
|
|
6691
|
|
|
|
|
|
|
package TMMemHandle;
|
6692
|
|
|
|
|
|
|
|
6693
|
1
|
|
|
1
|
|
16
|
use strict;
|
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
266
|
|
6694
|
|
|
|
|
|
|
sub TIEHANDLE {
|
6695
|
0
|
|
|
0
|
|
|
my $class = shift;
|
6696
|
0
|
|
|
|
|
|
bless [], $class;
|
6697
|
|
|
|
|
|
|
}
|
6698
|
|
|
|
|
|
|
|
6699
|
|
|
|
|
|
|
sub PRINT {
|
6700
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6701
|
0
|
|
|
|
|
|
push @$self, join '', @_;
|
6702
|
|
|
|
|
|
|
}
|
6703
|
|
|
|
|
|
|
|
6704
|
|
|
|
|
|
|
sub PRINTF {
|
6705
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6706
|
0
|
|
|
|
|
|
my $fmt = shift;
|
6707
|
0
|
|
|
|
|
|
push @$self, sprintf $fmt, @_;
|
6708
|
|
|
|
|
|
|
}
|
6709
|
|
|
|
|
|
|
|
6710
|
|
|
|
|
|
|
sub READLINE {
|
6711
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6712
|
0
|
|
|
|
|
|
shift @$self;
|
6713
|
|
|
|
|
|
|
}
|
6714
|
|
|
|
|
|
|
|
6715
|
|
|
|
|
|
|
1;
|
6716
|
|
|
|
|
|
|
|
6717
|
|
|
|
|
|
|
__END__;
|