line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Term::Menus;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Menus.pm
|
4
|
|
|
|
|
|
|
#
|
5
|
|
|
|
|
|
|
# Copyright (C) 2000-2023
|
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.026';
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
2052
|
use 5.006;
|
|
1
|
|
|
|
|
8
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $menu_return_debug=0;
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
26
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
641
|
|
27
|
|
|
|
|
|
|
## Module export.
|
28
|
|
|
|
|
|
|
require Exporter;
|
29
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
30
|
1
|
|
|
|
|
6455
|
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
|
|
7
|
use Config ();
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
322
|
1
|
|
|
1
|
|
4
|
use Cwd 'abs_path';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
323
|
1
|
|
|
1
|
|
617
|
use Capture::Tiny;
|
|
1
|
|
|
|
|
30200
|
|
|
1
|
|
|
|
|
264
|
|
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
|
|
7
|
};
|
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
|
|
|
|
|
670
|
};
|
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
|
|
|
|
|
1064
|
|
410
|
1
|
50
|
|
|
|
56612
|
unless ($@) {
|
411
|
1
|
|
|
|
|
6
|
$data_dump_streamer=1;
|
412
|
1
|
|
|
|
|
11
|
import Data::Dump::Streamer;
|
413
|
|
|
|
|
|
|
}
|
414
|
1
|
50
|
|
|
|
95
|
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
|
|
|
|
|
2
|
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
|
|
|
|
|
5
|
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
|
|
|
|
|
4
|
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
|
|
|
|
|
5
|
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
|
|
|
|
|
1
|
our $fullauto=0;$new_user_flag=1;
|
|
1
|
|
|
|
|
2
|
|
493
|
1
|
50
|
33
|
|
|
261
|
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
|
|
8
|
no strict 'subs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
92
|
|
|
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
|
|
|
52
|
$Term::Menus::facall||='' };
|
525
|
1
|
|
|
|
|
15
|
use if (-1
|
526
|
1
|
|
|
1
|
|
734
|
"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
|
|
1359
|
no strict 'subs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2239
|
|
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
|
|
8
|
no strict 'subs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
878
|
|
1003
|
|
|
|
|
|
|
my ($termwidth,$termheight)=('','');
|
1004
|
|
|
|
|
|
|
my ($stdout_capture,$stderr_capture)=
|
1005
|
|
|
|
|
|
|
Capture::Tiny::capture {
|
1006
|
|
|
|
|
|
|
($termwidth, $termheight) =
|
1007
|
|
|
|
|
|
|
Term::ReadKey::GetTerminalSize();
|
1008
|
|
|
|
|
|
|
$termwidth||='';$termheight||='';
|
1009
|
|
|
|
|
|
|
}; return $termwidth,$termheight;
|
1010
|
|
|
|
|
|
|
};
|
1011
|
|
|
|
|
|
|
if ($@) {
|
1012
|
|
|
|
|
|
|
$termwidth='';$termheight='';
|
1013
|
|
|
|
|
|
|
}
|
1014
|
|
|
|
|
|
|
} else {
|
1015
|
|
|
|
|
|
|
$termwidth='';$termheight='';
|
1016
|
|
|
|
|
|
|
}
|
1017
|
|
|
|
|
|
|
if ($termwidth) {
|
1018
|
|
|
|
|
|
|
eval { require Term::RawInput };
|
1019
|
|
|
|
|
|
|
unless ($@) {
|
1020
|
|
|
|
|
|
|
$term_input=1;
|
1021
|
|
|
|
|
|
|
import Term::RawInput;
|
1022
|
|
|
|
|
|
|
}
|
1023
|
|
|
|
|
|
|
}
|
1024
|
|
|
|
|
|
|
eval { require PadWalker };
|
1025
|
|
|
|
|
|
|
unless ($@) {
|
1026
|
|
|
|
|
|
|
$padwalker=1;
|
1027
|
|
|
|
|
|
|
import PadWalker;
|
1028
|
|
|
|
|
|
|
}
|
1029
|
|
|
|
|
|
|
eval { require Devel::Symdump };
|
1030
|
|
|
|
|
|
|
unless ($@) {
|
1031
|
|
|
|
|
|
|
#$devel_symdump=1;
|
1032
|
|
|
|
|
|
|
import Devel::Symdump;
|
1033
|
|
|
|
|
|
|
}
|
1034
|
|
|
|
|
|
|
our $clearpath='';
|
1035
|
|
|
|
|
|
|
if ($^O ne 'MSWin32' && $^O ne 'MSWin64') {
|
1036
|
|
|
|
|
|
|
if (-e '/usr/bin/clear') {
|
1037
|
|
|
|
|
|
|
$clearpath='/usr/bin/';
|
1038
|
|
|
|
|
|
|
} elsif (-e '/bin/clear') {
|
1039
|
|
|
|
|
|
|
$clearpath='/bin/';
|
1040
|
|
|
|
|
|
|
} elsif (-e '/usr/local/bin/clear') {
|
1041
|
|
|
|
|
|
|
$clearpath='/usr/local/bin/';
|
1042
|
|
|
|
|
|
|
}
|
1043
|
|
|
|
|
|
|
}
|
1044
|
|
|
|
|
|
|
|
1045
|
|
|
|
|
|
|
our %LookUpMenuName=();
|
1046
|
|
|
|
|
|
|
our $MenuMap=[];
|
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
our $noclear=1; # set to one to turn off clear for debugging
|
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
sub check_for_dupe_menus {
|
1051
|
|
|
|
|
|
|
|
1052
|
0
|
|
|
0
|
0
|
|
my $m_flag=0;
|
1053
|
0
|
|
|
|
|
|
my $s_flag=0;
|
1054
|
0
|
|
|
|
|
|
foreach my $dir (@INC) {
|
1055
|
0
|
0
|
0
|
|
|
|
if (!$m_flag && -f "$dir/$Term::Menus::fa_menu") {
|
1056
|
0
|
|
|
|
|
|
$m_flag=1;
|
1057
|
0
|
|
|
|
|
|
open(FH,"<$dir/$Term::Menus::fa_menu");
|
1058
|
0
|
|
|
|
|
|
my $line='';my %menudups=();
|
|
0
|
|
|
|
|
|
|
1059
|
0
|
|
|
|
|
|
while ($line=) {
|
1060
|
0
|
0
|
|
|
|
|
if ($line=~/^[ \t]*\%(.*)\s*=/) {
|
1061
|
0
|
0
|
|
|
|
|
if (!exists $menudups{$1}) {
|
1062
|
0
|
|
|
|
|
|
$menudups{$1}='';
|
1063
|
|
|
|
|
|
|
} else {
|
1064
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;my $die='';
|
|
0
|
|
|
|
|
|
|
1065
|
0
|
|
|
|
|
|
$die="\n FATAL ERROR! - Duplicate Hash Blocks:"
|
1066
|
|
|
|
|
|
|
."\n -> \"%$1\" is defined more than once\n"
|
1067
|
|
|
|
|
|
|
." in the $dir/$mcmf file.\n\n"
|
1068
|
|
|
|
|
|
|
." Hint: delete or comment-out all duplicates\n\n";
|
1069
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1070
|
0
|
0
|
|
|
|
|
print $die if !$Net::FullAuto::FA_Core::cron;
|
1071
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die,'__cleanup__');
|
1072
|
0
|
|
|
|
|
|
} else { die $die }
|
1073
|
|
|
|
|
|
|
}
|
1074
|
|
|
|
|
|
|
}
|
1075
|
|
|
|
|
|
|
}
|
1076
|
|
|
|
|
|
|
}
|
1077
|
0
|
0
|
0
|
|
|
|
if (!$s_flag && -f "$dir/$Term::Menus::fa_code") {
|
1078
|
0
|
|
|
|
|
|
$s_flag=1;
|
1079
|
0
|
|
|
|
|
|
open(FH,"<$dir/$Term::Menus::fa_code");
|
1080
|
0
|
|
|
|
|
|
my $line='';my %dups=();
|
|
0
|
|
|
|
|
|
|
1081
|
0
|
|
|
|
|
|
while ($line=) {
|
1082
|
0
|
0
|
|
|
|
|
if ($line=~/^[ \t]*\%(.*)\s*=/) {
|
1083
|
0
|
0
|
|
|
|
|
if (!exists $dups{$1}) {
|
1084
|
0
|
|
|
|
|
|
$dups{$1}='';
|
1085
|
|
|
|
|
|
|
} else {
|
1086
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - Duplicate Hash Blocks:"
|
1087
|
|
|
|
|
|
|
."\n -> \"%$1\" is defined more "
|
1088
|
|
|
|
|
|
|
."than once\n in the $dir/"
|
1089
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
1090
|
|
|
|
|
|
|
." file.\n\n Hint: delete "
|
1091
|
|
|
|
|
|
|
."or comment-out all duplicates\n\n";
|
1092
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1093
|
0
|
0
|
|
|
|
|
print $die if !$Net::FullAuto::FA_Core::cron;
|
1094
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die,'__cleanup__');
|
1095
|
0
|
|
|
|
|
|
} else { die $die }
|
1096
|
|
|
|
|
|
|
}
|
1097
|
|
|
|
|
|
|
}
|
1098
|
|
|
|
|
|
|
}
|
1099
|
|
|
|
|
|
|
}
|
1100
|
|
|
|
|
|
|
}
|
1101
|
|
|
|
|
|
|
|
1102
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1103
|
0
|
|
|
|
|
|
foreach my $symname (keys %Term::Menus::) {
|
1104
|
0
|
0
|
|
|
|
|
if (eval "\\%$symname") {
|
1105
|
0
|
|
|
|
|
|
my $hashref=eval "\\%$symname";
|
1106
|
0
|
|
|
|
|
|
HF: foreach my $key (keys %{$hashref}) {
|
|
0
|
|
|
|
|
|
|
1107
|
0
|
0
|
|
|
|
|
if (ref $hashref->{$key} eq 'HASH') {
|
1108
|
0
|
|
|
|
|
|
foreach my $ky (keys %{$hashref->{$key}}) {
|
|
0
|
|
|
|
|
|
|
1109
|
0
|
0
|
|
|
|
|
if (lc($ky) eq 'text') {
|
1110
|
0
|
|
|
|
|
|
$LookUpMenuName{$hashref}=$symname;
|
1111
|
0
|
|
|
|
|
|
last HF;
|
1112
|
|
|
|
|
|
|
}
|
1113
|
|
|
|
|
|
|
}
|
1114
|
|
|
|
|
|
|
}
|
1115
|
|
|
|
|
|
|
}
|
1116
|
|
|
|
|
|
|
}
|
1117
|
|
|
|
|
|
|
}
|
1118
|
|
|
|
|
|
|
}
|
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
}
|
1121
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
&check_for_dupe_menus() if defined $main::fa_menu
|
1123
|
|
|
|
|
|
|
&& $main::fa_menu;
|
1124
|
|
|
|
|
|
|
|
1125
|
|
|
|
|
|
|
{
|
1126
|
1
|
|
|
1
|
|
593
|
use Sys::Hostname;
|
|
1
|
|
|
|
|
1074
|
|
|
1
|
|
|
|
|
653
|
|
1127
|
|
|
|
|
|
|
our $local_hostname=&Sys::Hostname::hostname();
|
1128
|
|
|
|
|
|
|
}
|
1129
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
my $count=0;
|
1131
|
|
|
|
|
|
|
our $blanklines='';
|
1132
|
|
|
|
|
|
|
if ($Term::Menus::termheight) {
|
1133
|
|
|
|
|
|
|
$count=$Term::Menus::termheight;
|
1134
|
|
|
|
|
|
|
} else { $count=30 }
|
1135
|
|
|
|
|
|
|
while ($count--) { $blanklines.="\n" }
|
1136
|
|
|
|
|
|
|
our $parent_menu='';
|
1137
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
sub fa_login
|
1139
|
|
|
|
|
|
|
{
|
1140
|
0
|
|
|
0
|
0
|
|
my $code='';my $menu_args='';my $to='';my $die='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1141
|
0
|
|
|
|
|
|
my $start_menu_ref='';my $cache='';
|
|
0
|
|
|
|
|
|
|
1142
|
0
|
|
|
|
|
|
my $returned='';
|
1143
|
0
|
|
|
|
|
|
eval {
|
1144
|
0
|
|
|
|
|
|
($code,$menu_args,$to,$cache)=
|
1145
|
|
|
|
|
|
|
&Net::FullAuto::FA_Core::fa_login(@_);
|
1146
|
0
|
0
|
|
|
|
|
$main::cache=$cache if $cache;
|
1147
|
0
|
0
|
|
|
|
|
undef $main::cache unless $cache;
|
1148
|
0
|
|
|
|
|
|
my $mc=substr($Term::Menus::fa_menu,
|
1149
|
|
|
|
|
|
|
(rindex $Term::Menus::fa_menu,'/')+1,-3);
|
1150
|
0
|
|
|
|
|
|
$start_menu_ref=eval '$'.$mc.'::start_menu_ref';
|
1151
|
0
|
|
0
|
|
|
|
$to||=0;
|
1152
|
0
|
0
|
|
|
|
|
$timeout=$to if $to;
|
1153
|
0
|
0
|
|
|
|
|
if ($code) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1154
|
0
|
|
|
|
|
|
&run_sub($code,$menu_args);
|
1155
|
|
|
|
|
|
|
} elsif (ref $start_menu_ref eq 'HASH') {
|
1156
|
0
|
0
|
|
|
|
|
unless (keys %LookUpMenuName) {
|
1157
|
0
|
|
|
|
|
|
&check_for_dupe_menus();
|
1158
|
|
|
|
|
|
|
}
|
1159
|
0
|
0
|
|
|
|
|
if ($Net::FullAuto::FA_Core::plan) {
|
1160
|
0
|
|
|
|
|
|
my $plann=shift @{$Net::FullAuto::FA_Core::plan};
|
|
0
|
|
|
|
|
|
|
1161
|
0
|
|
|
|
|
|
my $return=eval $plann->{Item};
|
1162
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@,'-1') if $@;
|
1163
|
0
|
|
|
|
|
|
return $return;
|
1164
|
|
|
|
|
|
|
}
|
1165
|
0
|
|
|
|
|
|
$returned=&Menu($start_menu_ref);
|
1166
|
|
|
|
|
|
|
} elsif ($start_menu_ref) {
|
1167
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;
|
1168
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The top level menu "
|
1169
|
|
|
|
|
|
|
."block indicated\n by the "
|
1170
|
|
|
|
|
|
|
."\$start_menu_ref variable in the\n "
|
1171
|
|
|
|
|
|
|
." $mcmf file, does not exist as"
|
1172
|
|
|
|
|
|
|
."\n a properly constructed and"
|
1173
|
|
|
|
|
|
|
."\\or named hash\n block in the"
|
1174
|
|
|
|
|
|
|
." ".__PACKAGE__.".pm file\n\n Hint: "
|
1175
|
|
|
|
|
|
|
."our \$start_menu_ref=\\%Menu_1\;\n\n "
|
1176
|
|
|
|
|
|
|
."\[ Menu_1 is example - name you choose is"
|
1177
|
|
|
|
|
|
|
." optional \]\n\n %Menu_1=\(\n"
|
1178
|
|
|
|
|
|
|
." Item_1 => { ... },\n "
|
1179
|
|
|
|
|
|
|
."...\n \)\;\n";
|
1180
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1181
|
|
|
|
|
|
|
} else {
|
1182
|
0
|
|
|
|
|
|
my $mcmf=$Term::Menus::fa_menu;
|
1183
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The \$start_menu_ref\n"
|
1184
|
|
|
|
|
|
|
." variable in the $mcmf\n"
|
1185
|
|
|
|
|
|
|
." file, is not defined or properly"
|
1186
|
|
|
|
|
|
|
."\n initialized with the name of "
|
1187
|
|
|
|
|
|
|
."the\n menu hash block designated"
|
1188
|
|
|
|
|
|
|
." for the\n top level menu.\n\n"
|
1189
|
|
|
|
|
|
|
." Hint: our \$start_menu_ref"
|
1190
|
|
|
|
|
|
|
."=\\%Menu_1\;\n\n \[ Menu_1 is example - "
|
1191
|
|
|
|
|
|
|
."name you choose is optional \]\n\n "
|
1192
|
|
|
|
|
|
|
."%Menu_1=\(\n Item_1 => { ... },\n"
|
1193
|
|
|
|
|
|
|
." ...\n \)\;\n";
|
1194
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1195
|
|
|
|
|
|
|
}
|
1196
|
|
|
|
|
|
|
};
|
1197
|
0
|
0
|
|
|
|
|
if ($@) {
|
1198
|
0
|
|
|
|
|
|
my $cmdlin=52;
|
1199
|
0
|
0
|
|
|
|
|
$cmdlin=47 if $code;
|
1200
|
0
|
|
|
|
|
|
my $errr=$@;
|
1201
|
0
|
|
|
|
|
|
$errr=~s/^\s*/\n /s;
|
1202
|
0
|
|
|
|
|
|
print $errr;
|
1203
|
|
|
|
|
|
|
}
|
1204
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::cleanup(0,$returned);
|
1205
|
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
|
}
|
1207
|
|
|
|
|
|
|
|
1208
|
|
|
|
|
|
|
sub run_sub
|
1209
|
|
|
|
|
|
|
{
|
1210
|
1
|
|
|
1
|
|
8
|
use if $Term::Menus::fullauto, "IO::Handle";
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
1211
|
1
|
|
|
1
|
|
45
|
use if $Term::Menus::fullauto, POSIX => qw(setsid);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
1212
|
|
|
|
|
|
|
|
1213
|
0
|
0
|
0
|
0
|
0
|
|
if ($Term::Menus::fullauto && defined $Net::FullAuto::FA_Core::service
|
|
|
|
0
|
|
|
|
|
1214
|
|
|
|
|
|
|
&& $Net::FullAuto::FA_Core::service) {
|
1215
|
0
|
|
|
|
|
|
print "\n\n ##### TRANSITIONING TO SERVICE ######".
|
1216
|
|
|
|
|
|
|
"\n\n FullAuto will now continue running as".
|
1217
|
|
|
|
|
|
|
"\n as a Service/Daemon. Now exiting".
|
1218
|
|
|
|
|
|
|
"\n interactive mode ...\n\n";
|
1219
|
0
|
0
|
|
|
|
|
chdir '/' or die "Can't chdir to /: $!";
|
1220
|
0
|
|
|
|
|
|
umask 0;
|
1221
|
0
|
0
|
|
|
|
|
open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
|
1222
|
0
|
0
|
|
|
|
|
open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
|
1223
|
0
|
0
|
|
|
|
|
open STDERR, '>/dev/null' or die "Can't write to /dev/null: $!";
|
1224
|
0
|
0
|
|
|
|
|
defined(my $pid = fork) or die "Can't fork: $!";
|
1225
|
0
|
0
|
|
|
|
|
exit if $pid;
|
1226
|
0
|
0
|
|
|
|
|
$pid = &setsid or die "Can't start a new session: $!";
|
1227
|
|
|
|
|
|
|
}
|
1228
|
|
|
|
|
|
|
|
1229
|
0
|
|
|
|
|
|
my $code=$_[0];
|
1230
|
0
|
|
|
|
|
|
$code=~s/^[&]//;
|
1231
|
0
|
0
|
|
|
|
|
my $menu_args= (defined $_[1]) ? $_[1] : '';
|
1232
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3).'::'
|
1233
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
1234
|
0
|
|
0
|
|
|
|
$subfile||='';
|
1235
|
0
|
|
|
|
|
|
my $return=
|
1236
|
|
|
|
|
|
|
eval "\&$subfile$code\(\@{\$menu_args}\)";
|
1237
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@,'-1') if $@;
|
1238
|
0
|
|
|
|
|
|
return $return;
|
1239
|
|
|
|
|
|
|
}
|
1240
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
sub get_all_hosts
|
1242
|
|
|
|
|
|
|
{
|
1243
|
0
|
|
|
0
|
0
|
|
return Net::FullAuto::FA_Core::get_all_hosts(@_);
|
1244
|
|
|
|
|
|
|
}
|
1245
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
sub get_Menu_map_count
|
1247
|
|
|
|
|
|
|
{
|
1248
|
0
|
|
|
0
|
0
|
|
my $map_count=0;$count=0;
|
|
0
|
|
|
|
|
|
|
1249
|
0
|
|
|
|
|
|
foreach my $map (@{$_[0]}) {
|
|
0
|
|
|
|
|
|
|
1250
|
0
|
|
|
|
|
|
$count=$map->[0];
|
1251
|
0
|
0
|
|
|
|
|
$map_count=$count if $map_count<$count;
|
1252
|
|
|
|
|
|
|
}
|
1253
|
0
|
|
|
|
|
|
return $map_count;
|
1254
|
|
|
|
|
|
|
}
|
1255
|
|
|
|
|
|
|
|
1256
|
|
|
|
|
|
|
sub get_Menu_map
|
1257
|
|
|
|
|
|
|
{
|
1258
|
0
|
|
|
0
|
1
|
|
my %tmphash=();my @menu_picks=();
|
|
0
|
|
|
|
|
|
|
1259
|
0
|
|
|
|
|
|
foreach my $map (@{$MenuMap}) {
|
|
0
|
|
|
|
|
|
|
1260
|
0
|
|
|
|
|
|
$tmphash{$map->[0]}=$map->[1];
|
1261
|
|
|
|
|
|
|
}
|
1262
|
0
|
|
|
|
|
|
foreach my $number (sort numerically keys %tmphash) {
|
1263
|
0
|
|
|
|
|
|
push @menu_picks, $tmphash{$number};
|
1264
|
|
|
|
|
|
|
}
|
1265
|
0
|
|
|
|
|
|
return @menu_picks;
|
1266
|
|
|
|
|
|
|
}
|
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
sub eval_error
|
1269
|
|
|
|
|
|
|
{
|
1270
|
|
|
|
|
|
|
|
1271
|
0
|
|
0
|
0
|
0
|
|
my $log_handle=$_[1]||'';
|
1272
|
0
|
0
|
0
|
|
|
|
if (10
|
1273
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1274
|
|
|
|
|
|
|
-1
|
1275
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1276
|
0
|
|
|
|
|
|
close($log_handle);
|
1277
|
|
|
|
|
|
|
}
|
1278
|
0
|
|
|
|
|
|
die $_[0];
|
1279
|
|
|
|
|
|
|
} else {
|
1280
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
1281
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
1282
|
|
|
|
|
|
|
."Conveyed\n"
|
1283
|
|
|
|
|
|
|
." the Following "
|
1284
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
1285
|
|
|
|
|
|
|
." $_[0]\n line ".__LINE__;
|
1286
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1287
|
|
|
|
|
|
|
-1
|
1288
|
0
|
|
|
|
|
|
print $log_handle $die;
|
1289
|
0
|
|
|
|
|
|
close($log_handle);
|
1290
|
|
|
|
|
|
|
}
|
1291
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1292
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1293
|
0
|
|
|
|
|
|
} else { die $die }
|
1294
|
|
|
|
|
|
|
}
|
1295
|
|
|
|
|
|
|
}
|
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
sub banner
|
1298
|
|
|
|
|
|
|
{
|
1299
|
|
|
|
|
|
|
|
1300
|
0
|
|
0
|
0
|
0
|
|
my $banner=$_[0]||'';
|
1301
|
0
|
0
|
|
|
|
|
return '' unless $banner;
|
1302
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||{};
|
1303
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[2]||'';
|
1304
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[3]||'';
|
1305
|
0
|
0
|
|
|
|
|
my $numbor=(defined $_[4])?$_[4]:'';
|
1306
|
0
|
|
0
|
|
|
|
my $ikey=$_[5]||'';
|
1307
|
0
|
|
0
|
|
|
|
my $input=$_[6]||{};
|
1308
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[7]||{};
|
1309
|
0
|
|
0
|
|
|
|
my $log_handle=$_[8]||'';
|
1310
|
0
|
|
0
|
|
|
|
$banner||='';
|
1311
|
0
|
0
|
0
|
|
|
|
if (ref $banner eq 'CODE') {
|
|
|
0
|
|
|
|
|
|
1312
|
0
|
|
|
|
|
|
my $banner_code=$banner;
|
1313
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
1314
|
0
|
|
|
|
|
|
$banner_code=
|
1315
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($banner_code)->Out();
|
1316
|
0
|
|
|
|
|
|
$banner_code=&transform_pmsi($banner_code,
|
1317
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1318
|
|
|
|
|
|
|
}
|
1319
|
|
|
|
|
|
|
#print "WHAT IS CDNOW2=$banner_code<==\n";;
|
1320
|
0
|
|
|
|
|
|
$banner_code=~s/\$CODE\d*\s*=\s*//s;
|
1321
|
|
|
|
|
|
|
#print "WHAT IS CDREALLYNOW=$banner_code<==\n";;
|
1322
|
0
|
|
|
|
|
|
my $eval_banner_code=eval $banner_code;
|
1323
|
0
|
|
0
|
0
|
|
|
$eval_banner_code||=sub {};
|
1324
|
0
|
|
|
|
|
|
my $die="\n"
|
1325
|
|
|
|
|
|
|
." FATAL ERROR! - Error in Banner => sub{ *CONTENT* },\n"
|
1326
|
|
|
|
|
|
|
." code block. To find error, copy the\n"
|
1327
|
|
|
|
|
|
|
." *CONTENT* to a separate script, and\n"
|
1328
|
|
|
|
|
|
|
." test for the error there. Use the\n"
|
1329
|
|
|
|
|
|
|
." 'use strict;' pragma.\n\n";
|
1330
|
0
|
|
|
|
|
|
eval {
|
1331
|
0
|
|
|
|
|
|
$banner=$eval_banner_code->();
|
1332
|
|
|
|
|
|
|
};
|
1333
|
0
|
0
|
|
|
|
|
if ($@) {
|
1334
|
0
|
0
|
0
|
|
|
|
if (10
|
1335
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1336
|
0
|
|
|
|
|
|
return '',$@
|
1337
|
|
|
|
|
|
|
}
|
1338
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1339
|
|
|
|
|
|
|
-1
|
1340
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1341
|
0
|
|
|
|
|
|
close($log_handle);
|
1342
|
|
|
|
|
|
|
}
|
1343
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1344
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
1345
|
0
|
|
|
|
|
|
} else { die $@ }
|
1346
|
|
|
|
|
|
|
} else {
|
1347
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1348
|
0
|
|
|
|
|
|
return '',$die.' '.$@
|
1349
|
|
|
|
|
|
|
}
|
1350
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1351
|
|
|
|
|
|
|
-1
|
1352
|
0
|
|
|
|
|
|
print $log_handle $die.' '.$@;
|
1353
|
0
|
|
|
|
|
|
close($log_handle);
|
1354
|
|
|
|
|
|
|
}
|
1355
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1356
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
1357
|
|
|
|
|
|
|
$die.' '.$@);
|
1358
|
0
|
|
|
|
|
|
} else { die $die.' '.$@ }
|
1359
|
|
|
|
|
|
|
}
|
1360
|
|
|
|
|
|
|
}
|
1361
|
0
|
|
|
|
|
|
} elsif (keys %{$Conveyed} || $picks_from_parent) {
|
1362
|
0
|
|
|
|
|
|
$banner=&transform_pmsi($banner,
|
1363
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1364
|
|
|
|
|
|
|
} else {
|
1365
|
0
|
|
|
|
|
|
chomp($banner);
|
1366
|
|
|
|
|
|
|
}
|
1367
|
0
|
0
|
0
|
|
|
|
if ($banner && ($banner=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1368
|
0
|
|
|
|
|
|
&& grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) &&
|
1369
|
|
|
|
|
|
|
defined $picks_from_parent &&
|
1370
|
|
|
|
|
|
|
!ref $picks_from_parent) {
|
1371
|
0
|
|
|
|
|
|
my @banner=();
|
1372
|
0
|
0
|
|
|
|
|
if ($banner!~/::/) {
|
1373
|
0
|
|
|
|
|
|
$banner=~s/^[&]//;
|
1374
|
0
|
|
|
|
|
|
eval "\@banner=main::$banner";
|
1375
|
|
|
|
|
|
|
} else {
|
1376
|
0
|
|
|
|
|
|
eval "\@banner=$banner";
|
1377
|
|
|
|
|
|
|
}
|
1378
|
0
|
|
|
|
|
|
$banner=join '',@banner;
|
1379
|
|
|
|
|
|
|
}
|
1380
|
0
|
|
|
|
|
|
return transform_mbio(transform_mbii(transform_mbir(
|
1381
|
|
|
|
|
|
|
$banner,$Conveyed,$MenuUnit_hash_ref,
|
1382
|
|
|
|
|
|
|
$log_handle),$numbor,$ikey,$input,
|
1383
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed,$log_handle),$MenuUnit_hash_ref,
|
1384
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent,$log_handle);
|
1385
|
|
|
|
|
|
|
|
1386
|
|
|
|
|
|
|
}
|
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
sub Menu
|
1389
|
|
|
|
|
|
|
{
|
1390
|
|
|
|
|
|
|
#print "MENUCALLER=",(caller)[0]," and ",__PACKAGE__,"\n";;
|
1391
|
|
|
|
|
|
|
#print "MENUCALLER=",caller,"\n";
|
1392
|
0
|
|
|
0
|
1
|
|
my $MenuUnit_hash_ref=$_[0];
|
1393
|
|
|
|
|
|
|
#print "WHAT IS THIS=",&Data::Dump::Streamer::Dump($MenuUnit_hash_ref)->Out(),"\n";
|
1394
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name}=&pw($MenuUnit_hash_ref);
|
1395
|
0
|
|
|
|
|
|
my $select_many=0;
|
1396
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Select}) {
|
1397
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Select} &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1398
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select} &&
|
1399
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}=~/many/i) {
|
1400
|
0
|
|
|
|
|
|
$select_many='Many';
|
1401
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1402
|
|
|
|
|
|
|
} elsif (exists $MenuUnit_hash_ref->{Select} &&
|
1403
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select} &&
|
1404
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}=~/one/i) {
|
1405
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1406
|
|
|
|
|
|
|
}
|
1407
|
|
|
|
|
|
|
} else {
|
1408
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}={};
|
1409
|
|
|
|
|
|
|
}
|
1410
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[1]||'';
|
1411
|
0
|
|
|
|
|
|
my $log_handle='';
|
1412
|
0
|
0
|
0
|
|
|
|
if ($picks_from_parent && -1
|
1413
|
0
|
|
|
|
|
|
$log_handle=$picks_from_parent;
|
1414
|
0
|
|
|
|
|
|
$picks_from_parent='';
|
1415
|
|
|
|
|
|
|
}
|
1416
|
0
|
|
|
|
|
|
my $unattended=0;
|
1417
|
0
|
0
|
|
|
|
|
if ($picks_from_parent=~/\](Cron|Batch|Unattended|FullAuto)\[/i) {
|
1418
|
0
|
|
|
|
|
|
$unattended=1;
|
1419
|
0
|
|
|
|
|
|
undef $picks_from_parent;
|
1420
|
|
|
|
|
|
|
}
|
1421
|
0
|
0
|
|
|
|
|
my $recurse = (defined $_[2]) ? $_[2] : 0;
|
1422
|
0
|
0
|
|
|
|
|
my $FullMenu= (defined $_[3]) ? $_[3] : {};
|
1423
|
0
|
0
|
|
|
|
|
my $Selected= (defined $_[4]) ? $_[4] : {};
|
1424
|
0
|
0
|
|
|
|
|
my $Conveyed= (defined $_[5]) ? $_[5] : {};
|
1425
|
0
|
0
|
|
|
|
|
my $SavePick= (defined $_[6]) ? $_[6] : {};
|
1426
|
0
|
0
|
|
|
|
|
my $SaveMMap= (defined $_[7]) ? $_[7] : {};
|
1427
|
0
|
0
|
|
|
|
|
my $SaveNext= (defined $_[8]) ? $_[8] : {};
|
1428
|
0
|
0
|
|
|
|
|
my $Persists= (defined $_[9]) ? $_[9] : {};
|
1429
|
0
|
0
|
|
|
|
|
my $parent_menu= (defined $_[10]) ? $_[10] : '';
|
1430
|
0
|
|
|
|
|
|
my $no_wantarray=0;
|
1431
|
|
|
|
|
|
|
|
1432
|
0
|
0
|
0
|
|
|
|
if ((defined $_[11] && $_[11]) ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1433
|
|
|
|
|
|
|
((caller)[0] ne __PACKAGE__ && !wantarray)) {
|
1434
|
0
|
|
|
|
|
|
$no_wantarray=1;
|
1435
|
|
|
|
|
|
|
}
|
1436
|
0
|
0
|
0
|
|
|
|
if (defined $_[12] && $_[12]) {
|
1437
|
0
|
|
|
|
|
|
return '','','','','','','','','','','',$_[12];
|
1438
|
|
|
|
|
|
|
}
|
1439
|
0
|
0
|
0
|
|
|
|
if (defined $_[13] && $_[13]) {
|
1440
|
0
|
|
|
|
|
|
$log_handle=$_[13];
|
1441
|
|
|
|
|
|
|
}
|
1442
|
0
|
|
|
|
|
|
my %Items=();my %negate=();my %result=();my %convey=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1443
|
0
|
|
|
|
|
|
my %chosen=();my %default=();my %select=();my %mark=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1444
|
0
|
|
|
|
|
|
my $pick='';my $picks=[];my %num__=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1445
|
0
|
|
|
|
|
|
my $display_this_many_items=10;my $die_err='';
|
|
0
|
|
|
|
|
|
|
1446
|
0
|
|
|
|
|
|
my $master_substituted='';my $convey='';$mark{BLANK}=1;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1447
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
1448
|
0
|
|
|
|
|
|
my $num=0;my @convey=();my $filtered=0;my $sorted='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1449
|
0
|
|
|
|
|
|
foreach my $key (keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
1450
|
0
|
0
|
0
|
|
|
|
if (4
|
1451
|
0
|
|
|
|
|
|
$Items{substr($key,5)}=$MenuUnit_hash_ref->{$key};
|
1452
|
|
|
|
|
|
|
}
|
1453
|
|
|
|
|
|
|
}
|
1454
|
0
|
0
|
|
|
|
|
$Persists->{unattended}=$unattended if $unattended;
|
1455
|
|
|
|
|
|
|
my $start=($FullMenu->{$MenuUnit_hash_ref}[11])?
|
1456
|
0
|
0
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]:0;
|
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
############################################
|
1459
|
|
|
|
|
|
|
# Breakdown the MenuUnit into its Components
|
1460
|
|
|
|
|
|
|
############################################
|
1461
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
# Breakdown Each Item into its Components
|
1463
|
|
|
|
|
|
|
#########################################
|
1464
|
|
|
|
|
|
|
|
1465
|
0
|
|
|
|
|
|
my $got_item_flag=0;
|
1466
|
0
|
|
|
|
|
|
while (++$num) {
|
1467
|
0
|
|
0
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]||0;
|
1468
|
0
|
|
|
|
|
|
@convey=();
|
1469
|
0
|
0
|
|
|
|
|
unless (exists $Items{$num}) {
|
1470
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Banner} && !$got_item_flag) {
|
1471
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
1472
|
0
|
|
|
|
|
|
} else { last }
|
1473
|
|
|
|
|
|
|
} else {
|
1474
|
0
|
|
|
|
|
|
$got_item_flag=1;
|
1475
|
|
|
|
|
|
|
}
|
1476
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Negate} &&
|
1477
|
0
|
|
|
|
|
|
!(keys %{$MenuUnit_hash_ref->{Select}})) {
|
1478
|
0
|
|
|
|
|
|
my $die="Can Only Use \"Negate =>\""
|
1479
|
|
|
|
|
|
|
."\n\t\tElement in ".__PACKAGE__.".pm when the"
|
1480
|
|
|
|
|
|
|
."\n\t\t\"Select =>\" Element is set to \'Many\'\n\n";
|
1481
|
0
|
0
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die)
|
1482
|
|
|
|
|
|
|
if $Term::Menus::fullauto;
|
1483
|
0
|
|
|
|
|
|
die $die;
|
1484
|
|
|
|
|
|
|
}
|
1485
|
0
|
|
|
|
|
|
my $con_regex=qr/\]c(o+nvey)*\[/i;
|
1486
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Convey}) {
|
|
|
0
|
|
|
|
|
|
1487
|
0
|
|
|
|
|
|
my $convey_test=$Items{$num}->{Convey};
|
1488
|
0
|
0
|
0
|
|
|
|
if (ref $Items{$num}->{Convey} eq 'ARRAY') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1489
|
0
|
|
|
|
|
|
foreach my $line (@{$Items{$num}->{Convey}}) {
|
|
0
|
|
|
|
|
|
|
1490
|
0
|
|
|
|
|
|
push @convey, $line;
|
1491
|
|
|
|
|
|
|
}
|
1492
|
|
|
|
|
|
|
} elsif (ref $Items{$num}->{Convey} eq 'CODE') {
|
1493
|
0
|
|
|
|
|
|
my $convey_code=$Items{$num}->{Convey};
|
1494
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
1495
|
0
|
|
|
|
|
|
$convey_code=
|
1496
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($convey_code)->Out();
|
1497
|
|
|
|
|
|
|
#print "PICKSFROMPARENTXX=$picks_from_parent AND CONVEY_CODE=$convey_code\n";
|
1498
|
0
|
|
|
|
|
|
$convey_code=&transform_pmsi($convey_code,
|
1499
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1500
|
|
|
|
|
|
|
}
|
1501
|
|
|
|
|
|
|
#print "WHAT IS CDNOW1=$convey_code<==\n";
|
1502
|
0
|
|
|
|
|
|
$convey_code=~s/\$CODE\d*\s*=\s*//s;
|
1503
|
|
|
|
|
|
|
#print "WHAT IS CDREALLYNOW=$convey_code<==\n";;
|
1504
|
0
|
|
|
|
|
|
my $eval_convey_code=eval $convey_code;
|
1505
|
0
|
|
0
|
0
|
|
|
$eval_convey_code||=sub {};
|
1506
|
0
|
|
|
|
|
|
@convey=$eval_convey_code->();
|
1507
|
0
|
0
|
|
|
|
|
@convey=@{$convey[0]} if ref $convey[0] eq 'ARRAY';
|
|
0
|
|
|
|
|
|
|
1508
|
0
|
0
|
|
|
|
|
if ($@) {
|
1509
|
0
|
0
|
0
|
|
|
|
if (10
|
1510
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
1511
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
1512
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
1513
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
1514
|
|
|
|
|
|
|
}
|
1515
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1516
|
|
|
|
|
|
|
-1
|
1517
|
0
|
|
|
|
|
|
print $log_handle $@;
|
1518
|
0
|
|
|
|
|
|
close($log_handle);
|
1519
|
|
|
|
|
|
|
}
|
1520
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1521
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
1522
|
0
|
|
|
|
|
|
} else { die $@ }
|
1523
|
|
|
|
|
|
|
} else {
|
1524
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
1525
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
1526
|
|
|
|
|
|
|
."Conveyed\n"
|
1527
|
|
|
|
|
|
|
." the Following "
|
1528
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
1529
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
1530
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
1531
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
1532
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
1533
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
1534
|
|
|
|
|
|
|
}
|
1535
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
1536
|
|
|
|
|
|
|
-1
|
1537
|
0
|
|
|
|
|
|
print $log_handle $die;
|
1538
|
0
|
|
|
|
|
|
close($log_handle);
|
1539
|
|
|
|
|
|
|
}
|
1540
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
1541
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
1542
|
0
|
|
|
|
|
|
} else { die $die }
|
1543
|
|
|
|
|
|
|
}
|
1544
|
|
|
|
|
|
|
}
|
1545
|
0
|
0
|
0
|
|
|
|
if (0==$#convey && $convey[0]=~/^(?:[{](.*)[}])?[<]$/) {
|
1546
|
0
|
|
|
|
|
|
return \@convey;
|
1547
|
|
|
|
|
|
|
}
|
1548
|
|
|
|
|
|
|
} elsif ($convey_test=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
1549
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
1550
|
0
|
0
|
0
|
|
|
|
if (defined $picks_from_parent &&
|
1551
|
|
|
|
|
|
|
!ref $picks_from_parent) {
|
1552
|
|
|
|
|
|
|
my $transformed_convey=
|
1553
|
|
|
|
|
|
|
&transform_pmsi($Items{$num}->{Convey},
|
1554
|
0
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1555
|
|
|
|
|
|
|
$picks_from_parent);
|
1556
|
0
|
0
|
|
|
|
|
if ($transformed_convey!~/::/) {
|
1557
|
0
|
|
|
|
|
|
$transformed_convey=~s/^[&]//;
|
1558
|
0
|
|
|
|
|
|
eval "\@convey=main::$transformed_convey";
|
1559
|
|
|
|
|
|
|
} else {
|
1560
|
0
|
|
|
|
|
|
eval "\@convey=$transformed_convey";
|
1561
|
|
|
|
|
|
|
}
|
1562
|
|
|
|
|
|
|
}
|
1563
|
|
|
|
|
|
|
} else {
|
1564
|
0
|
|
|
|
|
|
push @convey, $Items{$num}->{Convey};
|
1565
|
|
|
|
|
|
|
}
|
1566
|
0
|
|
|
|
|
|
foreach my $item (@convey) {
|
1567
|
0
|
0
|
|
|
|
|
next if $item=~/^\s*$/s;
|
1568
|
0
|
|
|
|
|
|
my $text=$Items{$num}->{Text};
|
1569
|
0
|
|
|
|
|
|
$text=~s/$con_regex/$item/g;
|
1570
|
0
|
|
|
|
|
|
$text=&transform_pmsi($text,
|
1571
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1572
|
|
|
|
|
|
|
$picks_from_parent);
|
1573
|
0
|
0
|
|
|
|
|
if (-1
|
1574
|
0
|
|
|
|
|
|
$text=~
|
1575
|
|
|
|
|
|
|
s/__Master_${$}__/Local-Host: $Term::Menus::local_hostname/sg;
|
1576
|
0
|
|
|
|
|
|
$master_substituted="Local-Host: $Term::Menus::local_hostname";
|
1577
|
|
|
|
|
|
|
}
|
1578
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Include}) {
|
|
|
0
|
|
|
|
|
|
1579
|
0
|
0
|
|
|
|
|
if ($text=~/$Items{$num}->{Include}/s) {
|
1580
|
|
|
|
|
|
|
next if exists $Items{$num}->{Exclude} &&
|
1581
|
0
|
0
|
0
|
|
|
|
$text=~/$Items{$num}->{Exclude}/;
|
1582
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1583
|
|
|
|
|
|
|
} else {
|
1584
|
0
|
|
|
|
|
|
next;
|
1585
|
|
|
|
|
|
|
}
|
1586
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Exclude} &&
|
1587
|
|
|
|
|
|
|
$text=~/$Items{$num}->{Exclude}/) {
|
1588
|
0
|
|
|
|
|
|
next;
|
1589
|
|
|
|
|
|
|
} else {
|
1590
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
}
|
1592
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Convey} &&
|
|
|
0
|
|
|
|
|
|
1593
|
|
|
|
|
|
|
$Items{$num}->{Convey} ne '') {
|
1594
|
0
|
|
|
|
|
|
$convey{$text}=[$item,$Items{$num}->{Convey}];
|
1595
|
|
|
|
|
|
|
} elsif (!exists $Items{$num}->{Convey}) {
|
1596
|
0
|
|
|
|
|
|
$convey{$text}=[$item,''];
|
1597
|
|
|
|
|
|
|
}
|
1598
|
|
|
|
|
|
|
$default{$text}=$Items{$num}->{Default}
|
1599
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Default};
|
1600
|
|
|
|
|
|
|
#print "WHAT IS THIS=$text and NEGATE=",$Items{$num}->{Negate}," and KEYS=",keys %{$Items{$num}},"\n";
|
1601
|
|
|
|
|
|
|
$negate{$text}=$Items{$num}->{Negate}
|
1602
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Negate};
|
1603
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[2]{$text}) {
|
|
|
0
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
$result{$text}=
|
1605
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$text};
|
1606
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Result}) {
|
1607
|
|
|
|
|
|
|
$result{$text}=$Items{$num}->{Result}
|
1608
|
0
|
|
|
|
|
|
}
|
1609
|
0
|
|
|
|
|
|
my $tsttt=$Items{$num}->{Select};
|
1610
|
|
|
|
|
|
|
$select{$text}=$Items{$num}->{Select}
|
1611
|
|
|
|
|
|
|
if exists $Items{$num}->{Select}
|
1612
|
0
|
0
|
0
|
|
|
|
&& $tsttt=~/many/i;
|
1613
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Mark}) {
|
1614
|
0
|
|
|
|
|
|
$mark{$text}=$Items{$num}->{Mark};
|
1615
|
0
|
|
|
|
|
|
my $lmt=length $mark{$text};
|
1616
|
0
|
0
|
|
|
|
|
$mark{BLANK}=$lmt if $mark{BLANK}<$lmt;
|
1617
|
|
|
|
|
|
|
}
|
1618
|
0
|
0
|
|
|
|
|
$filtered=1 if exists $Items{$num}->{Filter};
|
1619
|
|
|
|
|
|
|
$sorted=$Items{$num}->{Sort}
|
1620
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Sort};
|
1621
|
0
|
|
|
|
|
|
$chosen{$text}="Item_$num";
|
1622
|
|
|
|
|
|
|
}
|
1623
|
|
|
|
|
|
|
} elsif ($show_banner_only) {
|
1624
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
1625
|
0
|
|
|
|
|
|
$result{'__FA_Banner__'}=$MenuUnit_hash_ref->{Result};
|
1626
|
0
|
|
|
|
|
|
} last;
|
1627
|
|
|
|
|
|
|
} else {
|
1628
|
|
|
|
|
|
|
my $text=&transform_pmsi($Items{$num}->{Text},
|
1629
|
0
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
1630
|
|
|
|
|
|
|
$picks_from_parent);
|
1631
|
0
|
0
|
|
|
|
|
if (-1{Text},"__Master_${$}__") {
|
1632
|
0
|
|
|
|
|
|
$text=~
|
1633
|
|
|
|
|
|
|
s/__Master_${$}__/Local-Host: $Term::Menus::local_hostname/sg;
|
1634
|
0
|
|
|
|
|
|
$master_substituted=
|
1635
|
|
|
|
|
|
|
"Local-Host: $Term::Menus::local_hostname";
|
1636
|
|
|
|
|
|
|
}
|
1637
|
0
|
0
|
0
|
|
|
|
if (exists $Items{$num}->{Include}) {
|
|
|
0
|
|
|
|
|
|
1638
|
0
|
0
|
|
|
|
|
if ($Items{$num}->{Text}=~/$Items{$num}->{Include}/) {
|
1639
|
|
|
|
|
|
|
next if exists $Items{$num}->{Exclude} &&
|
1640
|
0
|
0
|
0
|
|
|
|
$Items{$num}->{Text}=~/$Items{$num}->{Exclude}/;
|
1641
|
0
|
|
|
|
|
|
push @{$picks}, $text;
|
|
0
|
|
|
|
|
|
|
1642
|
0
|
|
|
|
|
|
} else { next }
|
1643
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Exclude} &&
|
1644
|
|
|
|
|
|
|
$Items{$num}->{Text}=~/$Items{$num}->{Exclude}/) {
|
1645
|
0
|
|
|
|
|
|
next;
|
1646
|
0
|
|
|
|
|
|
} else { push @{$picks}, $text }
|
|
0
|
|
|
|
|
|
|
1647
|
|
|
|
|
|
|
$convey{$Items{$num}->{Text}}=['',$Items{$num}->{Convey}]
|
1648
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Convey};
|
1649
|
|
|
|
|
|
|
$default{$text}=$Items{$num}->{Default}
|
1650
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Default};
|
1651
|
|
|
|
|
|
|
$negate{$text}=$Items{$num}->{Negate}
|
1652
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Negate};
|
1653
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[2]{$text}) {
|
|
|
0
|
|
|
|
|
|
1654
|
|
|
|
|
|
|
$result{$text}=
|
1655
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$text};
|
1656
|
|
|
|
|
|
|
} elsif (exists $Items{$num}->{Result}) {
|
1657
|
|
|
|
|
|
|
$result{$text}=$Items{$num}->{Result}
|
1658
|
0
|
|
|
|
|
|
}
|
1659
|
0
|
|
0
|
|
|
|
my $tsttt=$Items{$num}->{Select}||'';
|
1660
|
|
|
|
|
|
|
$select{$text}=$Items{$num}->{Select}
|
1661
|
|
|
|
|
|
|
if exists $Items{$num}->{Select}
|
1662
|
0
|
0
|
0
|
|
|
|
&& $tsttt=~/many/i;
|
1663
|
0
|
0
|
|
|
|
|
if (exists $Items{$num}->{Mark}) {
|
1664
|
0
|
|
|
|
|
|
$mark{$text}=$Items{$num}->{Mark};
|
1665
|
0
|
|
|
|
|
|
my $lmt=length $mark{$text};
|
1666
|
0
|
0
|
|
|
|
|
$mark{BLANK}=$lmt if $mark{BLANK}<$lmt;
|
1667
|
|
|
|
|
|
|
}
|
1668
|
0
|
0
|
|
|
|
|
$filtered=1 if exists $Items{$num}->{Filter};
|
1669
|
|
|
|
|
|
|
$sorted=$Items{$num}->{Sort}
|
1670
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{Sort};
|
1671
|
0
|
|
|
|
|
|
$chosen{$text}="Item_$num";
|
1672
|
|
|
|
|
|
|
$num__{$text}=$Items{$num}->{__NUM__}
|
1673
|
0
|
0
|
|
|
|
|
if exists $Items{$num}->{__NUM__};
|
1674
|
|
|
|
|
|
|
}
|
1675
|
|
|
|
|
|
|
}
|
1676
|
|
|
|
|
|
|
|
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
#########################################
|
1679
|
|
|
|
|
|
|
# End Items Breakdown
|
1680
|
|
|
|
|
|
|
|
1681
|
|
|
|
|
|
|
$display_this_many_items=$_[0]->{Display}
|
1682
|
0
|
0
|
|
|
|
|
if exists $_[0]->{Display};
|
1683
|
|
|
|
|
|
|
|
1684
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Scroll} &&
|
1685
|
|
|
|
|
|
|
ref $MenuUnit_hash_ref->{Scroll} ne 'ARRAY') {
|
1686
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}=
|
1687
|
0
|
|
|
|
|
|
[ $MenuUnit_hash_ref->{Scroll},1 ];
|
1688
|
|
|
|
|
|
|
}
|
1689
|
|
|
|
|
|
|
|
1690
|
|
|
|
|
|
|
############################################
|
1691
|
|
|
|
|
|
|
# End MenuUnit Breakdown
|
1692
|
|
|
|
|
|
|
############################################
|
1693
|
|
|
|
|
|
|
|
1694
|
0
|
0
|
|
|
|
|
%default=() if defined $FullMenu->{$MenuUnit_hash_ref}[5];
|
1695
|
0
|
0
|
|
|
|
|
my $nm_=(keys %num__)?\%num__:{};
|
1696
|
|
|
|
|
|
|
#print "MENU=",$MenuUnit_hash_ref->{Name}," and CONVEY=",keys %convey,"\n";;
|
1697
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}=[ $MenuUnit_hash_ref,
|
1698
|
|
|
|
|
|
|
\%negate,\%result,\%convey,\%chosen,\%default,
|
1699
|
|
|
|
|
|
|
\%select,\%mark,$nm_,$filtered,$picks,$start ];
|
1700
|
0
|
0
|
0
|
|
|
|
if ($select_many || keys %{$MenuUnit_hash_ref->{Select}}) {
|
|
0
|
|
|
|
|
|
|
1701
|
0
|
|
|
|
|
|
my @filtered_menu_return=();
|
1702
|
0
|
|
|
|
|
|
my $error='';
|
1703
|
|
|
|
|
|
|
($pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1704
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1705
|
|
|
|
|
|
|
@filtered_menu_return,$error)=&pick(
|
1706
|
0
|
|
0
|
|
|
|
$picks,$MenuUnit_hash_ref->{Banner}||'',
|
1707
|
|
|
|
|
|
|
$display_this_many_items,'','',
|
1708
|
|
|
|
|
|
|
$MenuUnit_hash_ref,++$recurse,
|
1709
|
|
|
|
|
|
|
$picks_from_parent,$parent_menu,
|
1710
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,$SavePick,
|
1711
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
1712
|
|
|
|
|
|
|
$no_wantarray,$sorted,
|
1713
|
|
|
|
|
|
|
$select_many);
|
1714
|
0
|
0
|
|
|
|
|
if (-1<$#filtered_menu_return) {
|
1715
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1716
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1717
|
|
|
|
|
|
|
$filtered_menu_return[0],$filtered_menu_return[1],
|
1718
|
|
|
|
|
|
|
$filtered_menu_return[2];
|
1719
|
|
|
|
|
|
|
}
|
1720
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && $master_substituted) {
|
1721
|
0
|
|
|
|
|
|
$pick=~s/$master_substituted/__Master_${$}__/sg;
|
1722
|
|
|
|
|
|
|
}
|
1723
|
0
|
0
|
0
|
|
|
|
if ($pick eq ']quit[') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1724
|
0
|
|
|
|
|
|
return ']quit['
|
1725
|
|
|
|
|
|
|
} elsif ($pick eq '-' || $pick eq '+') {
|
1726
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1727
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1728
|
|
|
|
|
|
|
} elsif ($pick=~/DONE/) {
|
1729
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1730
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1731
|
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY' && wantarray
|
1732
|
|
|
|
|
|
|
&& !$no_wantarray && 1==$recurse) {
|
1733
|
0
|
0
|
|
|
|
|
if (ref $pick->[$#{$pick}] eq 'HASH') {
|
|
0
|
|
|
|
|
|
|
1734
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1735
|
0
|
|
|
|
|
|
pop @choyce;
|
1736
|
0
|
|
|
|
|
|
pop @choyce;
|
1737
|
|
|
|
|
|
|
return @choyce
|
1738
|
0
|
|
|
|
|
|
}
|
1739
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1740
|
|
|
|
|
|
|
return @choyce
|
1741
|
0
|
|
|
|
|
|
} elsif ($pick) { return $pick }
|
|
0
|
|
|
|
|
|
|
1742
|
|
|
|
|
|
|
} else {
|
1743
|
0
|
|
|
|
|
|
my @filtered_menu_return=();
|
1744
|
0
|
|
|
|
|
|
my $error='';
|
1745
|
|
|
|
|
|
|
($pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1746
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1747
|
|
|
|
|
|
|
@filtered_menu_return,$error)
|
1748
|
0
|
|
0
|
|
|
|
=&pick($picks,$MenuUnit_hash_ref->{Banner}||'',
|
1749
|
|
|
|
|
|
|
$display_this_many_items,
|
1750
|
|
|
|
|
|
|
'','',$MenuUnit_hash_ref,++$recurse,
|
1751
|
|
|
|
|
|
|
$picks_from_parent,$parent_menu,
|
1752
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,$SavePick,
|
1753
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
1754
|
|
|
|
|
|
|
$no_wantarray,$sorted,
|
1755
|
|
|
|
|
|
|
$select_many);
|
1756
|
0
|
0
|
|
|
|
|
if (-1<$#filtered_menu_return) {
|
1757
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,$SavePick,
|
1758
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$parent_menu,
|
1759
|
|
|
|
|
|
|
$filtered_menu_return[0],$filtered_menu_return[1],
|
1760
|
|
|
|
|
|
|
$filtered_menu_return[2];
|
1761
|
|
|
|
|
|
|
}
|
1762
|
|
|
|
|
|
|
#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";
|
1763
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && $master_substituted) {
|
1764
|
0
|
|
|
|
|
|
$pick=~s/$master_substituted/__Master_${$}__/sg;
|
1765
|
|
|
|
|
|
|
}
|
1766
|
0
|
0
|
0
|
|
|
|
if ($pick eq ']quit[') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1767
|
0
|
|
|
|
|
|
return ']quit['
|
1768
|
|
|
|
|
|
|
} elsif ($pick eq '-' || $pick eq '+') {
|
1769
|
0
|
0
|
|
|
|
|
unless (keys %{$SavePick->{$MenuUnit_hash_ref}}) {
|
|
0
|
0
|
|
|
|
|
|
1770
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1771
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1772
|
0
|
0
|
|
|
|
|
} elsif ($select_many || keys %{$Selected->{$MenuUnit_hash_ref}}) {
|
|
0
|
|
|
|
|
|
|
1773
|
0
|
|
|
|
|
|
return '+',$FullMenu,$Selected,$Conveyed,
|
1774
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1775
|
|
|
|
|
|
|
} else {
|
1776
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1777
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1778
|
|
|
|
|
|
|
}
|
1779
|
|
|
|
|
|
|
} elsif ($pick=~/DONE/) {
|
1780
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1781
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1782
|
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY') {
|
1783
|
0
|
|
|
|
|
|
my $topmenu='';
|
1784
|
0
|
|
|
|
|
|
my $savpick='';
|
1785
|
0
|
0
|
0
|
|
|
|
if (1==$recurse && ref $pick->[$#{$pick}] eq 'HASH') {
|
|
0
|
|
|
|
|
|
|
1786
|
0
|
|
|
|
|
|
$topmenu=pop @{$pick};
|
|
0
|
|
|
|
|
|
|
1787
|
0
|
|
|
|
|
|
$savpick=pop @{$pick};
|
|
0
|
|
|
|
|
|
|
1788
|
|
|
|
|
|
|
}
|
1789
|
0
|
0
|
0
|
|
|
|
if (wantarray && 1==$recurse) {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1790
|
0
|
|
|
|
|
|
my @choyce=@{$pick};undef @{$pick};undef $pick;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
return @choyce
|
1792
|
0
|
|
|
|
|
|
} elsif (ref $pick eq 'ARRAY' && -1<$#{$pick} &&
|
|
0
|
|
|
|
|
|
|
1793
|
|
|
|
|
|
|
$pick->[0]=~/^[{](.*)[}][<]$/) {
|
1794
|
0
|
|
|
|
|
|
return $pick,$FullMenu,$Selected,$Conveyed,
|
1795
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
1796
|
|
|
|
|
|
|
} elsif (!$picks_from_parent &&
|
1797
|
|
|
|
|
|
|
!(keys %{$MenuUnit_hash_ref->{Select}})) {
|
1798
|
0
|
0
|
0
|
|
|
|
if (ref $topmenu eq 'HASH' && (keys %{$topmenu->{Select}} &&
|
|
0
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1799
|
|
|
|
|
|
|
$topmenu->{Select} eq 'Many') || (ref $savpick eq 'HASH' &&
|
1800
|
0
|
|
|
|
|
|
exists $topmenu->{Select}->{(keys %{$savpick})[0]})) {
|
1801
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
1802
|
0
|
|
|
|
|
|
return @{$pick}
|
|
0
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
} else {
|
1804
|
0
|
|
|
|
|
|
return $pick;
|
1805
|
|
|
|
|
|
|
}
|
1806
|
0
|
|
|
|
|
|
} elsif (-1==$#{$pick} &&
|
1807
|
|
|
|
|
|
|
(ref $topmenu eq 'HASH') &&
|
1808
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$topmenu})) {
|
|
0
|
|
|
|
|
|
|
1809
|
0
|
|
|
|
|
|
return [ $topmenu ];
|
1810
|
|
|
|
|
|
|
} else {
|
1811
|
0
|
|
|
|
|
|
return $pick->[0];
|
1812
|
|
|
|
|
|
|
}
|
1813
|
|
|
|
|
|
|
} else {
|
1814
|
0
|
0
|
|
|
|
|
if ($picks_from_parent) {
|
1815
|
0
|
|
|
|
|
|
$pick->[0]=&transform_pmsi($pick->[0],
|
1816
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent);
|
1817
|
|
|
|
|
|
|
}
|
1818
|
0
|
|
|
|
|
|
return $pick
|
1819
|
|
|
|
|
|
|
}
|
1820
|
0
|
|
|
|
|
|
} elsif ($pick) { return $pick }
|
1821
|
|
|
|
|
|
|
}
|
1822
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
}
|
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
sub pw {
|
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
## pw [p]ad [w]alker
|
1828
|
|
|
|
|
|
|
#print "PWCALLER=",caller,"\n";
|
1829
|
|
|
|
|
|
|
return $_[0]->{Name} if ref $_[0] eq 'HASH'
|
1830
|
0
|
0
|
0
|
0
|
0
|
|
&& exists $_[0]->{Name};
|
1831
|
0
|
|
|
|
|
|
my @packages=();
|
1832
|
0
|
0
|
0
|
|
|
|
@packages=@{$_[1]} if defined $_[1] && $_[1];
|
|
0
|
|
|
|
|
|
|
1833
|
0
|
|
|
|
|
|
my $name='';
|
1834
|
0
|
0
|
|
|
|
|
unless (ref $_[0] eq 'HASH') {
|
1835
|
0
|
|
|
|
|
|
return '';
|
1836
|
|
|
|
|
|
|
} else {
|
1837
|
0
|
|
|
|
|
|
my $flag=1;
|
1838
|
0
|
|
|
|
|
|
my $n=0;
|
1839
|
0
|
|
|
|
|
|
WH: while (1) {
|
1840
|
|
|
|
|
|
|
{
|
1841
|
0
|
|
|
|
|
|
local $SIG{__DIE__}; # No sigdie handler
|
|
0
|
|
|
|
|
|
|
1842
|
0
|
|
|
|
|
|
eval {
|
1843
|
0
|
|
|
|
|
|
$name=PadWalker::var_name($n++,$_[0]);
|
1844
|
|
|
|
|
|
|
};
|
1845
|
0
|
0
|
|
|
|
|
if ($@) {
|
1846
|
0
|
|
|
|
|
|
undef $@;
|
1847
|
0
|
|
|
|
|
|
my $o=0;
|
1848
|
0
|
|
|
|
|
|
while (1) {
|
1849
|
0
|
|
|
|
|
|
eval {
|
1850
|
0
|
|
|
|
|
|
my $vars=PadWalker::peek_our($o++);
|
1851
|
0
|
|
|
|
|
|
foreach my $key (keys %{$vars}) {
|
|
0
|
|
|
|
|
|
|
1852
|
0
|
0
|
0
|
|
|
|
if (ref $vars->{$key} eq 'HASH' &&
|
1853
|
0
|
|
|
|
|
|
%{$_[0]} eq %{$vars->{$key}}) {
|
|
0
|
|
|
|
|
|
|
1854
|
0
|
|
|
|
|
|
$name=$key;
|
1855
|
0
|
|
|
|
|
|
last;
|
1856
|
|
|
|
|
|
|
}
|
1857
|
|
|
|
|
|
|
}
|
1858
|
|
|
|
|
|
|
};
|
1859
|
0
|
0
|
|
|
|
|
if ($@) {
|
1860
|
0
|
|
|
|
|
|
undef $@;
|
1861
|
0
|
|
|
|
|
|
my $s=0;
|
1862
|
0
|
|
|
|
|
|
unshift @packages, 'main';
|
1863
|
0
|
|
|
|
|
|
PK: foreach my $package (@packages) {
|
1864
|
0
|
|
|
|
|
|
my $obj=Devel::Symdump->rnew($package);
|
1865
|
0
|
|
|
|
|
|
foreach my $hash ($obj->hashes) {
|
1866
|
0
|
0
|
|
|
|
|
next if $hash=~/^_;
|
1867
|
0
|
0
|
|
|
|
|
next if $hash=~/^Term::Menus::/;
|
1868
|
0
|
0
|
|
|
|
|
next if $hash=~/^Config::/;
|
1869
|
0
|
0
|
|
|
|
|
next if $hash=~/^DynaLoader::/;
|
1870
|
0
|
0
|
|
|
|
|
next if $hash=~/^warnings::/;
|
1871
|
0
|
0
|
|
|
|
|
next if $hash=~/^utf8::/;
|
1872
|
0
|
0
|
|
|
|
|
next if $hash=~/^Carp::/;
|
1873
|
0
|
0
|
|
|
|
|
next if $hash=~/^fields::attr/;
|
1874
|
0
|
0
|
|
|
|
|
next if $hash=~/^Text::Balanced::/;
|
1875
|
0
|
0
|
|
|
|
|
next if $hash=~/^Data::Dump::Streamer/;
|
1876
|
0
|
0
|
|
|
|
|
next if $hash=~/^re::EXPORT_OK/;
|
1877
|
0
|
0
|
|
|
|
|
next if $hash=~/^fa_code::email_addresses/;
|
1878
|
0
|
0
|
|
|
|
|
next if $hash=~/^fa_code::email_defaults/;
|
1879
|
0
|
0
|
|
|
|
|
next if $hash=~/^PadWalker::/;
|
1880
|
0
|
0
|
|
|
|
|
next if $hash=~/^Fcntl::/;
|
1881
|
0
|
0
|
|
|
|
|
next if $hash=~/^B::Utils::/;
|
1882
|
0
|
0
|
|
|
|
|
next if $hash=~/^ExtUtils::/;
|
1883
|
0
|
0
|
|
|
|
|
next if $hash=~/^Exporter::/;
|
1884
|
0
|
0
|
|
|
|
|
next if $hash=~/^Moo::/;
|
1885
|
0
|
0
|
|
|
|
|
next if $hash=~/^overload::/;
|
1886
|
0
|
0
|
|
|
|
|
next if $hash=~/^Term::ReadKey::/;
|
1887
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::INC/;
|
1888
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::SIG/;
|
1889
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::ENV/;
|
1890
|
0
|
0
|
|
|
|
|
next if $hash=~/^main[:][^\w]*$/;
|
1891
|
0
|
0
|
|
|
|
|
next if $hash=~/^main::[@]$/;
|
1892
|
0
|
0
|
|
|
|
|
next if $hash=~/^Net::FullAuto::FA_Core::makeplan/;
|
1893
|
0
|
0
|
|
|
|
|
next if $hash=~
|
1894
|
|
|
|
|
|
|
/^Net::FullAuto::FA_Core::admin_menus/;
|
1895
|
0
|
|
|
|
|
|
my %test=eval "%$hash";
|
1896
|
0
|
0
|
|
|
|
|
$name=$hash if %test eq %{$_[0]};
|
|
0
|
|
|
|
|
|
|
1897
|
0
|
0
|
|
|
|
|
last PK if $name;
|
1898
|
|
|
|
|
|
|
}
|
1899
|
|
|
|
|
|
|
}
|
1900
|
0
|
|
0
|
|
|
|
$name||='';
|
1901
|
0
|
|
|
|
|
|
$name=~s/^.*::(.*)$/$1/;
|
1902
|
0
|
|
|
|
|
|
last WH;
|
1903
|
|
|
|
|
|
|
}
|
1904
|
0
|
0
|
|
|
|
|
last WH if $name;
|
1905
|
|
|
|
|
|
|
}
|
1906
|
|
|
|
|
|
|
}
|
1907
|
0
|
0
|
|
|
|
|
last if $name;
|
1908
|
|
|
|
|
|
|
};
|
1909
|
|
|
|
|
|
|
}
|
1910
|
0
|
|
0
|
|
|
|
$name||='';
|
1911
|
0
|
|
|
|
|
|
$name=~s/^%//;
|
1912
|
0
|
0
|
|
|
|
|
return $name if $name;
|
1913
|
|
|
|
|
|
|
}
|
1914
|
|
|
|
|
|
|
}
|
1915
|
|
|
|
|
|
|
|
1916
|
|
|
|
|
|
|
sub list_module {
|
1917
|
0
|
|
|
0
|
0
|
|
my @modules = @_;
|
1918
|
0
|
|
|
|
|
|
my @result=();
|
1919
|
1
|
|
|
1
|
|
5939
|
no strict 'refs';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54055
|
|
1920
|
0
|
|
|
|
|
|
foreach my $module (@modules) {
|
1921
|
0
|
|
|
|
|
|
$module=~s/\.pm$//;
|
1922
|
0
|
|
|
|
|
|
push @result,grep { defined &{"$module\::$_"} } keys %{"$module\::"};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
}
|
1924
|
0
|
|
|
|
|
|
return @result;
|
1925
|
|
|
|
|
|
|
}
|
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
sub test_hashref {
|
1928
|
|
|
|
|
|
|
|
1929
|
0
|
|
|
0
|
0
|
|
my $hashref_to_test=$_[0];
|
1930
|
0
|
0
|
|
|
|
|
if (ref $hashref_to_test eq 'HASH') {
|
1931
|
0
|
0
|
0
|
|
|
|
if (grep { /Item_/ } keys %{$hashref_to_test}) {
|
|
0
|
0
|
0
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
1932
|
0
|
|
|
|
|
|
return 1;
|
1933
|
|
|
|
|
|
|
} elsif (exists $hashref_to_test->{Input} &&
|
1934
|
|
|
|
|
|
|
$hashref_to_test->{Input}) {
|
1935
|
0
|
|
|
|
|
|
return 1;
|
1936
|
0
|
|
|
|
|
|
} elsif (!grep { /Item_/ } keys %{$hashref_to_test}
|
1937
|
|
|
|
|
|
|
&& grep { /Banner/ } keys %{$hashref_to_test}) {
|
1938
|
0
|
|
|
|
|
|
return 1;
|
1939
|
|
|
|
|
|
|
} else {
|
1940
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - Unable to verify Menu\n"
|
1941
|
|
|
|
|
|
|
."\n This Error is usually the result of a Menu"
|
1942
|
|
|
|
|
|
|
."\n block that does not contain properly"
|
1943
|
|
|
|
|
|
|
."\n coded Item blocks or was not coded"
|
1944
|
|
|
|
|
|
|
."\n ABOVE the parent Menu hash block"
|
1945
|
|
|
|
|
|
|
."\n (Example: 1), or not coded with"
|
1946
|
|
|
|
|
|
|
."\n GLOBAL scope (Example: 2).\n"
|
1947
|
|
|
|
|
|
|
."\n Example 1:"
|
1948
|
|
|
|
|
|
|
."\n my %Example_Menu=( \# ABOVE parent"
|
1949
|
|
|
|
|
|
|
."\n \# Best Practice"
|
1950
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1951
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1952
|
|
|
|
|
|
|
."\n },"
|
1953
|
|
|
|
|
|
|
."\n );"
|
1954
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
1955
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1956
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1957
|
|
|
|
|
|
|
."\n Result => \%Example_Menu,"
|
1958
|
|
|
|
|
|
|
."\n },"
|
1959
|
|
|
|
|
|
|
."\n );\n"
|
1960
|
|
|
|
|
|
|
."\n"
|
1961
|
|
|
|
|
|
|
."\n Example 2:"
|
1962
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
1963
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1964
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1965
|
|
|
|
|
|
|
."\n Result => \%Example_Menu,"
|
1966
|
|
|
|
|
|
|
."\n },"
|
1967
|
|
|
|
|
|
|
."\n );"
|
1968
|
|
|
|
|
|
|
."\n our %Example_Menu=( \# GLOBAL scope"
|
1969
|
|
|
|
|
|
|
."\n \# Note: 'our' pragma"
|
1970
|
|
|
|
|
|
|
."\n Item_1 => {"
|
1971
|
|
|
|
|
|
|
."\n Text => 'Item Text',"
|
1972
|
|
|
|
|
|
|
."\n },"
|
1973
|
|
|
|
|
|
|
."\n );\n"
|
1974
|
|
|
|
|
|
|
."\n";
|
1975
|
0
|
|
|
|
|
|
die $die;
|
1976
|
|
|
|
|
|
|
}
|
1977
|
0
|
|
|
|
|
|
} else { return 0 }
|
1978
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
}
|
1980
|
|
|
|
|
|
|
|
1981
|
|
|
|
|
|
|
sub transform_sicm
|
1982
|
|
|
|
|
|
|
{
|
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
#print "TRANSFORM_SICM_CALLER=",caller,"\n";
|
1985
|
|
|
|
|
|
|
## sicm - [s]elected [i]tems [c]urrent [m]enu
|
1986
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
1987
|
0
|
|
0
|
|
|
|
my $numbor=$_[1]||-1;
|
1988
|
0
|
|
0
|
|
|
|
my $all_menu_items_array=$_[2]||'';
|
1989
|
0
|
|
0
|
|
|
|
my $picks=$_[3]||'';
|
1990
|
0
|
|
0
|
|
|
|
my $pn=$_[4]||'';
|
1991
|
0
|
|
0
|
|
|
|
my $return_from_child_menu=$_[5]||'';
|
1992
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
1993
|
0
|
|
0
|
|
|
|
my $current_menu_name=$_[7]||'';
|
1994
|
0
|
|
|
|
|
|
my $selected=[];my $replace='';
|
|
0
|
|
|
|
|
|
|
1995
|
0
|
|
|
|
|
|
my $expand_array_flag=0;
|
1996
|
0
|
|
|
|
|
|
my $sicm_regex=
|
1997
|
|
|
|
|
|
|
qr/\](!)?s(?:e+lected[-_]*)*i*(?:t+ems[-_]*)
|
1998
|
|
|
|
|
|
|
*c*(?:u+rrent[-_]*)*m*(?:e+nu[-_]*)*\[/xi;
|
1999
|
0
|
|
|
|
|
|
my $tsmi_regex=qr/\](!)?t(?:e+st[-_]*)*s*(?:e+lected[-_]*)
|
2000
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2001
|
0
|
0
|
0
|
|
|
|
if ((-1
|
2002
|
0
|
0
|
0
|
|
|
|
unless ($text=~/^\s*\]\[\[\s*/s && $text=~/\s*\]\]\[\s*$/s) {
|
2003
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The --RETURN-ARRAY-- Macro"
|
2004
|
|
|
|
|
|
|
."\n Boundary indicators: '][[' and ']]['"
|
2005
|
|
|
|
|
|
|
."\n are only supported at the beginning"
|
2006
|
|
|
|
|
|
|
."\n and end of the return instructions."
|
2007
|
|
|
|
|
|
|
."\n Nothing but white space should precede"
|
2008
|
|
|
|
|
|
|
."\n the left indicator, nor extend beyond"
|
2009
|
|
|
|
|
|
|
."\n the right indicator.\n"
|
2010
|
|
|
|
|
|
|
."\n Your String:\n"
|
2011
|
|
|
|
|
|
|
."\n $text\n"
|
2012
|
|
|
|
|
|
|
."\n Remedy: Recreate your return instructions"
|
2013
|
|
|
|
|
|
|
."\n to conform to this convention. Also"
|
2014
|
|
|
|
|
|
|
."\n be sure to use the Macro delimiter"
|
2015
|
|
|
|
|
|
|
."\n indicator ']|[' to denote return array"
|
2016
|
|
|
|
|
|
|
."\n element separation boundaries."
|
2017
|
|
|
|
|
|
|
."\n Example:\n"
|
2018
|
|
|
|
|
|
|
."\n '][[ ]S[ ]|[ ]P[{Menu_One} ]|[ SomeString ]]['"
|
2019
|
|
|
|
|
|
|
."\n";
|
2020
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2021
|
|
|
|
|
|
|
-1
|
2022
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2023
|
0
|
|
|
|
|
|
close($log_handle);
|
2024
|
|
|
|
|
|
|
}
|
2025
|
|
|
|
|
|
|
}
|
2026
|
0
|
|
|
|
|
|
$expand_array_flag=1;
|
2027
|
|
|
|
|
|
|
}
|
2028
|
0
|
|
|
|
|
|
my @pks=keys %{$picks};
|
|
0
|
|
|
|
|
|
|
2029
|
0
|
0
|
0
|
|
|
|
if (0<$#pks && !$return_from_child_menu) {
|
2030
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %{$picks}) {
|
|
0
|
|
|
|
|
|
|
2031
|
0
|
|
|
|
|
|
push @{$selected},$all_menu_items_array->[$key-1];
|
|
0
|
|
|
|
|
|
|
2032
|
|
|
|
|
|
|
}
|
2033
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($selected)->Out();
|
2034
|
0
|
|
|
|
|
|
$replace=~s/\$ARRAY\d*\s*=\s*//s;
|
2035
|
0
|
|
|
|
|
|
$replace=~s/\;\s*$//s;
|
2036
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2037
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2038
|
|
|
|
|
|
|
}
|
2039
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2040
|
|
|
|
|
|
|
} else {
|
2041
|
0
|
0
|
|
|
|
|
if (ref $pn eq 'HASH') {
|
|
|
0
|
|
|
|
|
|
2042
|
0
|
|
0
|
|
|
|
$pn->{$numbor}->[1]||=1; #COMEHERE
|
2043
|
0
|
|
|
|
|
|
$replace=$all_menu_items_array->[$pn->{$numbor}->[1]-1];
|
2044
|
|
|
|
|
|
|
} elsif ($pn) {
|
2045
|
0
|
|
|
|
|
|
$replace=$all_menu_items_array->[$pn];
|
2046
|
|
|
|
|
|
|
} else {
|
2047
|
0
|
|
0
|
|
|
|
$replace=$all_menu_items_array->[$numbor-1]||'';
|
2048
|
|
|
|
|
|
|
}
|
2049
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2050
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2051
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2052
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2053
|
|
|
|
|
|
|
}
|
2054
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2055
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tsmi_regex,$sicm_regex) {
|
2056
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2057
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\\\{([^}]+)\})*)/sg) {
|
2058
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2059
|
0
|
|
|
|
|
|
my $esc_one=$1;
|
2060
|
0
|
|
|
|
|
|
my $bang=$2;
|
2061
|
0
|
|
|
|
|
|
my $menu=$3;
|
2062
|
0
|
|
0
|
|
|
|
$menu||='';
|
2063
|
0
|
|
|
|
|
|
$esc_one=~s/\[/\\\[/;$esc_one=~s/\]/\\\]/;
|
|
0
|
|
|
|
|
|
|
2064
|
0
|
0
|
|
|
|
|
$replace=~s/\s*//s if $text=~/[)]\s*$/s;
|
2065
|
0
|
0
|
|
|
|
|
if ($menu) {
|
2066
|
0
|
0
|
|
|
|
|
if (-1
|
2067
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/sg;
|
2068
|
|
|
|
|
|
|
} else {
|
2069
|
0
|
|
|
|
|
|
$test_regx_flag=0;
|
2070
|
|
|
|
|
|
|
}
|
2071
|
0
|
|
|
|
|
|
next;
|
2072
|
|
|
|
|
|
|
}
|
2073
|
0
|
|
|
|
|
|
$text=~s/$esc_one(?![{])/$replace/g;
|
2074
|
|
|
|
|
|
|
}
|
2075
|
|
|
|
|
|
|
}
|
2076
|
0
|
|
|
|
|
|
return $text;
|
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
}
|
2079
|
|
|
|
|
|
|
|
2080
|
|
|
|
|
|
|
sub transform_mbio
|
2081
|
|
|
|
|
|
|
{
|
2082
|
|
|
|
|
|
|
|
2083
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2084
|
0
|
|
0
|
|
|
|
my $input=$_[1]||{};
|
2085
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[2]||{};
|
2086
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[3]||'';
|
2087
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[4]||'';
|
2088
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[5]||'';
|
2089
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
2090
|
0
|
|
|
|
|
|
my $tobi_regex=qr/\](!)?o(?:u+tput[-_]*)*b*(?:a+nner[-_]*)
|
2091
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2092
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2093
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tobi_regex) {
|
2094
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2095
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2096
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2097
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2098
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2099
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2100
|
0
|
|
|
|
|
|
my $esc_two=$esc_one;
|
2101
|
0
|
|
|
|
|
|
$esc_two=~s/\]/\\\]/;$esc_two=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2102
|
0
|
|
|
|
|
|
$esc_one=~s/^\]/\[\]\]/;$esc_one=~s/^(.*?)\[\{/$1\[\[\]{/;
|
|
0
|
|
|
|
|
|
|
2103
|
0
|
|
|
|
|
|
$esc_one=~s/^(.*?[]])[{](.*)[}]$/$1\[\{\]$2\[\}\]/;
|
2104
|
0
|
|
|
|
|
|
my $instructions=$esc_two;
|
2105
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2106
|
0
|
|
|
|
|
|
$instructions=~/^(.*?),(.*?)$/;
|
2107
|
0
|
|
|
|
|
|
my $input_macro=$1;my $code=$2;
|
|
0
|
|
|
|
|
|
|
2108
|
0
|
|
|
|
|
|
$code=~s/["']//g;
|
2109
|
0
|
|
|
|
|
|
$code="\$main::$code";
|
2110
|
0
|
|
|
|
|
|
my $input_text=$input->{$input_macro};
|
2111
|
0
|
|
|
|
|
|
$code=eval $code;
|
2112
|
0
|
|
|
|
|
|
my $cd=&Data::Dump::Streamer::Dump($code)->Out();
|
2113
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
2114
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2115
|
|
|
|
|
|
|
$picks_from_parent);
|
2116
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
2117
|
0
|
|
|
|
|
|
$code=eval $cd;
|
2118
|
0
|
|
|
|
|
|
my $output='';
|
2119
|
0
|
0
|
|
|
|
|
$output=$code->($input_text) if $input_text!~/^\s*$/;
|
2120
|
0
|
|
|
|
|
|
my $out_height=$output=~tr/\n//;
|
2121
|
0
|
|
|
|
|
|
my @output=split /\n/,$output;
|
2122
|
0
|
|
|
|
|
|
my @newtext=();
|
2123
|
0
|
|
|
|
|
|
foreach my $line (split "\n",$text) {
|
2124
|
0
|
0
|
|
|
|
|
if ($line=~/^(.*)$esc_one(.*)$/) {
|
2125
|
0
|
|
|
|
|
|
my $front_of_line=$1;my $back_of_line=$2;
|
|
0
|
|
|
|
|
|
|
2126
|
0
|
|
|
|
|
|
my $frlen=length $front_of_line;
|
2127
|
0
|
|
0
|
|
|
|
my $bottomline=pop @output||'';
|
2128
|
0
|
|
|
|
|
|
$bottomline=$front_of_line.$bottomline.$back_of_line;
|
2129
|
0
|
|
|
|
|
|
foreach my $ln (@output) {
|
2130
|
0
|
|
|
|
|
|
my $pad=sprintf "%-${frlen}s",'';
|
2131
|
0
|
|
|
|
|
|
push @newtext,$pad.$ln;
|
2132
|
|
|
|
|
|
|
}
|
2133
|
0
|
|
|
|
|
|
push @newtext,$bottomline;
|
2134
|
|
|
|
|
|
|
} else {
|
2135
|
0
|
|
|
|
|
|
push @newtext,$line;
|
2136
|
|
|
|
|
|
|
}
|
2137
|
0
|
|
|
|
|
|
} $text=join "\n",@newtext;
|
2138
|
|
|
|
|
|
|
}
|
2139
|
|
|
|
|
|
|
}
|
2140
|
0
|
|
|
|
|
|
return $text,$input;
|
2141
|
|
|
|
|
|
|
|
2142
|
|
|
|
|
|
|
}
|
2143
|
|
|
|
|
|
|
|
2144
|
|
|
|
|
|
|
sub transform_mbir
|
2145
|
|
|
|
|
|
|
{
|
2146
|
|
|
|
|
|
|
|
2147
|
|
|
|
|
|
|
## mbir - [m]enu [b]anner [i]nput [r]esults
|
2148
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2149
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||{};
|
2150
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[2]||'';
|
2151
|
0
|
|
0
|
|
|
|
my $log_handle=$_[3]||'';
|
2152
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2153
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2154
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2155
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tbii_regex) {
|
2156
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2157
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2158
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2159
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2160
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2161
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2162
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2163
|
0
|
|
|
|
|
|
my $instructions=$esc_one;
|
2164
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2165
|
0
|
|
|
|
|
|
$instructions='('.$instructions.')';
|
2166
|
0
|
|
|
|
|
|
my @instructions=eval $instructions;
|
2167
|
0
|
0
|
|
|
|
|
next if $#instructions==2;
|
2168
|
0
|
0
|
|
|
|
|
if ($#instructions==1) {
|
2169
|
0
|
0
|
|
|
|
|
if (exists $Conveyed->{$instructions[0].'_mbir'}) {
|
2170
|
0
|
|
|
|
|
|
my $item=$instructions[0].'_mbir';
|
2171
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$item}->{$instructions[1]};
|
2172
|
0
|
|
|
|
|
|
$esc_one=~s/[{]/\\{/g;
|
2173
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/s;
|
2174
|
|
|
|
|
|
|
}
|
2175
|
|
|
|
|
|
|
}
|
2176
|
|
|
|
|
|
|
}
|
2177
|
0
|
|
|
|
|
|
} return $text;
|
2178
|
|
|
|
|
|
|
}
|
2179
|
|
|
|
|
|
|
|
2180
|
|
|
|
|
|
|
sub transform_mbii
|
2181
|
|
|
|
|
|
|
{
|
2182
|
|
|
|
|
|
|
|
2183
|
|
|
|
|
|
|
## mbii - [m]enu [b]anner [i]nput [i]tems
|
2184
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2185
|
0
|
0
|
|
|
|
|
my $numbor=(defined $_[1])?$_[1]:'';
|
2186
|
0
|
|
0
|
|
|
|
my $ikey=$_[2]||'';
|
2187
|
0
|
|
0
|
|
|
|
my $input=$_[3]||{};
|
2188
|
0
|
|
0
|
|
|
|
my $MenuUnit_hash_ref=$_[4]||{};
|
2189
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[5]||'';
|
2190
|
0
|
|
0
|
|
|
|
my $log_handle=$_[6]||'';
|
2191
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2192
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2193
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2194
|
0
|
0
|
0
|
|
|
|
if ($ikey eq 'TAB' && exists $input->{focus}) {
|
2195
|
0
|
|
|
|
|
|
$input->{focus}->[0]=$input->{focus}->[2]->{$input->{focus}->[0]};
|
2196
|
0
|
|
|
|
|
|
$ikey='';$numbor='';
|
|
0
|
|
|
|
|
|
|
2197
|
|
|
|
|
|
|
}
|
2198
|
|
|
|
|
|
|
|
2199
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tbii_regex) {
|
2200
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2201
|
0
|
|
|
|
|
|
my $fill_focus=0;
|
2202
|
0
|
0
|
|
|
|
|
$fill_focus=1 unless exists $input->{focus};
|
2203
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2204
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2205
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2206
|
0
|
|
|
|
|
|
my $length_of_macro=length $esc_one;
|
2207
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2208
|
0
|
|
|
|
|
|
my $esc_two=$esc_one;
|
2209
|
0
|
|
|
|
|
|
$esc_two=~s/\]/\\\]/;$esc_two=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2210
|
0
|
|
|
|
|
|
$esc_one=~s/^\]/\[\]\]/;$esc_one=~s/^(.*?)\[\{/$1\[\[\]{/;
|
|
0
|
|
|
|
|
|
|
2211
|
0
|
|
|
|
|
|
$esc_one=~s/^(.*?[]])[{](.*)[}]$/$1\[\{\]$2\[\}\]/;
|
2212
|
0
|
|
|
|
|
|
my $instructions=$esc_two;
|
2213
|
0
|
|
|
|
|
|
$instructions=~s/^\\[]][^[]+\\[[]\s*[{](.*?)[}]$/$1/;
|
2214
|
0
|
|
|
|
|
|
$instructions='('.$instructions.')';
|
2215
|
0
|
|
|
|
|
|
my @instructions=eval $instructions;
|
2216
|
0
|
0
|
|
|
|
|
unless (exists $input->{$instructions[0]}) {
|
2217
|
0
|
|
|
|
|
|
$input->{$instructions[0]}=$instructions[1];
|
2218
|
0
|
|
|
|
|
|
$numbor='';
|
2219
|
|
|
|
|
|
|
}
|
2220
|
|
|
|
|
|
|
$input->{$instructions[0]}='' unless defined
|
2221
|
0
|
0
|
|
|
|
|
$input->{$instructions[0]};
|
2222
|
0
|
0
|
|
|
|
|
if ($fill_focus) {
|
2223
|
0
|
0
|
|
|
|
|
unless (exists $input->{focus}) {
|
2224
|
0
|
|
|
|
|
|
my $default_focus=$instructions[0];
|
2225
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Focus} &&
|
2226
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Focus}) {
|
2227
|
0
|
|
|
|
|
|
$default_focus=$MenuUnit_hash_ref->{Focus};
|
2228
|
|
|
|
|
|
|
}
|
2229
|
0
|
|
|
|
|
|
$input->{focus}=[$default_focus,[$instructions[0]],{}];
|
2230
|
|
|
|
|
|
|
} else {
|
2231
|
|
|
|
|
|
|
$input->{focus}->[2]->{
|
2232
|
0
|
|
|
|
|
|
$input->{focus}->[1][$#{$input->{focus}->[1]}]}
|
|
0
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
=$instructions[0];
|
2234
|
0
|
|
|
|
|
|
push @{$input->{focus}->[1]},$instructions[0];
|
|
0
|
|
|
|
|
|
|
2235
|
|
|
|
|
|
|
$input->{focus}->[2]->{$instructions[0]}=
|
2236
|
0
|
|
|
|
|
|
$input->{focus}->[1]->[0];
|
2237
|
|
|
|
|
|
|
}
|
2238
|
|
|
|
|
|
|
}
|
2239
|
0
|
|
|
|
|
|
my @newtext=();
|
2240
|
0
|
|
|
|
|
|
foreach my $line (split "\n",$text) {
|
2241
|
0
|
0
|
|
|
|
|
if ($line=~/^(.*)$esc_one(.*)$/) {
|
2242
|
0
|
|
|
|
|
|
my $front_of_line=$1;my $back_of_line=$2;
|
|
0
|
|
|
|
|
|
|
2243
|
0
|
|
|
|
|
|
my $box_top_bottom='';my @sides=('| ',' |');
|
|
0
|
|
|
|
|
|
|
2244
|
0
|
0
|
0
|
|
|
|
if ($#instructions==2 and $instructions[2]>0) {
|
2245
|
0
|
0
|
|
|
|
|
if ($input->{focus}->[0] eq $instructions[0]) {
|
2246
|
0
|
|
|
|
|
|
for (1..$instructions[2]) {
|
2247
|
0
|
|
|
|
|
|
$box_top_bottom.='=';
|
2248
|
|
|
|
|
|
|
}
|
2249
|
0
|
|
|
|
|
|
@sides=('[ ',' ]');
|
2250
|
|
|
|
|
|
|
} else {
|
2251
|
0
|
|
|
|
|
|
for (1..$instructions[2]) {
|
2252
|
0
|
|
|
|
|
|
$box_top_bottom.='-';
|
2253
|
|
|
|
|
|
|
}
|
2254
|
|
|
|
|
|
|
}
|
2255
|
|
|
|
|
|
|
}
|
2256
|
0
|
0
|
|
|
|
|
if ($input->{focus}->[0] eq $instructions[0]) {
|
2257
|
0
|
0
|
0
|
|
|
|
if ($ikey eq 'BACKSPACE') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2258
|
0
|
|
|
|
|
|
chop $input->{$instructions[0]};
|
2259
|
|
|
|
|
|
|
} elsif ($ikey eq 'DELETE') {
|
2260
|
0
|
|
|
|
|
|
$input->{$instructions[0]}='';
|
2261
|
|
|
|
|
|
|
} elsif ($ikey ne 'TAB' && defined $numbor) {
|
2262
|
0
|
|
|
|
|
|
my $length_input=length $input->{$instructions[0]};
|
2263
|
0
|
|
|
|
|
|
my $length_box=$instructions[2];
|
2264
|
0
|
0
|
|
|
|
|
if ($length_input>$length_box) {
|
2265
|
0
|
|
|
|
|
|
print "\n\n WARNING! - input exceeds box size!";
|
2266
|
0
|
|
|
|
|
|
print "\n\n You may have forgotten to [TAB] to the".
|
2267
|
|
|
|
|
|
|
"\n next box, or the input for the next box".
|
2268
|
|
|
|
|
|
|
"\n box has a TAB in it - usually at the".
|
2269
|
|
|
|
|
|
|
"\n front of the string. Use a text editor".
|
2270
|
|
|
|
|
|
|
"\n to see and remove it before pasting".
|
2271
|
|
|
|
|
|
|
"\n input.";
|
2272
|
0
|
|
|
|
|
|
print "\n\n Press to continue ...\n\n";
|
2273
|
0
|
|
|
|
|
|
sleep 1;
|
2274
|
0
|
|
|
|
|
|
;
|
2275
|
|
|
|
|
|
|
}
|
2276
|
0
|
|
|
|
|
|
$input->{$instructions[0]}.=$numbor;
|
2277
|
|
|
|
|
|
|
}
|
2278
|
|
|
|
|
|
|
}
|
2279
|
0
|
|
|
|
|
|
my $insert=$sides[0];
|
2280
|
0
|
|
|
|
|
|
$insert.=$input->{$instructions[0]};
|
2281
|
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref).'_mbir'}->
|
2282
|
0
|
|
|
|
|
|
{$instructions[0]}=$input->{$instructions[0]};
|
2283
|
0
|
|
|
|
|
|
my $insert_num_of_spaces=$instructions[2]-2;
|
2284
|
0
|
|
|
|
|
|
$insert=sprintf "%-${insert_num_of_spaces}s",$insert;
|
2285
|
0
|
|
|
|
|
|
$insert.=$sides[1];
|
2286
|
0
|
|
|
|
|
|
my $frlen=length $front_of_line;
|
2287
|
0
|
|
|
|
|
|
my $box_top_line='';
|
2288
|
0
|
|
|
|
|
|
my $box_mid_line='';
|
2289
|
0
|
|
|
|
|
|
my $box_bot_line='';
|
2290
|
0
|
|
|
|
|
|
my $length_of_front_and_macro=$frlen+$length_of_macro;
|
2291
|
0
|
0
|
0
|
|
|
|
if ($#newtext==-1 || $#newtext==0) {
|
2292
|
0
|
|
|
|
|
|
$box_top_line=sprintf "%-${frlen}s",'';
|
2293
|
0
|
|
|
|
|
|
$box_top_line.=$box_top_bottom;
|
2294
|
|
|
|
|
|
|
} else {
|
2295
|
0
|
|
|
|
|
|
my $front_of_box_top=unpack("a$frlen",$newtext[$#newtext-1]);
|
2296
|
0
|
0
|
|
|
|
|
$front_of_box_top=sprintf "%-${frlen}s",$front_of_box_top
|
2297
|
|
|
|
|
|
|
if length $front_of_box_top<$frlen;
|
2298
|
0
|
|
|
|
|
|
my $back_of_box_top='';
|
2299
|
0
|
0
|
|
|
|
|
if ($length_of_front_and_macro<=length
|
2300
|
|
|
|
|
|
|
$newtext[$#newtext-1]) {
|
2301
|
0
|
|
|
|
|
|
$back_of_box_top=unpack("x$length_of_front_and_macro a*",
|
2302
|
|
|
|
|
|
|
$newtext[$#newtext-1]);
|
2303
|
|
|
|
|
|
|
}
|
2304
|
0
|
|
|
|
|
|
$box_top_line=$front_of_box_top.
|
2305
|
|
|
|
|
|
|
$box_top_bottom.$back_of_box_top;
|
2306
|
|
|
|
|
|
|
}
|
2307
|
0
|
0
|
|
|
|
|
if ($#newtext==-1) {
|
2308
|
0
|
|
|
|
|
|
$box_mid_line=sprintf "%-${frlen}s",'';
|
2309
|
0
|
|
|
|
|
|
$box_mid_line.=$insert;
|
2310
|
|
|
|
|
|
|
} else {
|
2311
|
0
|
0
|
|
|
|
|
my $elem=($#newtext==0)?0:$#newtext;
|
2312
|
0
|
|
|
|
|
|
my $front_of_box_mid=sprintf "%-${frlen}s",'';
|
2313
|
0
|
0
|
|
|
|
|
if ($newtext[$elem]!~/^\s*$/) {
|
2314
|
0
|
|
|
|
|
|
$front_of_box_mid=unpack("a$frlen",$newtext[$elem]);
|
2315
|
0
|
0
|
|
|
|
|
$front_of_box_mid=sprintf "%-${frlen}s",$front_of_box_mid
|
2316
|
|
|
|
|
|
|
if length $front_of_box_mid<$frlen;
|
2317
|
|
|
|
|
|
|
}
|
2318
|
0
|
|
|
|
|
|
my $back_of_box_mid='';
|
2319
|
0
|
0
|
|
|
|
|
if ($length_of_front_and_macro<=length $newtext[$elem]) {
|
2320
|
0
|
|
|
|
|
|
$back_of_box_mid=unpack("x$length_of_front_and_macro a*",
|
2321
|
|
|
|
|
|
|
$newtext[$elem]);
|
2322
|
|
|
|
|
|
|
}
|
2323
|
0
|
|
|
|
|
|
$box_mid_line=$front_of_box_mid.
|
2324
|
|
|
|
|
|
|
$insert.$back_of_box_mid;
|
2325
|
|
|
|
|
|
|
}
|
2326
|
0
|
|
|
|
|
|
$box_bot_line=$front_of_line.$box_top_bottom.$back_of_line;
|
2327
|
0
|
0
|
|
|
|
|
if ($#newtext==-1) {
|
|
|
0
|
|
|
|
|
|
2328
|
0
|
|
|
|
|
|
push @newtext,$box_top_line;
|
2329
|
0
|
|
|
|
|
|
push @newtext,$box_mid_line;
|
2330
|
|
|
|
|
|
|
} elsif ($#newtext==0) {
|
2331
|
0
|
|
|
|
|
|
unshift @newtext,$box_top_line;
|
2332
|
0
|
|
|
|
|
|
$newtext[1]=$box_mid_line;
|
2333
|
|
|
|
|
|
|
} else {
|
2334
|
0
|
|
|
|
|
|
$newtext[$#newtext-1]=$box_top_line;
|
2335
|
0
|
|
|
|
|
|
$newtext[$#newtext]=$box_mid_line;
|
2336
|
0
|
|
|
|
|
|
} push @newtext, $box_bot_line;
|
2337
|
|
|
|
|
|
|
} else {
|
2338
|
0
|
|
|
|
|
|
push @newtext,$line;
|
2339
|
|
|
|
|
|
|
}
|
2340
|
0
|
|
|
|
|
|
} $text=join "\n",@newtext;
|
2341
|
|
|
|
|
|
|
}
|
2342
|
0
|
|
|
|
|
|
} return $text, $input;
|
2343
|
|
|
|
|
|
|
}
|
2344
|
|
|
|
|
|
|
|
2345
|
|
|
|
|
|
|
sub transform_pmsi
|
2346
|
|
|
|
|
|
|
{
|
2347
|
|
|
|
|
|
|
|
2348
|
|
|
|
|
|
|
#print "TRANSFORM_PMSI CALLER=",caller,"\n";
|
2349
|
|
|
|
|
|
|
## pmsi - [p]revious [m]enu [s]elected [i]tems
|
2350
|
0
|
|
0
|
0
|
0
|
|
my $text=$_[0]||'';
|
2351
|
0
|
|
0
|
|
|
|
my $Conveyed=$_[1]||'';
|
2352
|
0
|
|
0
|
|
|
|
my $SaveMMap=$_[2]||'';
|
2353
|
0
|
|
0
|
|
|
|
my $picks_from_parent=$_[3]||'';
|
2354
|
0
|
|
0
|
|
|
|
my $log_handle=$_[4]||'';
|
2355
|
0
|
|
|
|
|
|
my $expand_array_flag=0;
|
2356
|
0
|
|
|
|
|
|
my $tpmi_regex=qr/\](!)?t(?:e+st[-_]*)*p*(?:r+vious[-_]*)
|
2357
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2358
|
0
|
|
|
|
|
|
my $pmsi_regex=qr/\](!)?p(?:r+evious[-_]*)*m*(?:e+nu[-_]*)
|
2359
|
|
|
|
|
|
|
*s*(?:e+lected[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2360
|
0
|
|
|
|
|
|
my $amlm_regex=qr/\]a(n+cestor[-_]*)*m*(e+nu[-_]*)
|
2361
|
|
|
|
|
|
|
*l*(a+bel[-_]*)*m*(a+p[-_]*)*\[/xi;
|
2362
|
0
|
|
|
|
|
|
$text=~s/\s?$//s;
|
2363
|
0
|
0
|
0
|
|
|
|
if ((-1
|
2364
|
0
|
0
|
0
|
|
|
|
unless ($text=~/^\s*\]\[\[\s*/s && $text=~/\s*\]\]\[\s*$/s) {
|
2365
|
0
|
|
|
|
|
|
my $die=<
|
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
FATAL ERROR! - The --RETURN-ARRAY-- Macro
|
2368
|
|
|
|
|
|
|
Boundary indicators: '][[' and ']]['
|
2369
|
|
|
|
|
|
|
are only supported at the beginning
|
2370
|
|
|
|
|
|
|
and end of the return instructions.
|
2371
|
|
|
|
|
|
|
Nothing but white space should precede
|
2372
|
|
|
|
|
|
|
the left indicator, nor extend beyond
|
2373
|
|
|
|
|
|
|
the right indicator.
|
2374
|
|
|
|
|
|
|
Your String:
|
2375
|
|
|
|
|
|
|
$text
|
2376
|
|
|
|
|
|
|
Remedy: Recreate your return instructions
|
2377
|
|
|
|
|
|
|
to conform to this convention. Also
|
2378
|
|
|
|
|
|
|
be sure to use the Macro delimiter
|
2379
|
|
|
|
|
|
|
indicator ']|[' to denote return array
|
2380
|
|
|
|
|
|
|
element separation boundaries.
|
2381
|
|
|
|
|
|
|
Example:
|
2382
|
|
|
|
|
|
|
'][[ ]S[ ]|[ ]P[{Menu_One} ]|[ SomeString ]]['
|
2383
|
|
|
|
|
|
|
DIE
|
2384
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2385
|
|
|
|
|
|
|
-1
|
2386
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2387
|
0
|
|
|
|
|
|
close($log_handle);
|
2388
|
|
|
|
|
|
|
}
|
2389
|
|
|
|
|
|
|
}
|
2390
|
0
|
|
|
|
|
|
$expand_array_flag=1;
|
2391
|
|
|
|
|
|
|
}
|
2392
|
0
|
|
|
|
|
|
my $test_regx_flag=0;
|
2393
|
0
|
|
|
|
|
|
FE: foreach my $regx ($tpmi_regex,$pmsi_regex) {
|
2394
|
0
|
0
|
|
|
|
|
last if $test_regx_flag;
|
2395
|
0
|
|
|
|
|
|
while ($text=~m/($regx(?:\{[^}]+\})*)/sg) {
|
2396
|
0
|
0
|
|
|
|
|
$test_regx_flag=1 if -1
|
2397
|
0
|
|
|
|
|
|
my $esc_one=$1;my $bang=$2;
|
|
0
|
|
|
|
|
|
|
2398
|
0
|
|
|
|
|
|
$esc_one=~s/["]\s*[.]\s*["]//s;
|
2399
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2400
|
0
|
|
|
|
|
|
$esc_one=~s/[{]/\\\{\(/;$esc_one=~s/\}/\)\}/;
|
|
0
|
|
|
|
|
|
|
2401
|
0
|
|
0
|
|
|
|
while ($esc_one=~/[{]/ && $text=~m/$esc_one/) {
|
2402
|
0
|
0
|
0
|
|
|
|
unless (exists $Conveyed->{$1} || $bang || $test_regx_flag) {
|
|
|
|
0
|
|
|
|
|
2403
|
0
|
|
|
|
|
|
my $die="\n\n FATAL ERROR! - The Menu Name: \"$1\""
|
2404
|
|
|
|
|
|
|
."\n describes a Menu that is *NOT* in the"
|
2405
|
|
|
|
|
|
|
."\n invocation history of this process.\n"
|
2406
|
|
|
|
|
|
|
."\n This Error is *usually* the result of a missing,"
|
2407
|
|
|
|
|
|
|
."\n Menu, a Menu block that was not global or"
|
2408
|
|
|
|
|
|
|
."\n was not coded ABOVE the parent Menu hash"
|
2409
|
|
|
|
|
|
|
."\n block. (See Example)\n"
|
2410
|
|
|
|
|
|
|
."\n Also be sure to use a UNIQUE name for every"
|
2411
|
|
|
|
|
|
|
."\n Menu.\n"
|
2412
|
|
|
|
|
|
|
."\n Example: my %Example_Menu=(\n"
|
2413
|
|
|
|
|
|
|
."\n Item_1 => {"
|
2414
|
|
|
|
|
|
|
."\n ... # ]P[ is a Macro 'Previous'"
|
2415
|
|
|
|
|
|
|
."\n Result => sub { return ']P[{Parent_Menu}' },"
|
2416
|
|
|
|
|
|
|
."\n );"
|
2417
|
|
|
|
|
|
|
."\n my %Parent_Menu=(\n"
|
2418
|
|
|
|
|
|
|
."\n Item_1 => {"
|
2419
|
|
|
|
|
|
|
."\n ..."
|
2420
|
|
|
|
|
|
|
."\n Result => \\%Example_Menu,"
|
2421
|
|
|
|
|
|
|
."\n ..."
|
2422
|
|
|
|
|
|
|
."\n );\n"
|
2423
|
|
|
|
|
|
|
."\n *HOWEVER*: Read the Documentation on \"stepchild\""
|
2424
|
|
|
|
|
|
|
."\n and other deeply nested menus. There are"
|
2425
|
|
|
|
|
|
|
."\n scenarios with dynamically generated menus"
|
2426
|
|
|
|
|
|
|
."\n where Term::Menus simply cannot test for"
|
2427
|
|
|
|
|
|
|
."\n menu stack integrity when it encounters"
|
2428
|
|
|
|
|
|
|
."\n unexpanded macros in defined but ungenerated"
|
2429
|
|
|
|
|
|
|
."\n menus. In these situations this error"
|
2430
|
|
|
|
|
|
|
."\n message should be turned off by using the"
|
2431
|
|
|
|
|
|
|
."\n \"test\" macro ( ]T[ ) or using an"
|
2432
|
|
|
|
|
|
|
."\n exclamation point character with either"
|
2433
|
|
|
|
|
|
|
."\n or both the ]S[ (becomes ]!S[) and ]P["
|
2434
|
|
|
|
|
|
|
."\n (becomes ]!P[) macros.\n\n";
|
2435
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2436
|
|
|
|
|
|
|
-1
|
2437
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2438
|
0
|
|
|
|
|
|
close($log_handle);
|
2439
|
|
|
|
|
|
|
}
|
2440
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
2441
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
2442
|
0
|
|
|
|
|
|
} else { die $die }
|
2443
|
|
|
|
|
|
|
}
|
2444
|
0
|
0
|
|
|
|
|
unless ($Conveyed->{$1}) {
|
2445
|
0
|
|
|
|
|
|
$test_regx_flag=0;
|
2446
|
|
|
|
|
|
|
next FE
|
2447
|
0
|
|
|
|
|
|
}
|
2448
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$1};
|
2449
|
0
|
0
|
|
|
|
|
if (ref $replace) {
|
2450
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($Conveyed->{$1})->Out();
|
2451
|
0
|
|
|
|
|
|
my $type=ref $Conveyed->{$1};
|
2452
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2453
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2454
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2455
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2456
|
|
|
|
|
|
|
}
|
2457
|
|
|
|
|
|
|
}
|
2458
|
0
|
0
|
0
|
|
|
|
if ($text=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2459
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2460
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2461
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2462
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2463
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2464
|
|
|
|
|
|
|
}
|
2465
|
0
|
0
|
0
|
|
|
|
if ($replace=~/^.(?
|
2466
|
0
|
0
|
0
|
|
|
|
$replace='"'.$replace.'"' if
|
2467
|
|
|
|
|
|
|
$text!~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/ &&
|
2468
|
|
|
|
|
|
|
$replace!~/^eval /;
|
2469
|
|
|
|
|
|
|
}
|
2470
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/se;
|
|
0
|
|
|
|
|
|
|
2471
|
|
|
|
|
|
|
}
|
2472
|
0
|
|
|
|
|
|
my $replace='';
|
2473
|
0
|
0
|
|
|
|
|
if (ref $picks_from_parent eq 'ARRAY') {
|
2474
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($picks_from_parent)->Out();
|
2475
|
0
|
|
|
|
|
|
my $type=ref $picks_from_parent;
|
2476
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2477
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2478
|
0
|
0
|
0
|
|
|
|
if ($expand_array_flag) {
|
|
|
0
|
|
|
|
|
|
2479
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2480
|
|
|
|
|
|
|
} elsif ($replace=~/^.(?
|
2481
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2482
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2483
|
|
|
|
|
|
|
}
|
2484
|
|
|
|
|
|
|
} else {
|
2485
|
0
|
|
|
|
|
|
$replace=$picks_from_parent;
|
2486
|
0
|
0
|
0
|
|
|
|
if ($replace=~/^.(?
|
2487
|
0
|
0
|
|
|
|
|
$replace='"'.$replace.'"' unless
|
2488
|
|
|
|
|
|
|
$text=~/^&?(\w+)\s*[(]["'].*["'][)]\s*$/;
|
2489
|
|
|
|
|
|
|
}
|
2490
|
|
|
|
|
|
|
|
2491
|
|
|
|
|
|
|
}
|
2492
|
0
|
0
|
0
|
|
|
|
if ($text=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2493
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2494
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/g;
|
2495
|
0
|
|
|
|
|
|
$replace=~s/\"/\\\"/g;
|
2496
|
0
|
0
|
0
|
|
|
|
$replace='"'.$replace.'"' if
|
2497
|
|
|
|
|
|
|
$text!~/^&?(?:.*::)*(\w+)\s*[(]["'].*["'][)]\s*$/ &&
|
2498
|
|
|
|
|
|
|
$replace!~/^eval /;
|
2499
|
|
|
|
|
|
|
}
|
2500
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/s;
|
2501
|
|
|
|
|
|
|
}
|
2502
|
|
|
|
|
|
|
}
|
2503
|
0
|
|
|
|
|
|
while ($text=~m/($amlm_regex(?:\{[^}]+\})*)/sg) {
|
2504
|
0
|
|
|
|
|
|
my $esc_one=$1;
|
2505
|
0
|
0
|
|
|
|
|
last unless $esc_one;
|
2506
|
0
|
|
|
|
|
|
$esc_one=~s/\]/\\\]/;$esc_one=~s/\[/\\\[/;
|
|
0
|
|
|
|
|
|
|
2507
|
0
|
|
|
|
|
|
$esc_one=~s/\{/\{\(/;$esc_one=~s/\}/\)\}/;
|
|
0
|
|
|
|
|
|
|
2508
|
0
|
|
|
|
|
|
my $replace=$Conveyed->{$1};
|
2509
|
0
|
0
|
|
|
|
|
if (ref $replace) {
|
2510
|
0
|
|
|
|
|
|
$replace=&Data::Dump::Streamer::Dump($Conveyed->{$1})->Out();
|
2511
|
0
|
|
|
|
|
|
my $type=ref $Conveyed->{$1};
|
2512
|
0
|
|
|
|
|
|
$replace=~s/\$$type\d*\s*=\s*//s;
|
2513
|
0
|
|
|
|
|
|
$replace=~s/\'/\\\'/sg;
|
2514
|
0
|
0
|
|
|
|
|
if ($expand_array_flag) {
|
2515
|
0
|
|
|
|
|
|
$replace='eval '.$replace;
|
2516
|
|
|
|
|
|
|
}
|
2517
|
|
|
|
|
|
|
}
|
2518
|
0
|
|
|
|
|
|
$text=~s/$esc_one/$replace/se;
|
|
0
|
|
|
|
|
|
|
2519
|
0
|
|
|
|
|
|
} return $text;
|
2520
|
|
|
|
|
|
|
|
2521
|
|
|
|
|
|
|
}
|
2522
|
|
|
|
|
|
|
|
2523
|
|
|
|
|
|
|
sub pick # USAGE: &pick( ref_to_choices_array,
|
2524
|
|
|
|
|
|
|
# (Optional) banner_string,
|
2525
|
|
|
|
|
|
|
# (Optional) display_this_many_items,
|
2526
|
|
|
|
|
|
|
# (Optional) return_index_only_flag,
|
2527
|
|
|
|
|
|
|
# (Optional) log_file_handle,
|
2528
|
|
|
|
|
|
|
# ----------
|
2529
|
|
|
|
|
|
|
# For Use With Sub-Menus
|
2530
|
|
|
|
|
|
|
# ----------
|
2531
|
|
|
|
|
|
|
# (Optional) MenuUnit_hash_ref,
|
2532
|
|
|
|
|
|
|
# (Optional) recurse_level,
|
2533
|
|
|
|
|
|
|
# (Optional) picks_from_parent,
|
2534
|
|
|
|
|
|
|
# (Optional) parent_menu,
|
2535
|
|
|
|
|
|
|
# (Optional) menus_cfg_file,
|
2536
|
|
|
|
|
|
|
# (Optional) Full_Menu_data_structure,
|
2537
|
|
|
|
|
|
|
# (Optional) Selected_data_structure,
|
2538
|
|
|
|
|
|
|
# (Optional) Conveyed_data_structure,
|
2539
|
|
|
|
|
|
|
# (Optional) SavePick_data_structure,
|
2540
|
|
|
|
|
|
|
# (Optional) SaveMMap_data_structure,
|
2541
|
|
|
|
|
|
|
# (Optional) SaveNext_data_structure,
|
2542
|
|
|
|
|
|
|
# (Optional) Persists_data_structure,
|
2543
|
|
|
|
|
|
|
# (Optional) no_wantarray_flag,
|
2544
|
|
|
|
|
|
|
# (Optional) sorted
|
2545
|
|
|
|
|
|
|
# (Optional) select_many )
|
2546
|
|
|
|
|
|
|
{
|
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
#print "PICKCALLER=",caller," and Argument 7 =>$_[6]<=\n";;
|
2549
|
|
|
|
|
|
|
|
2550
|
|
|
|
|
|
|
# "pick" --> This function presents the user with
|
2551
|
|
|
|
|
|
|
# with a list of items from which to choose.
|
2552
|
|
|
|
|
|
|
|
2553
|
0
|
|
|
0
|
1
|
|
my @all_menu_items_array=@{$_[0]};
|
|
0
|
|
|
|
|
|
|
2554
|
0
|
0
|
|
|
|
|
my $banner=defined $_[1] ? $_[1] : "\n Please Pick an Item :";
|
2555
|
0
|
0
|
|
|
|
|
my $display_this_many_items=defined $_[2] ? $_[2] : 10;
|
2556
|
0
|
0
|
|
|
|
|
my $return_index_only_flag=(defined $_[3]) ? 1 : 0;
|
2557
|
0
|
0
|
|
|
|
|
my $log_handle= (defined $_[4]) ? $_[4] : '';
|
2558
|
|
|
|
|
|
|
|
2559
|
|
|
|
|
|
|
# Used Only With Cascasding Menus (Optional)
|
2560
|
0
|
0
|
|
|
|
|
my $MenuUnit_hash_ref= (defined $_[5]) ? $_[5] : {};
|
2561
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
2562
|
0
|
0
|
|
|
|
|
unless (grep { /Item_/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2563
|
0
|
0
|
|
|
|
|
if (grep { /Banner/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2564
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
2565
|
|
|
|
|
|
|
}
|
2566
|
|
|
|
|
|
|
}
|
2567
|
0
|
|
0
|
|
|
|
$MenuUnit_hash_ref->{Select}||={};
|
2568
|
0
|
0
|
|
|
|
|
my $recurse_level= (defined $_[6]) ? $_[6] : 1;
|
2569
|
0
|
0
|
|
|
|
|
my $picks_from_parent= (defined $_[7]) ? $_[7] : '';
|
2570
|
0
|
0
|
|
|
|
|
my $parent_menu= (defined $_[8]) ? $_[8] : '';
|
2571
|
0
|
0
|
|
|
|
|
my $FullMenu= (defined $_[9]) ? $_[9] : {};
|
2572
|
0
|
0
|
|
|
|
|
my $Selected= (defined $_[10]) ? $_[10] : {};
|
2573
|
0
|
0
|
|
|
|
|
my $Conveyed= (defined $_[11]) ? $_[11] : {};
|
2574
|
0
|
0
|
|
|
|
|
my $SavePick= (defined $_[12]) ? $_[12] : {};
|
2575
|
0
|
0
|
|
|
|
|
my $SaveMMap= (defined $_[13]) ? $_[13] : {};
|
2576
|
0
|
0
|
|
|
|
|
my $SaveNext= (defined $_[14]) ? $_[14] : {};
|
2577
|
0
|
0
|
|
|
|
|
my $Persists= (defined $_[15]) ? $_[15] : {};
|
2578
|
0
|
0
|
|
|
|
|
my $no_wantarray= (defined $_[16]) ? $_[16] : 0;
|
2579
|
0
|
0
|
|
|
|
|
my $sorted= (defined $_[17]) ? $_[17] : 0;
|
2580
|
0
|
0
|
|
|
|
|
my $select_many= (defined $_[18]) ? $_[18] : 0;
|
2581
|
|
|
|
|
|
|
|
2582
|
0
|
|
|
|
|
|
my %items=();my %picks=();my %negate=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2583
|
0
|
|
|
|
|
|
my %exclude=();my %include=();my %default=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2584
|
0
|
|
|
|
|
|
my %labels=();
|
2585
|
0
|
|
|
|
|
|
foreach my $menuhash (keys %{$FullMenu}) {
|
|
0
|
|
|
|
|
|
|
2586
|
0
|
|
|
|
|
|
my $name=&pw($FullMenu->{$menuhash}[0]);
|
2587
|
0
|
0
|
|
|
|
|
if ($name) {
|
2588
|
0
|
|
|
|
|
|
$FullMenu->{$menuhash}[0]->{Name}=$name;
|
2589
|
0
|
|
|
|
|
|
} else { next }
|
2590
|
0
|
|
|
|
|
|
$labels{$name}=$FullMenu->{$menuhash}[0];
|
2591
|
|
|
|
|
|
|
}
|
2592
|
0
|
0
|
0
|
|
|
|
if ($SavePick && exists $SavePick->{$MenuUnit_hash_ref}) {
|
2593
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
2594
|
|
|
|
|
|
|
}
|
2595
|
0
|
|
|
|
|
|
my $num_pick=$#all_menu_items_array+1;
|
2596
|
0
|
|
0
|
|
|
|
my $caller=(caller(1))[3]||'';
|
2597
|
0
|
|
|
|
|
|
my $numbor=0; # Number of Item Selected
|
2598
|
0
|
|
|
|
|
|
my $ikey=''; # rawInput Key - key used
|
2599
|
|
|
|
|
|
|
# to end menu. Can be
|
2600
|
|
|
|
|
|
|
# any non-alphanumeric
|
2601
|
|
|
|
|
|
|
# key like Enter or
|
2602
|
|
|
|
|
|
|
# Right Arrow.
|
2603
|
0
|
|
|
|
|
|
my $return_from_child_menu=0;
|
2604
|
|
|
|
|
|
|
|
2605
|
0
|
|
|
|
|
|
my $choose_num='';
|
2606
|
0
|
|
|
|
|
|
my $convey='';
|
2607
|
0
|
|
|
|
|
|
my $menu_output='';
|
2608
|
0
|
|
|
|
|
|
my $hidedefaults=0;
|
2609
|
|
|
|
|
|
|
my $start=($FullMenu->{$MenuUnit_hash_ref}[11])?
|
2610
|
0
|
0
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]:0;
|
2611
|
0
|
|
|
|
|
|
my $got_default=0;
|
2612
|
|
|
|
|
|
|
|
2613
|
|
|
|
|
|
|
sub delete_Selected
|
2614
|
|
|
|
|
|
|
{
|
2615
|
|
|
|
|
|
|
|
2616
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[2];
|
2617
|
0
|
|
|
|
|
|
my $SavePick=$_[3];
|
2618
|
0
|
|
|
|
|
|
my $SaveNext=$_[4];
|
2619
|
0
|
|
|
|
|
|
my $Persists=$_[5];
|
2620
|
0
|
0
|
|
|
|
|
if ($_[1]) {
|
2621
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$_[1]};
|
2622
|
0
|
|
|
|
|
|
delete $Selected->{$_[0]}{$_[1]};
|
2623
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$_[1]};
|
2624
|
0
|
0
|
|
|
|
|
if ($result) {
|
2625
|
0
|
|
|
|
|
|
&delete_Selected($result,'',
|
2626
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext);
|
2627
|
0
|
|
|
|
|
|
} delete $SaveNext->{$_[0]};
|
2628
|
|
|
|
|
|
|
} else {
|
2629
|
0
|
0
|
|
|
|
|
if (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2630
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2631
|
0
|
|
|
|
|
|
delete $Selected->{$_[0]}{$key};
|
2632
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$key};
|
2633
|
0
|
|
|
|
|
|
delete $SaveNext->{$_[0]};
|
2634
|
|
|
|
|
|
|
}
|
2635
|
|
|
|
|
|
|
} else {
|
2636
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SavePick->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2637
|
0
|
|
|
|
|
|
delete $SavePick->{$_[0]}{$key};
|
2638
|
0
|
|
|
|
|
|
delete $SaveNext->{$_[0]};
|
2639
|
|
|
|
|
|
|
}
|
2640
|
|
|
|
|
|
|
}
|
2641
|
0
|
|
|
|
|
|
} delete $SaveNext->{$_[0]};
|
2642
|
0
|
|
|
|
|
|
return $SaveNext;
|
2643
|
|
|
|
|
|
|
|
2644
|
|
|
|
|
|
|
}
|
2645
|
|
|
|
|
|
|
|
2646
|
|
|
|
|
|
|
sub find_Selected
|
2647
|
|
|
|
|
|
|
{
|
2648
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[2];
|
2649
|
0
|
0
|
|
|
|
|
if ($_[1]) {
|
2650
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$_[1]};
|
2651
|
0
|
0
|
0
|
|
|
|
if ($result=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2652
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2653
|
0
|
|
|
|
|
|
return 0;
|
2654
|
|
|
|
|
|
|
} else {
|
2655
|
0
|
|
|
|
|
|
return &find_Selected($result,'',$Selected);
|
2656
|
|
|
|
|
|
|
}
|
2657
|
|
|
|
|
|
|
} else {
|
2658
|
0
|
0
|
|
|
|
|
if (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2659
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected->{$_[0]}}) {
|
|
0
|
|
|
|
|
|
|
2660
|
0
|
|
|
|
|
|
my $result=$Selected->{$_[0]}{$key};
|
2661
|
|
|
|
|
|
|
#return '+' if substr($result,0,1) eq '&';
|
2662
|
0
|
0
|
0
|
|
|
|
if ($result=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
2663
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2664
|
0
|
|
|
|
|
|
return '+';
|
2665
|
|
|
|
|
|
|
}
|
2666
|
0
|
|
|
|
|
|
my $output=&find_Selected($result,'',$Selected);
|
2667
|
0
|
0
|
|
|
|
|
return '+' if $output eq '+';
|
2668
|
|
|
|
|
|
|
}
|
2669
|
|
|
|
|
|
|
}
|
2670
|
|
|
|
|
|
|
}
|
2671
|
|
|
|
|
|
|
}
|
2672
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
sub get_subs_from_menu
|
2674
|
|
|
|
|
|
|
{
|
2675
|
0
|
|
|
0
|
0
|
|
my $Selected=$_[0];
|
2676
|
0
|
|
|
|
|
|
my @subs=();
|
2677
|
0
|
|
|
|
|
|
foreach my $key (keys %{$Selected}) {
|
|
0
|
|
|
|
|
|
|
2678
|
0
|
|
|
|
|
|
foreach my $item (keys %{$Selected->{$key}}) {
|
|
0
|
|
|
|
|
|
|
2679
|
0
|
|
|
|
|
|
my $seltext=$Selected->{$key}{$item};
|
2680
|
0
|
0
|
0
|
|
|
|
if ($seltext=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ &&
|
|
|
0
|
|
|
|
|
|
2681
|
0
|
|
|
|
|
|
grep { $1 eq $_ } list_module('main',$Term::Menus::fa_code)) {
|
2682
|
0
|
|
|
|
|
|
push @subs, escape_quotes($seltext);
|
2683
|
|
|
|
|
|
|
} elsif (ref $seltext eq 'CODE') {
|
2684
|
0
|
|
|
|
|
|
push @subs, $seltext;
|
2685
|
|
|
|
|
|
|
}
|
2686
|
|
|
|
|
|
|
}
|
2687
|
|
|
|
|
|
|
}
|
2688
|
0
|
|
|
|
|
|
return @subs;
|
2689
|
|
|
|
|
|
|
}
|
2690
|
|
|
|
|
|
|
|
2691
|
|
|
|
|
|
|
my $get_result = sub {
|
2692
|
|
|
|
|
|
|
|
2693
|
|
|
|
|
|
|
# $_[0] => $MenuUnit_hash_ref
|
2694
|
|
|
|
|
|
|
# $_[1] => \@all_menu_items_array
|
2695
|
|
|
|
|
|
|
# $_[2] => $picks
|
2696
|
|
|
|
|
|
|
# $_[3] => $picks_from_parent
|
2697
|
|
|
|
|
|
|
|
2698
|
0
|
|
|
0
|
|
|
my $convey=[];
|
2699
|
0
|
|
|
|
|
|
my $FullMenu=$_[4];
|
2700
|
0
|
|
|
|
|
|
my $Conveyed=$_[5];
|
2701
|
0
|
|
|
|
|
|
my $Selected=$_[6];
|
2702
|
0
|
|
|
|
|
|
my $SaveNext=$_[7];
|
2703
|
0
|
|
|
|
|
|
my $Persists=$_[8];
|
2704
|
0
|
|
|
|
|
|
my $parent_menu=$_[9];
|
2705
|
0
|
|
0
|
|
|
|
my $pick=(keys %{$_[2]})[0] || 1;
|
2706
|
0
|
|
0
|
|
|
|
$_[1]->[$pick-1]||='';
|
2707
|
|
|
|
|
|
|
my $gotmany=(exists $MenuUnit_hash_ref->{Select} &&
|
2708
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Select}) ? 1 : 0;
|
2709
|
0
|
0
|
|
|
|
|
$FullMenu->{$_[0]}[3]={} unless $gotmany;
|
2710
|
0
|
0
|
0
|
|
|
|
if ($pick && exists $FullMenu->{$_[0]}[3]{$_[1]->[$pick-1]}) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2711
|
0
|
0
|
0
|
|
|
|
if ($pick && exists $_[0]->{$FullMenu->{$_[0]}
|
2712
|
|
|
|
|
|
|
[4]{$_[1]->[$pick-1]}}{Convey}) {
|
2713
|
0
|
|
|
|
|
|
my $contmp='';
|
2714
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %{$_[2]}]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2715
|
0
|
|
|
|
|
|
foreach my $numb (sort numerically keys %{$_[2]}) {
|
|
0
|
|
|
|
|
|
|
2716
|
0
|
|
|
|
|
|
$contmp=${${$FullMenu}{$_[0]}[3]}
|
|
0
|
|
|
|
|
|
|
2717
|
0
|
|
|
|
|
|
{${$_[1]}[$numb-1]}[0];
|
|
0
|
|
|
|
|
|
|
2718
|
0
|
|
|
|
|
|
$contmp=~s/\s?$//s;
|
2719
|
0
|
|
|
|
|
|
push @{$convey}, $contmp;
|
|
0
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
}
|
2721
|
|
|
|
|
|
|
} else {
|
2722
|
0
|
|
|
|
|
|
$convey=${${${$FullMenu}{$_[0]}[3]}{${$_[1]}[$pick-1]}}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2723
|
|
|
|
|
|
|
#$convey=$FullMenu->{$_[0]}[3]->{$_[1]->[$pick-1]}->[0];
|
2724
|
0
|
|
|
|
|
|
$convey=~s/\s?$//s;
|
2725
|
|
|
|
|
|
|
}
|
2726
|
0
|
0
|
|
|
|
|
$convey='SKIP' if $convey eq '';
|
2727
|
0
|
0
|
0
|
|
|
|
if (ref $convey eq 'ARRAY' && $#{$convey}==0) {
|
|
0
|
|
|
|
|
|
|
2728
|
0
|
|
|
|
|
|
$convey=$convey->[0];
|
2729
|
|
|
|
|
|
|
}
|
2730
|
|
|
|
|
|
|
}
|
2731
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2732
|
|
|
|
|
|
|
} elsif ($pick) {
|
2733
|
0
|
|
|
|
|
|
$convey=${$_[1]}[$pick-1];
|
|
0
|
|
|
|
|
|
|
2734
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2735
|
|
|
|
|
|
|
} elsif ($_[3]) {
|
2736
|
0
|
|
|
|
|
|
$convey=$_[3];
|
2737
|
0
|
|
|
|
|
|
$Conveyed->{&pw($_[0])}=$convey;
|
2738
|
|
|
|
|
|
|
}
|
2739
|
|
|
|
|
|
|
$convey='' if !$convey ||
|
2740
|
0
|
0
|
0
|
|
|
|
(ref $convey eq 'ARRAY' && $#{$convey}==-1);
|
|
0
|
|
0
|
|
|
|
|
2741
|
0
|
|
|
|
|
|
my $test_item='';my $show_banner_only=0;
|
|
0
|
|
|
|
|
|
|
2742
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$_[0]}[2]{'__FA_Banner__'}) {
|
|
|
0
|
|
|
|
|
|
2743
|
0
|
|
|
|
|
|
$test_item=$FullMenu->{$_[0]}[2]{'__FA_Banner__'};
|
2744
|
0
|
|
|
|
|
|
$show_banner_only=1;$pick=0;
|
|
0
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
} elsif ($pick) {
|
2746
|
0
|
|
|
|
|
|
$test_item=$FullMenu->{$_[0]}[2]{$_[1]->[$pick-1]};
|
2747
|
|
|
|
|
|
|
}
|
2748
|
0
|
|
0
|
|
|
|
$test_item||='';
|
2749
|
0
|
0
|
0
|
|
|
|
if (($pick &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2750
|
|
|
|
|
|
|
exists $FullMenu->{$_[0]}[2]{$_[1]->[$pick-1]} &&
|
2751
|
|
|
|
|
|
|
(ref $test_item eq 'HASH' &&
|
2752
|
0
|
|
|
|
|
|
(values %{$test_item})[0] ne 'recurse')) ||
|
2753
|
|
|
|
|
|
|
ref $test_item eq 'CODE') {
|
2754
|
0
|
0
|
0
|
|
|
|
if ((ref $test_item eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2755
|
|
|
|
|
|
|
((grep { /Item_/ } keys %{$test_item}) ||
|
2756
|
|
|
|
|
|
|
($show_banner_only && (grep { /Banner/ }
|
2757
|
|
|
|
|
|
|
keys %{$test_item}))))
|
2758
|
|
|
|
|
|
|
|| ($test_item=~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/
|
2759
|
0
|
|
|
|
|
|
&& grep { $1 eq $_ } list_module(
|
2760
|
|
|
|
|
|
|
'main',$Term::Menus::fa_code))
|
2761
|
|
|
|
|
|
|
|| ref $test_item eq 'CODE' ||
|
2762
|
|
|
|
|
|
|
&test_hashref($test_item)) {
|
2763
|
0
|
|
|
|
|
|
my $con_regex=qr/\]c(o+nvey)*\[/i;
|
2764
|
0
|
|
|
|
|
|
my $tpmi_regex=qr/\](!)?t(?:e+st[-_]*)*p*(?:r+vious[-_]*)
|
2765
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2766
|
0
|
|
|
|
|
|
my $sicm_regex=
|
2767
|
|
|
|
|
|
|
qr/\]s(e+lected[-_]*)*i*(t+ems[-_]*)
|
2768
|
|
|
|
|
|
|
*c*(u+rrent[-_]*)*m*(e+nu[-_]*)*\[/xi;
|
2769
|
0
|
|
|
|
|
|
my $pmsi_regex=qr/\](!)?p(?:r+evious[-_]*)*m*(?:e+nu[-_]*)
|
2770
|
|
|
|
|
|
|
*s*(?:e+lected[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2771
|
0
|
|
|
|
|
|
my $amlm_regex=qr/\]a(n+cestor[-_]*)*m*(e+nu[-_]*)
|
2772
|
|
|
|
|
|
|
*l*(a+bel[-_]*)*m*(a+p[-_]*)*\[/xi;
|
2773
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
2774
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
2775
|
0
|
0
|
|
|
|
|
if ($test_item=~/$con_regex|$pmsi_regex|
|
|
|
0
|
|
|
|
|
|
2776
|
|
|
|
|
|
|
$amlm_regex|$sicm_regex|$tpmi_regex|$tbii_regex/x) {
|
2777
|
0
|
|
|
|
|
|
$test_item=&transform_mbii($test_item,
|
2778
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2779
|
|
|
|
|
|
|
$picks_from_parent,$log_handle);
|
2780
|
|
|
|
|
|
|
$test_item=&transform_sicm($test_item,$numbor,
|
2781
|
|
|
|
|
|
|
\@all_menu_items_array,$_[2],'',
|
2782
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
2783
|
0
|
|
|
|
|
|
$_[0]->{Name});
|
2784
|
0
|
|
|
|
|
|
$test_item=&transform_pmsi($test_item,
|
2785
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2786
|
|
|
|
|
|
|
$picks_from_parent,$log_handle);
|
2787
|
0
|
|
|
|
|
|
$test_item=&transform_mbir($test_item,
|
2788
|
|
|
|
|
|
|
$Conveyed,$MenuUnit_hash_ref,$log_handle);
|
2789
|
|
|
|
|
|
|
} elsif (ref $test_item eq 'CODE') {
|
2790
|
0
|
|
|
|
|
|
my $cd='';
|
2791
|
|
|
|
|
|
|
#if ($Term::Menus::data_dump_streamer && (!$show_banner_only
|
2792
|
|
|
|
|
|
|
# || (exists $MenuUnit_hash_ref->{Input}
|
2793
|
|
|
|
|
|
|
# && $MenuUnit_hash_ref->{Input}==1))) {
|
2794
|
0
|
|
|
|
|
|
$cd=&Data::Dump::Streamer::Dump($test_item)->Out();
|
2795
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
2796
|
|
|
|
|
|
|
\@all_menu_items_array,$_[2],'',
|
2797
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
2798
|
0
|
|
|
|
|
|
$_[0]->{Name});
|
2799
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
2800
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
2801
|
|
|
|
|
|
|
$picks_from_parent);
|
2802
|
0
|
|
|
|
|
|
$cd=&transform_mbir($cd,$Conveyed,$MenuUnit_hash_ref,
|
2803
|
|
|
|
|
|
|
$log_handle);
|
2804
|
|
|
|
|
|
|
#}
|
2805
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
2806
|
|
|
|
|
|
|
#print "CD2=$cd<==\n";;
|
2807
|
0
|
|
|
|
|
|
eval { $test_item=eval $cd };
|
|
0
|
|
|
|
|
|
|
2808
|
0
|
0
|
|
|
|
|
if ($@) {
|
2809
|
0
|
0
|
|
|
|
|
if (unpack('a11',$@) eq 'FATAL ERROR') {
|
2810
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2811
|
|
|
|
|
|
|
-1
|
2812
|
0
|
|
|
|
|
|
print $log_handle $@;
|
2813
|
0
|
|
|
|
|
|
close($log_handle);
|
2814
|
|
|
|
|
|
|
}
|
2815
|
0
|
|
|
|
|
|
die $@;
|
2816
|
|
|
|
|
|
|
} else {
|
2817
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
2818
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname Conveyed\n"
|
2819
|
|
|
|
|
|
|
." the Following "
|
2820
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
2821
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
2822
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
2823
|
|
|
|
|
|
|
-1
|
2824
|
0
|
|
|
|
|
|
print $log_handle $die;
|
2825
|
0
|
|
|
|
|
|
close($log_handle);
|
2826
|
|
|
|
|
|
|
}
|
2827
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
0
|
0
|
|
|
|
|
2828
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,
|
2829
|
|
|
|
|
|
|
$SaveNext,$Persists,$Selected,
|
2830
|
|
|
|
|
|
|
$convey,$parent_menu;
|
2831
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto) {
|
2832
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
2833
|
0
|
|
|
|
|
|
} else { die $die }
|
2834
|
|
|
|
|
|
|
}
|
2835
|
|
|
|
|
|
|
}
|
2836
|
0
|
0
|
|
|
|
|
my $item=($show_banner_only)?'__FA_Banner__':$pick;
|
2837
|
0
|
|
|
|
|
|
$Selected->{$_[0]}->{$item}=$test_item;
|
2838
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,$SaveNext,
|
2839
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu;
|
2840
|
|
|
|
|
|
|
}
|
2841
|
0
|
0
|
|
|
|
|
if ($test_item=~/Convey\s*=\>/) {
|
2842
|
0
|
0
|
|
|
|
|
if ($convey ne 'SKIP') {
|
2843
|
0
|
|
|
|
|
|
$test_item=~s/Convey\s*=\>/$convey/g;
|
2844
|
|
|
|
|
|
|
} else {
|
2845
|
0
|
|
|
|
|
|
$test_item=~s/Convey\s*=\>/${$_[1]}[$pick-1]/g;
|
|
0
|
|
|
|
|
|
|
2846
|
|
|
|
|
|
|
}
|
2847
|
|
|
|
|
|
|
}
|
2848
|
0
|
0
|
|
|
|
|
if ($test_item=~/Text\s*=\>/) {
|
2849
|
0
|
|
|
|
|
|
$test_item=~s/Text\s*=\>/${$_[1]}[$pick-1]/g;
|
|
0
|
|
|
|
|
|
|
2850
|
|
|
|
|
|
|
}
|
2851
|
|
|
|
|
|
|
} else {
|
2852
|
|
|
|
|
|
|
my $die="The \"Result3 =>\" Setting\n -> "
|
2853
|
0
|
|
|
|
|
|
.$FullMenu->{$_[0]}[2]{$_[1]->[$_[2]-1]}
|
2854
|
|
|
|
|
|
|
."\n Found in the Menu Unit -> "
|
2855
|
|
|
|
|
|
|
.$MenuUnit_hash_ref
|
2856
|
|
|
|
|
|
|
."\n is not a Menu Unit\,"
|
2857
|
|
|
|
|
|
|
." and Because it Does Not Have"
|
2858
|
|
|
|
|
|
|
."\n an \"&\" as"
|
2859
|
|
|
|
|
|
|
." the Lead Character, $0"
|
2860
|
|
|
|
|
|
|
."\n Cannot Determine "
|
2861
|
|
|
|
|
|
|
."if it is a Valid SubRoutine.\n\n";
|
2862
|
0
|
|
|
|
|
|
die $die;
|
2863
|
|
|
|
|
|
|
}
|
2864
|
|
|
|
|
|
|
}
|
2865
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
2866
|
0
|
|
|
|
|
|
$Selected->{$_[0]}{'__FA_Banner__'}=$test_item;
|
2867
|
0
|
|
|
|
|
|
$SaveNext->{$_[0]}=$FullMenu->{$_[0]}[2]{'__FA_Banner__'};
|
2868
|
|
|
|
|
|
|
} else {
|
2869
|
0
|
0
|
|
|
|
|
chomp($pick) if $pick;
|
2870
|
0
|
0
|
|
|
|
|
$Selected->{$_[0]}{$pick}=$test_item if $pick;
|
2871
|
0
|
0
|
0
|
|
|
|
if ($pick && ref $_[0]->{$FullMenu->{$_[0]}
|
2872
|
|
|
|
|
|
|
[4]{$_[1]->[$pick-1]}}{'Result'} eq 'HASH') {
|
2873
|
|
|
|
|
|
|
$SaveNext->{$_[0]}=$FullMenu->{$_[0]}[2]
|
2874
|
0
|
|
|
|
|
|
{$_[1]->[$pick-1]};
|
2875
|
|
|
|
|
|
|
}
|
2876
|
|
|
|
|
|
|
}
|
2877
|
0
|
|
|
|
|
|
return $FullMenu,$Conveyed,$SaveNext,
|
2878
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu;
|
2879
|
0
|
|
|
|
|
|
};
|
2880
|
|
|
|
|
|
|
|
2881
|
0
|
|
|
|
|
|
my $filtered_menu=0;my $defaults_exist=0;my $input='';
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2882
|
0
|
|
|
|
|
|
while (1) {
|
2883
|
0
|
0
|
|
|
|
|
if ($num_pick-$start<=$display_this_many_items) {
|
2884
|
0
|
|
|
|
|
|
$choose_num=$num_pick-$start;
|
2885
|
0
|
|
|
|
|
|
} else { $choose_num=$display_this_many_items }
|
2886
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;my $done=0;my $savechk=0;my %pn=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2887
|
0
|
|
|
|
|
|
my $sorted_flag=0;
|
2888
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}={} unless exists
|
2889
|
0
|
0
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref};
|
2890
|
0
|
0
|
0
|
|
|
|
if (!exists $Persists->{$MenuUnit_hash_ref}{defaults} &&
|
2891
|
0
|
|
|
|
|
|
defined ${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0]) {
|
|
0
|
|
|
|
|
|
|
2892
|
0
|
|
|
|
|
|
my $it=${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2893
|
0
|
|
|
|
|
|
my $def=$FullMenu->{$MenuUnit_hash_ref}[5]{$it};
|
2894
|
0
|
0
|
|
|
|
|
if ($def) {
|
2895
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
2896
|
0
|
|
|
|
|
|
foreach my $item (
|
2897
|
0
|
|
|
|
|
|
@{[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}) {
|
|
0
|
|
|
|
|
|
|
2898
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
2899
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=1;
|
2900
|
|
|
|
|
|
|
}
|
2901
|
|
|
|
|
|
|
}
|
2902
|
|
|
|
|
|
|
}
|
2903
|
|
|
|
|
|
|
}
|
2904
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0 unless exists
|
2905
|
0
|
0
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults};
|
2906
|
0
|
|
|
|
|
|
my $plann='';my $plannn='';
|
|
0
|
|
|
|
|
|
|
2907
|
0
|
0
|
|
|
|
|
if (ref $Net::FullAuto::FA_Core::plan eq 'HASH') {
|
2908
|
0
|
|
|
|
|
|
my $plann=shift @{$Net::FullAuto::FA_Core::plan};
|
|
0
|
|
|
|
|
|
|
2909
|
0
|
|
|
|
|
|
$plannn=$plann->{Item};
|
2910
|
0
|
|
|
|
|
|
my $plan_='';
|
2911
|
0
|
0
|
|
|
|
|
if (substr($plannn,2,5) eq 'ARRAY') {
|
2912
|
0
|
|
|
|
|
|
my $eval_plan=substr($plannn,1,-1);
|
2913
|
0
|
|
|
|
|
|
$plan_=eval $eval_plan;
|
2914
|
0
|
0
|
|
|
|
|
&eval_error($@,$log_handle) if $@;
|
2915
|
|
|
|
|
|
|
} else {
|
2916
|
0
|
|
|
|
|
|
$plan_=$plannn;
|
2917
|
|
|
|
|
|
|
}
|
2918
|
0
|
|
|
|
|
|
return $plan_;
|
2919
|
|
|
|
|
|
|
}
|
2920
|
0
|
|
0
|
|
|
|
while ($numbor=~/\d+/ &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2921
|
|
|
|
|
|
|
($numbor<=$start || $start+$choose_num < $numbor ||
|
2922
|
|
|
|
|
|
|
$numbor eq 'admin') || $input) {
|
2923
|
0
|
|
|
|
|
|
my $menu_text='';my $picknum_for_display='';
|
|
0
|
|
|
|
|
|
|
2924
|
0
|
|
|
|
|
|
my $bout='';
|
2925
|
0
|
|
0
|
|
|
|
($bout,$input)=&banner($MenuUnit_hash_ref->{Banner}||$banner,
|
2926
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,$picks_from_parent,
|
2927
|
|
|
|
|
|
|
$numbor,$ikey,$input,$MenuUnit_hash_ref,$log_handle);
|
2928
|
0
|
|
|
|
|
|
$menu_text.=$bout."\n";
|
2929
|
0
|
|
|
|
|
|
my $picknum=$start+1;
|
2930
|
0
|
|
|
|
|
|
my $numlist=$choose_num;
|
2931
|
0
|
|
|
|
|
|
my $mark='';
|
2932
|
0
|
|
|
|
|
|
my $mark_len=$FullMenu->{$MenuUnit_hash_ref}[7]{BLANK};
|
2933
|
0
|
|
|
|
|
|
while ($mark_len--) {
|
2934
|
0
|
|
|
|
|
|
$mark.=' ';
|
2935
|
|
|
|
|
|
|
}
|
2936
|
0
|
|
|
|
|
|
my $mark_blank=$mark;
|
2937
|
0
|
|
|
|
|
|
my $mark_flg=0;my $prev_menu=0;
|
|
0
|
|
|
|
|
|
|
2938
|
0
|
0
|
|
|
|
|
$numlist=1 if $numbor eq 'admin';
|
2939
|
0
|
|
|
|
|
|
while (0 < $numlist) {
|
2940
|
0
|
0
|
|
|
|
|
if (exists $picks{$picknum}) {
|
2941
|
0
|
|
|
|
|
|
$mark_flg=1;
|
2942
|
0
|
0
|
|
|
|
|
if ($return_from_child_menu) {
|
2943
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2944
|
0
|
|
|
|
|
|
substr($mark,-1)=$picks{$picknum}=$return_from_child_menu;
|
2945
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%picks;
|
|
0
|
|
|
|
|
|
|
2946
|
0
|
|
|
|
|
|
$prev_menu=$picknum;
|
2947
|
|
|
|
|
|
|
#print "DO WE GET HERE3 and SEL=$MenuUnit_hash_ref->{Select}! and $return_from_child_menu\n";
|
2948
|
|
|
|
|
|
|
} else {
|
2949
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2950
|
0
|
|
|
|
|
|
substr($mark,-1)=$picks{$picknum};
|
2951
|
|
|
|
|
|
|
}
|
2952
|
|
|
|
|
|
|
#print "DO WE GET HERE4 and SEL=$MenuUnit_hash_ref->{Select}!\n";
|
2953
|
|
|
|
|
|
|
my $gotmany=($select_many ||
|
2954
|
0
|
0
|
0
|
|
|
|
(keys %{$MenuUnit_hash_ref->{Select}})) ? 1 : 0;
|
2955
|
0
|
0
|
0
|
|
|
|
if (($gotmany
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2956
|
|
|
|
|
|
|
&& $numbor=~/^[Ff]$/) || ($picks{$picknum} ne
|
2957
|
|
|
|
|
|
|
'+' && $picks{$picknum} ne '-' &&
|
2958
|
|
|
|
|
|
|
!$gotmany)) {
|
2959
|
|
|
|
|
|
|
#print "DO WE GET HERE5! and $MenuUnit_hash_ref->{Select}\n";
|
2960
|
0
|
|
|
|
|
|
$mark_flg=1;
|
2961
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2962
|
0
|
|
|
|
|
|
substr($mark,-1)='*';
|
2963
|
0
|
0
|
0
|
|
|
|
if ((exists $FullMenu->{$MenuUnit_hash_ref}[2]
|
|
|
|
0
|
|
|
|
|
2964
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) && ref
|
2965
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
2966
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]} eq 'HASH' &&
|
2967
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$FullMenu->
|
2968
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[3]})) {
|
2969
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[3]
|
2970
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
2971
|
|
|
|
|
|
|
$convey=$FullMenu->{$MenuUnit_hash_ref}[3]
|
2972
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}->[0];
|
2973
|
0
|
|
|
|
|
|
} else { $convey=$all_menu_items_array[$picknum-1] }
|
2974
|
0
|
|
|
|
|
|
eval {
|
2975
|
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
2976
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu($FullMenu->
|
2977
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
2978
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]},$convey,
|
2979
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
2980
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
2981
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
2982
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
2983
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 1
|
2984
|
0
|
0
|
|
|
|
|
print "MENU RETURN 1\n" if $menu_return_debug;
|
2985
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
2986
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
2987
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2988
|
0
|
|
|
|
|
|
$picks{$picknum}='-';
|
2989
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2990
|
0
|
|
|
|
|
|
substr($mark,-1)='-';
|
2991
|
0
|
|
|
|
|
|
$start=${$FullMenu}{$MenuUnit_hash_ref}[11];
|
|
0
|
|
|
|
|
|
|
2992
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
2993
|
0
|
|
|
|
|
|
$picks{$picknum}='+';
|
2994
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
2995
|
0
|
|
|
|
|
|
substr($mark,-1)='+';
|
2996
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
2997
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
2998
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
2999
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
3000
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
3001
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3).'::'
|
3002
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
3003
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3004
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3005
|
0
|
|
|
|
|
|
my @resu=();
|
3006
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3007
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3008
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3009
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'})
|
3010
|
|
|
|
|
|
|
&& defined
|
3011
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan) {
|
3012
|
|
|
|
|
|
|
#print "IN MAKEPLAN1\n";
|
3013
|
0
|
0
|
0
|
|
|
|
if (-1==
|
3014
|
|
|
|
|
|
|
$#{$Net::FullAuto::FA_Core::makeplan{
|
3015
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3016
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3017
|
|
|
|
|
|
|
'Title'}) {
|
3018
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3019
|
0
|
|
|
|
|
|
'Title'}=$pn{$numbor}[0];
|
3020
|
|
|
|
|
|
|
}
|
3021
|
0
|
|
|
|
|
|
my $n='Number';
|
3022
|
|
|
|
|
|
|
my $planid=
|
3023
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3024
|
0
|
|
|
|
|
|
$n};
|
3025
|
0
|
|
|
|
|
|
my $s=$sub;
|
3026
|
0
|
|
|
|
|
|
my $item=
|
3027
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(
|
3028
|
|
|
|
|
|
|
$s)->Out();
|
3029
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3030
|
0
|
|
|
|
|
|
'Plan'}},
|
3031
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3032
|
|
|
|
|
|
|
Number => $numbor,
|
3033
|
|
|
|
|
|
|
PlanID => $planid,
|
3034
|
|
|
|
|
|
|
Item => $item
|
3035
|
|
|
|
|
|
|
}
|
3036
|
|
|
|
|
|
|
}
|
3037
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
3038
|
0
|
0
|
|
|
|
|
if ($@) {
|
3039
|
0
|
0
|
0
|
|
|
|
if (10
|
3040
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3041
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3042
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3043
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,
|
3044
|
|
|
|
|
|
|
$Conveyed,$SavePick,$SaveMMap,
|
3045
|
|
|
|
|
|
|
$SaveNext,$Persists,
|
3046
|
|
|
|
|
|
|
$parent_menu,$@;
|
3047
|
|
|
|
|
|
|
}
|
3048
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3049
|
|
|
|
|
|
|
-1
|
3050
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3051
|
0
|
|
|
|
|
|
close($log_handle);
|
3052
|
|
|
|
|
|
|
}
|
3053
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3054
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3055
|
|
|
|
|
|
|
$@);
|
3056
|
0
|
|
|
|
|
|
} else { die $@ }
|
3057
|
|
|
|
|
|
|
} else {
|
3058
|
0
|
|
|
|
|
|
my $die=''
|
3059
|
|
|
|
|
|
|
."\n FATAL ERROR! - The Local "
|
3060
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname"
|
3061
|
|
|
|
|
|
|
." Conveyed\n"
|
3062
|
|
|
|
|
|
|
." the Following "
|
3063
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3064
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3065
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3066
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3067
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,
|
3068
|
|
|
|
|
|
|
$Conveyed,$SavePick,$SaveMMap,
|
3069
|
|
|
|
|
|
|
$SaveNext,$Persists,
|
3070
|
|
|
|
|
|
|
$parent_menu,$die;
|
3071
|
|
|
|
|
|
|
}
|
3072
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3073
|
|
|
|
|
|
|
-1
|
3074
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3075
|
0
|
|
|
|
|
|
close($log_handle);
|
3076
|
|
|
|
|
|
|
}
|
3077
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3078
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3079
|
|
|
|
|
|
|
$die);
|
3080
|
0
|
|
|
|
|
|
} else { die $die }
|
3081
|
|
|
|
|
|
|
}
|
3082
|
|
|
|
|
|
|
}
|
3083
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3084
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3085
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray &&
|
|
|
|
0
|
|
|
|
|
3086
|
|
|
|
|
|
|
!$no_wantarray) {
|
3087
|
0
|
|
|
|
|
|
return @resu;
|
3088
|
|
|
|
|
|
|
} else {
|
3089
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3090
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3091
|
0
|
|
|
|
|
|
} return 'DONE_SUB';
|
3092
|
|
|
|
|
|
|
}
|
3093
|
|
|
|
|
|
|
}
|
3094
|
0
|
|
|
|
|
|
eval {
|
3095
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
3096
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3097
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3098
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3099
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'})
|
3100
|
|
|
|
|
|
|
&& defined
|
3101
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan) {
|
3102
|
|
|
|
|
|
|
#print "IN MAKEPLAN2\n";
|
3103
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3104
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3105
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3106
|
|
|
|
|
|
|
'Title'}) {
|
3107
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3108
|
0
|
|
|
|
|
|
'Title'}=$pn{$numbor}[0];
|
3109
|
|
|
|
|
|
|
}
|
3110
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3111
|
0
|
|
|
|
|
|
'Plan'}},
|
3112
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3113
|
|
|
|
|
|
|
Number => $numbor,
|
3114
|
|
|
|
|
|
|
PlanID =>
|
3115
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3116
|
0
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
3117
|
|
|
|
|
|
|
}
|
3118
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
3119
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
3120
|
|
|
|
|
|
|
|
3121
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
3122
|
|
|
|
|
|
|
'Undefined subroutine') &&
|
3123
|
|
|
|
|
|
|
(-1
|
3124
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3125
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3126
|
|
|
|
|
|
|
} else {
|
3127
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3128
|
|
|
|
|
|
|
}
|
3129
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
3130
|
0
|
|
|
|
|
|
my $c=$Term::Menus::fa_code;
|
3131
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
3132
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}
|
3133
|
|
|
|
|
|
|
[2]{$all_menu_items_array[
|
3134
|
|
|
|
|
|
|
$numbor-1]}) {
|
3135
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
3136
|
|
|
|
|
|
|
."\n\t\t-> " . $FullMenu->
|
3137
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
3138
|
|
|
|
|
|
|
{$all_menu_items_array[
|
3139
|
|
|
|
|
|
|
$numbor-1]}
|
3140
|
|
|
|
|
|
|
."\n\t\tFound in the Menu "
|
3141
|
|
|
|
|
|
|
."Unit -> "
|
3142
|
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}
|
3143
|
0
|
|
|
|
|
|
."\n\t\t"
|
3144
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
3145
|
|
|
|
|
|
|
." that Does NOT Exist"
|
3146
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
3147
|
|
|
|
|
|
|
.$c.",\n\t\tnor was a routine "
|
3148
|
|
|
|
|
|
|
."with that name\n\t\tlocated"
|
3149
|
|
|
|
|
|
|
." in the main:: script.\n";
|
3150
|
|
|
|
|
|
|
} else {
|
3151
|
0
|
|
|
|
|
|
$die=
|
3152
|
|
|
|
|
|
|
"$firsterr\n $seconderr"
|
3153
|
|
|
|
|
|
|
}
|
3154
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
3155
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3156
|
|
|
|
|
|
|
$die);
|
3157
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
3158
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3159
|
|
|
|
|
|
|
$firsterr);
|
3160
|
|
|
|
|
|
|
}
|
3161
|
|
|
|
|
|
|
} else {
|
3162
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3163
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3164
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3165
|
|
|
|
|
|
|
} else {
|
3166
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3167
|
|
|
|
|
|
|
}
|
3168
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3169
|
|
|
|
|
|
|
}
|
3170
|
|
|
|
|
|
|
};
|
3171
|
0
|
0
|
|
|
|
|
if ($@) {
|
3172
|
0
|
0
|
0
|
|
|
|
if (10
|
3173
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3174
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3175
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3176
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3177
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3178
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3179
|
|
|
|
|
|
|
}
|
3180
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3181
|
|
|
|
|
|
|
-1
|
3182
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3183
|
0
|
|
|
|
|
|
close($log_handle);
|
3184
|
|
|
|
|
|
|
}
|
3185
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3186
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3187
|
0
|
|
|
|
|
|
} else { die $@ }
|
3188
|
|
|
|
|
|
|
} else {
|
3189
|
0
|
|
|
|
|
|
my $die=''
|
3190
|
|
|
|
|
|
|
."\n FATAL ERROR! - The Local "
|
3191
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3192
|
|
|
|
|
|
|
."Conveyed\n"
|
3193
|
|
|
|
|
|
|
." the Following "
|
3194
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3195
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3196
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray
|
|
|
|
0
|
|
|
|
|
3197
|
|
|
|
|
|
|
&& !$no_wantarray) {
|
3198
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3199
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3200
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3201
|
|
|
|
|
|
|
}
|
3202
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3203
|
|
|
|
|
|
|
-1
|
3204
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3205
|
0
|
|
|
|
|
|
close($log_handle);
|
3206
|
|
|
|
|
|
|
}
|
3207
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3208
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
3209
|
|
|
|
|
|
|
$die);
|
3210
|
0
|
|
|
|
|
|
} else { die $die }
|
3211
|
|
|
|
|
|
|
}
|
3212
|
|
|
|
|
|
|
}
|
3213
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3214
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3215
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3216
|
0
|
|
|
|
|
|
return @resu;
|
3217
|
|
|
|
|
|
|
} else {
|
3218
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3219
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3220
|
|
|
|
|
|
|
}
|
3221
|
|
|
|
|
|
|
}
|
3222
|
|
|
|
|
|
|
}
|
3223
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3224
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
3225
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
3226
|
0
|
|
|
|
|
|
return $menu_output;
|
3227
|
|
|
|
|
|
|
} else {
|
3228
|
0
|
|
|
|
|
|
$picks{$picknum}='+';
|
3229
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3230
|
0
|
|
|
|
|
|
substr($mark,-1)='+';
|
3231
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3232
|
|
|
|
|
|
|
}
|
3233
|
|
|
|
|
|
|
}
|
3234
|
|
|
|
|
|
|
}
|
3235
|
|
|
|
|
|
|
} else {
|
3236
|
0
|
|
|
|
|
|
$mark='';
|
3237
|
0
|
|
|
|
|
|
my $mark_len=$FullMenu->{$MenuUnit_hash_ref}[7]{BLANK};
|
3238
|
0
|
|
|
|
|
|
while ($mark_len--) {
|
3239
|
0
|
|
|
|
|
|
$mark.=' ';
|
3240
|
|
|
|
|
|
|
}
|
3241
|
|
|
|
|
|
|
}
|
3242
|
|
|
|
|
|
|
$mark=$FullMenu->{$MenuUnit_hash_ref}[7]
|
3243
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}
|
3244
|
|
|
|
|
|
|
if exists $FullMenu->{$MenuUnit_hash_ref}[7]
|
3245
|
0
|
0
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3246
|
0
|
0
|
0
|
|
|
|
if (!$hidedefaults &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3247
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[5] eq 'HASH'
|
3248
|
|
|
|
|
|
|
&& $FullMenu->{$MenuUnit_hash_ref}[5]
|
3249
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]} && ($FullMenu->
|
3250
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[5]{$all_menu_items_array[$picknum-1]}
|
3251
|
|
|
|
|
|
|
eq '*' || $all_menu_items_array[$picknum-1]=~
|
3252
|
|
|
|
|
|
|
/$FullMenu->{$MenuUnit_hash_ref}[5]{
|
3253
|
|
|
|
|
|
|
$all_menu_items_array[$picknum-1]}/)) {
|
3254
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3255
|
0
|
|
|
|
|
|
substr($mark,-1)='*';$mark_flg=1;
|
|
0
|
|
|
|
|
|
|
3256
|
0
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}{$picknum}='*';
|
3257
|
|
|
|
|
|
|
}
|
3258
|
0
|
|
|
|
|
|
$picknum_for_display=$picknum;
|
3259
|
0
|
0
|
0
|
|
|
|
if (ref $FullMenu->{$MenuUnit_hash_ref}[8] eq 'HASH'
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3260
|
0
|
|
|
|
|
|
&& keys %{$FullMenu->{$MenuUnit_hash_ref}[8]} &&
|
3261
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[8]
|
3262
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}
|
3263
|
|
|
|
|
|
|
&& $FullMenu->{$MenuUnit_hash_ref}[8]
|
3264
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
3265
|
|
|
|
|
|
|
$picknum_for_display=
|
3266
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[8]
|
3267
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3268
|
0
|
|
|
|
|
|
$mark=$mark_blank;
|
3269
|
0
|
0
|
0
|
|
|
|
if (exists $SavePick->{$MenuUnit_hash_ref}
|
3270
|
|
|
|
|
|
|
{$picknum_for_display} &&
|
3271
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}
|
3272
|
|
|
|
|
|
|
{$picknum_for_display}) {
|
3273
|
|
|
|
|
|
|
substr($mark,-1)=$SavePick->{$MenuUnit_hash_ref}
|
3274
|
0
|
|
|
|
|
|
{$picknum_for_display}
|
3275
|
0
|
|
|
|
|
|
} else { $mark=' ' }
|
3276
|
0
|
0
|
|
|
|
|
$mark_flg=1 unless $mark=~/^ +$/;
|
3277
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=1
|
3278
|
0
|
0
|
|
|
|
|
if $Persists->{$parent_menu}{defaults};
|
3279
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}[9]) {
|
3280
|
0
|
|
|
|
|
|
$filtered_menu=1;
|
3281
|
|
|
|
|
|
|
}
|
3282
|
|
|
|
|
|
|
}
|
3283
|
0
|
|
|
|
|
|
$pn{$picknum_for_display}=
|
3284
|
|
|
|
|
|
|
[ $all_menu_items_array[$picknum-1],$picknum ];
|
3285
|
0
|
|
|
|
|
|
my $scroll=' ';
|
3286
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Scroll}
|
|
|
|
0
|
|
|
|
|
3287
|
|
|
|
|
|
|
&& ($MenuUnit_hash_ref->{Scroll}->[1] eq $picknum
|
3288
|
|
|
|
|
|
|
|| $MenuUnit_hash_ref->{Scroll}->[0] eq $picknum)) {
|
3289
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref->{Scroll}->[0]) {
|
3290
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref->{Scroll}->[0] eq $picknum) {
|
3291
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$picknum;
|
3292
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[0]=0;
|
3293
|
0
|
|
|
|
|
|
$scroll='>';
|
3294
|
|
|
|
|
|
|
}
|
3295
|
|
|
|
|
|
|
} else {
|
3296
|
0
|
|
|
|
|
|
$scroll='>';
|
3297
|
|
|
|
|
|
|
}
|
3298
|
|
|
|
|
|
|
}
|
3299
|
0
|
|
|
|
|
|
my $picknum_display=sprintf "%-7s",$picknum_for_display;
|
3300
|
0
|
|
|
|
|
|
$menu_text.=" $scroll$mark $picknum_display"
|
3301
|
|
|
|
|
|
|
."$all_menu_items_array[$picknum-1]\n";
|
3302
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$MenuUnit_hash_ref}[6]
|
3303
|
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]}) {
|
3304
|
|
|
|
|
|
|
my $tstt=$FullMenu->{$MenuUnit_hash_ref}[6]
|
3305
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
3306
|
0
|
0
|
|
|
|
|
if ($tstt=~/many/i) {
|
3307
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Select}{$picknum_for_display}='many';
|
3308
|
|
|
|
|
|
|
}
|
3309
|
|
|
|
|
|
|
}
|
3310
|
0
|
0
|
0
|
|
|
|
if ($mark=~/^ +$/ || (exists $picks{$picknum} ||
|
|
|
|
0
|
|
|
|
|
3311
|
|
|
|
|
|
|
exists $picks{$picknum_for_display})) {
|
3312
|
0
|
|
|
|
|
|
${$_[0]}[$picknum_for_display-1]=
|
|
0
|
|
|
|
|
|
|
3313
|
|
|
|
|
|
|
$all_menu_items_array[$picknum-1];
|
3314
|
|
|
|
|
|
|
}
|
3315
|
0
|
|
|
|
|
|
$picknum++;
|
3316
|
0
|
|
|
|
|
|
$numlist--;
|
3317
|
0
|
|
|
|
|
|
} $hidedefaults=1;$picknum--;
|
|
0
|
|
|
|
|
|
|
3318
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3319
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
3320
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
3321
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan &&
|
3322
|
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults} &&
|
3323
|
|
|
|
|
|
|
!$filtered_menu) {
|
3324
|
0
|
|
|
|
|
|
my %askmenu=(
|
3325
|
|
|
|
|
|
|
|
3326
|
|
|
|
|
|
|
Item_1 => {
|
3327
|
|
|
|
|
|
|
|
3328
|
|
|
|
|
|
|
Text => "Use the result saved with the \"Plan\""
|
3329
|
|
|
|
|
|
|
|
3330
|
|
|
|
|
|
|
},
|
3331
|
|
|
|
|
|
|
Item_2 => {
|
3332
|
|
|
|
|
|
|
|
3333
|
|
|
|
|
|
|
Text => "Use the \"Default\" setting to determine result"
|
3334
|
|
|
|
|
|
|
|
3335
|
|
|
|
|
|
|
},
|
3336
|
|
|
|
|
|
|
NoPlan => 1,
|
3337
|
|
|
|
|
|
|
Banner => " FullAuto has determined that the ".
|
3338
|
|
|
|
|
|
|
&pw($MenuUnit_hash_ref) .
|
3339
|
|
|
|
|
|
|
" Menu has been\n".
|
3340
|
|
|
|
|
|
|
" configured with a \"Default\" setting."
|
3341
|
|
|
|
|
|
|
|
3342
|
|
|
|
|
|
|
);
|
3343
|
0
|
|
|
|
|
|
my $answ=Menu(\%askmenu);
|
3344
|
0
|
0
|
|
|
|
|
if ($answ eq ']quit[') {
|
3345
|
0
|
|
|
|
|
|
return ']quit['
|
3346
|
|
|
|
|
|
|
}
|
3347
|
0
|
0
|
|
|
|
|
if (-1==index $answ,'result saved') {
|
3348
|
|
|
|
|
|
|
#print "IN MAKEPLAN3\n";
|
3349
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
3350
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
3351
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=$pn{$numbor}[0];
|
3352
|
|
|
|
|
|
|
}
|
3353
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
3354
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3355
|
|
|
|
|
|
|
Number => 'Default',
|
3356
|
|
|
|
|
|
|
PlanID =>
|
3357
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3358
|
0
|
|
|
|
|
|
Item => '' };
|
3359
|
0
|
|
|
|
|
|
$got_default=1;
|
3360
|
|
|
|
|
|
|
}
|
3361
|
|
|
|
|
|
|
}
|
3362
|
0
|
0
|
|
|
|
|
unless ($Persists->{unattended}) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3363
|
0
|
0
|
|
|
|
|
if ($^O ne 'cygwin') {
|
3364
|
0
|
0
|
|
|
|
|
unless ($noclear) {
|
3365
|
0
|
0
|
0
|
|
|
|
if ($^O eq 'MSWin32' || $^O eq 'MSWin64') {
|
3366
|
0
|
|
|
|
|
|
system("cmd /c cls");
|
3367
|
0
|
|
|
|
|
|
print "\n";
|
3368
|
|
|
|
|
|
|
} else {
|
3369
|
0
|
|
|
|
|
|
print `${Term::Menus::clearpath}clear`."\n";
|
3370
|
0
|
|
|
|
|
|
print $blanklines
|
3371
|
|
|
|
|
|
|
}
|
3372
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3373
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3374
|
0
|
|
|
|
|
|
print $menu_text;my $ch=0;
|
|
0
|
|
|
|
|
|
|
3375
|
0
|
0
|
0
|
|
|
|
if ($select_many || (keys %{${$MenuUnit_hash_ref}{Select}})) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3376
|
0
|
|
|
|
|
|
print "\n";
|
3377
|
0
|
0
|
|
|
|
|
unless (keys %{$FullMenu->{$MenuUnit_hash_ref}[1]}) {
|
|
0
|
|
|
|
|
|
|
3378
|
0
|
|
|
|
|
|
print " a. Select All";$ch=1;
|
|
0
|
|
|
|
|
|
|
3379
|
|
|
|
|
|
|
}
|
3380
|
0
|
0
|
0
|
|
|
|
if ($mark_flg==1 || $Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3381
|
0
|
|
|
|
|
|
print " c. Clear All";#print "\n" if $ch;
|
3382
|
|
|
|
|
|
|
}
|
3383
|
0
|
|
|
|
|
|
print " f. FINISH\n";
|
3384
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3385
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3386
|
|
|
|
|
|
|
}
|
3387
|
0
|
0
|
0
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults} &&
|
3388
|
|
|
|
|
|
|
!$filtered_menu) {
|
3389
|
0
|
|
|
|
|
|
print "\n == Default Selections Exist! == ",
|
3390
|
|
|
|
|
|
|
"(Type '*' to view them)\n";
|
3391
|
|
|
|
|
|
|
}
|
3392
|
|
|
|
|
|
|
} else {
|
3393
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
|
|
0
|
|
|
|
|
|
3394
|
0
|
|
|
|
|
|
print "\n",
|
3395
|
|
|
|
|
|
|
" c. Clear Default Selection.",
|
3396
|
|
|
|
|
|
|
" f. FINISH with Default Selection.\n";
|
3397
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3398
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3399
|
|
|
|
|
|
|
} else {
|
3400
|
0
|
|
|
|
|
|
print "\n == Default Selection Exists! == ",
|
3401
|
|
|
|
|
|
|
"(Type '*' to view it)\n";
|
3402
|
|
|
|
|
|
|
}
|
3403
|
|
|
|
|
|
|
} elsif ($filtered_menu) {
|
3404
|
0
|
|
|
|
|
|
print "\n (Type '<' to return to previous Menu)\n";
|
3405
|
|
|
|
|
|
|
}
|
3406
|
|
|
|
|
|
|
}
|
3407
|
0
|
0
|
|
|
|
|
if ($display_this_many_items<$num_pick) {
|
3408
|
0
|
|
|
|
|
|
my $len=length $num_pick;my $pad='';
|
|
0
|
|
|
|
|
|
|
3409
|
0
|
|
|
|
|
|
foreach my $n (1..$len) {
|
3410
|
0
|
|
|
|
|
|
$pad.=' ';
|
3411
|
|
|
|
|
|
|
}
|
3412
|
0
|
|
|
|
|
|
print $pad,
|
3413
|
|
|
|
|
|
|
"\n $num_pick Total Choices ",
|
3414
|
|
|
|
|
|
|
"[v][^] Scroll with ARROW keys ".
|
3415
|
|
|
|
|
|
|
" [F1] for HELP\n";
|
3416
|
0
|
|
|
|
|
|
} else { print "\n \(Press [F1] for HELP\)\n" }
|
3417
|
0
|
0
|
|
|
|
|
if ($Term::Menus::term_input) {
|
3418
|
0
|
|
|
|
|
|
print "\n";
|
3419
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Input} &&
|
|
|
0
|
|
|
|
|
|
3420
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Input}) {
|
3421
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3422
|
|
|
|
|
|
|
" Press ENTER when finished ",1);
|
3423
|
0
|
0
|
0
|
|
|
|
next unless ($ikey eq 'ENTER' || $ikey eq 'ESC' ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3424
|
|
|
|
|
|
|
$ikey eq 'UPARROW' || $ikey eq 'DOWNARROW' ||
|
3425
|
|
|
|
|
|
|
$ikey eq 'LEFTARROW' || $ikey eq 'RIGHTARROW' ||
|
3426
|
|
|
|
|
|
|
$ikey eq 'F1');
|
3427
|
|
|
|
|
|
|
} elsif ($show_banner_only) {
|
3428
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3429
|
|
|
|
|
|
|
" Press ENTER to continue ... ");
|
3430
|
|
|
|
|
|
|
|
3431
|
|
|
|
|
|
|
} else {
|
3432
|
0
|
|
|
|
|
|
($numbor,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3433
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ");
|
3434
|
|
|
|
|
|
|
}
|
3435
|
0
|
|
|
|
|
|
print "\n";
|
3436
|
|
|
|
|
|
|
} else {
|
3437
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
3438
|
0
|
|
|
|
|
|
print "\n \([ESC] to Quit\)",
|
3439
|
|
|
|
|
|
|
" Press ENTER to continue ... ";
|
3440
|
|
|
|
|
|
|
} else {
|
3441
|
0
|
|
|
|
|
|
print "\n \([ESC] to Quit\)",
|
3442
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ";
|
3443
|
|
|
|
|
|
|
}
|
3444
|
0
|
|
|
|
|
|
$numbor=;
|
3445
|
0
|
|
|
|
|
|
} $picknum_for_display=$numbor;chomp $picknum_for_display;
|
|
0
|
|
|
|
|
|
|
3446
|
0
|
|
|
|
|
|
} elsif ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3447
|
0
|
|
|
|
|
|
$numbor='f';
|
3448
|
0
|
0
|
|
|
|
|
} elsif (wantarray && !$no_wantarray) {
|
3449
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - 'Unattended' mode cannot be\n"
|
3450
|
|
|
|
|
|
|
." used without a Plan or Default\n"
|
3451
|
|
|
|
|
|
|
." Selections being available.";
|
3452
|
0
|
|
|
|
|
|
return '',$die;
|
3453
|
|
|
|
|
|
|
} else {
|
3454
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - 'Unattended' mode cannot be\n"
|
3455
|
|
|
|
|
|
|
." used without a Plan or Default\n"
|
3456
|
|
|
|
|
|
|
." Selections being available.";
|
3457
|
0
|
|
|
|
|
|
die($die);
|
3458
|
|
|
|
|
|
|
}
|
3459
|
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
|
|
|
|
|
3460
|
|
|
|
|
|
|
($Persists->{$MenuUnit_hash_ref}{defaults} ||
|
3461
|
|
|
|
|
|
|
$filtered_menu)) {
|
3462
|
|
|
|
|
|
|
# FINISH
|
3463
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
3464
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
3465
|
0
|
|
|
|
|
|
my $choice='';my @keys=();
|
|
0
|
|
|
|
|
|
|
3466
|
0
|
|
|
|
|
|
my $chosen='';
|
3467
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3468
|
0
|
|
|
|
|
|
$chosen=$parent_menu;
|
3469
|
0
|
|
|
|
|
|
return '-',
|
3470
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
3471
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3472
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
3473
|
0
|
|
|
|
|
|
} else { $chosen=$MenuUnit_hash_ref }
|
3474
|
0
|
|
|
|
|
|
@keys=keys %picks;
|
3475
|
0
|
0
|
|
|
|
|
if (-1==$#keys) {
|
3476
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3477
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3478
|
0
|
|
|
|
|
|
$chosen=$parent_menu;
|
3479
|
|
|
|
|
|
|
}
|
3480
|
0
|
|
|
|
|
|
my $it=${[keys %{${$FullMenu}{$chosen}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3481
|
0
|
|
|
|
|
|
my $def=${$FullMenu}{$chosen}[5]{$it};
|
|
0
|
|
|
|
|
|
|
3482
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
3483
|
0
|
0
|
|
|
|
|
if ($def) {
|
3484
|
0
|
|
|
|
|
|
my $cnt=1;
|
3485
|
0
|
|
|
|
|
|
foreach my $item (@all_menu_items_array) {
|
3486
|
|
|
|
|
|
|
#sort @{[keys %{${$FullMenu}{$chosen}[5]}]}) {
|
3487
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
3488
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
3489
|
0
|
|
|
|
|
|
push @keys, $item;
|
3490
|
0
|
|
|
|
|
|
} $cnt++
|
3491
|
|
|
|
|
|
|
}
|
3492
|
|
|
|
|
|
|
}
|
3493
|
|
|
|
|
|
|
} else {
|
3494
|
0
|
|
|
|
|
|
@keys=keys %{$SavePick->{$parent_menu}};
|
|
0
|
|
|
|
|
|
|
3495
|
0
|
0
|
|
|
|
|
if (-1==$#keys) {
|
3496
|
0
|
0
|
|
|
|
|
if ($^O ne 'cygwin') {
|
3497
|
0
|
0
|
|
|
|
|
unless ($noclear) {
|
3498
|
0
|
0
|
0
|
|
|
|
if ($^O eq 'MSWin32' || $^O eq 'MSWin64') {
|
3499
|
0
|
|
|
|
|
|
system("cmd /c cls");
|
3500
|
0
|
|
|
|
|
|
print "\n";
|
3501
|
|
|
|
|
|
|
} else {
|
3502
|
0
|
|
|
|
|
|
print `${Term::Menus::clearpath}clear`."\n";
|
3503
|
|
|
|
|
|
|
}
|
3504
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3505
|
0
|
|
|
|
|
|
} else { print $blanklines }
|
3506
|
0
|
|
|
|
|
|
print "\n\n Attention USER! :\n\n ",
|
3507
|
|
|
|
|
|
|
"You have selected \"f\" to finish your\n",
|
3508
|
|
|
|
|
|
|
" selections, BUT -> You have not actually\n",
|
3509
|
|
|
|
|
|
|
" selected anything!\n\n Do you wish ",
|
3510
|
|
|
|
|
|
|
"to quit or re-attempt selecting?\n\n ",
|
3511
|
|
|
|
|
|
|
"Press [ESC] to quit or ENTER to continue ... ";
|
3512
|
0
|
0
|
|
|
|
|
if ($Term::Menus::term_input) {
|
3513
|
0
|
|
|
|
|
|
print "\n";
|
3514
|
0
|
|
|
|
|
|
($choice,$ikey)=rawInput(" \([ESC] to Quit\)".
|
3515
|
|
|
|
|
|
|
" PLEASE ENTER A CHOICE: ");
|
3516
|
0
|
|
|
|
|
|
print "\n";
|
3517
|
|
|
|
|
|
|
} else {
|
3518
|
0
|
|
|
|
|
|
print " \([ESC] to Quit\)",
|
3519
|
|
|
|
|
|
|
"\n PLEASE ENTER A CHOICE: ";
|
3520
|
0
|
|
|
|
|
|
$choice=;
|
3521
|
|
|
|
|
|
|
}
|
3522
|
0
|
|
|
|
|
|
chomp($choice);
|
3523
|
0
|
0
|
|
|
|
|
next if lc($choice) ne 'quit';
|
3524
|
0
|
|
|
|
|
|
return ']quit['
|
3525
|
|
|
|
|
|
|
}
|
3526
|
|
|
|
|
|
|
}
|
3527
|
|
|
|
|
|
|
}
|
3528
|
0
|
|
|
|
|
|
my $return_values=0;
|
3529
|
0
|
|
|
0
|
0
|
|
sub numerically { $a <=> $b }
|
3530
|
0
|
|
|
|
|
|
my %dupseen=();my @pickd=();
|
|
0
|
|
|
|
|
|
|
3531
|
0
|
|
|
|
|
|
foreach my $pk (sort numerically keys %picks) {
|
3532
|
|
|
|
|
|
|
$return_values=1 if !exists
|
3533
|
0
|
|
|
|
|
|
${$FullMenu}{$chosen}[2]{${$_[0]}[$pk-1]}
|
|
0
|
|
|
|
|
|
|
3534
|
|
|
|
|
|
|
|| !keys
|
3535
|
0
|
0
|
0
|
|
|
|
%{${$FullMenu}{$chosen}[2]{${$_[0]}[$pk-1]}};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3536
|
0
|
0
|
0
|
|
|
|
if (${${$FullMenu}{$parent_menu}[10]}[$pk-1] &&
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
3537
|
0
|
|
|
|
|
|
!${$_[0]}[$pk-1]) {
|
3538
|
0
|
|
|
|
|
|
my $txt=${${$FullMenu}{$parent_menu}[10]}[$pk-1];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3539
|
0
|
0
|
|
|
|
|
if (-1
|
3540
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3541
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3542
|
|
|
|
|
|
|
}
|
3543
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3544
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3545
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3546
|
0
|
|
|
|
|
|
} elsif (${$_[0]}[$pk-1]) {
|
3547
|
0
|
|
|
|
|
|
my $txt=${$_[0]}[$pk-1];
|
|
0
|
|
|
|
|
|
|
3548
|
0
|
0
|
|
|
|
|
if (-1
|
3549
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3550
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3551
|
|
|
|
|
|
|
}
|
3552
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3553
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3554
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3555
|
|
|
|
|
|
|
} elsif ($pn{$picknum}) {
|
3556
|
0
|
|
|
|
|
|
my $txt=$pn{$picknum}[0];
|
3557
|
0
|
0
|
|
|
|
|
if (-1
|
3558
|
0
|
|
|
|
|
|
my $lhn=$Term::Menus::local_hostname;
|
3559
|
0
|
|
|
|
|
|
$txt=~s/__Master_${$}__/Local-Host: $lhn/sg;
|
3560
|
|
|
|
|
|
|
}
|
3561
|
0
|
0
|
|
|
|
|
unless (exists $dupseen{$txt}) {
|
3562
|
0
|
|
|
|
|
|
push @pickd, $txt;
|
3563
|
0
|
|
|
|
|
|
} $dupseen{$txt}='';
|
3564
|
|
|
|
|
|
|
}
|
3565
|
|
|
|
|
|
|
}
|
3566
|
0
|
0
|
0
|
|
|
|
if ($return_values && $Term::Menus::fullauto &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3567
|
|
|
|
|
|
|
(!exists ${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3568
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3569
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3570
|
|
|
|
|
|
|
#print "IN MAKEPLAN4\n";
|
3571
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
3572
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
3573
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=
|
3574
|
|
|
|
|
|
|
"Multiple Selections";
|
3575
|
|
|
|
|
|
|
}
|
3576
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
3577
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
3578
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3579
|
|
|
|
|
|
|
Number => 'Multiple',
|
3580
|
|
|
|
|
|
|
PlanID =>
|
3581
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
3582
|
0
|
|
|
|
|
|
Item => "'".
|
3583
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(\@pickd)->Out().
|
3584
|
|
|
|
|
|
|
"'" }
|
3585
|
|
|
|
|
|
|
}
|
3586
|
|
|
|
|
|
|
}
|
3587
|
0
|
0
|
|
|
|
|
return \@pickd if $return_values;
|
3588
|
0
|
|
|
|
|
|
return 'DONE';
|
3589
|
|
|
|
|
|
|
} elsif ($numbor=~/^\s*%(.*)/s) {
|
3590
|
|
|
|
|
|
|
# PERCENT SYMBOL SORT ORDER
|
3591
|
0
|
|
0
|
|
|
|
my $one=$1||'';
|
3592
|
0
|
|
|
|
|
|
chomp $one;
|
3593
|
0
|
0
|
|
|
|
|
$one=qr/$one/ if $one;
|
3594
|
0
|
|
|
|
|
|
my @spl=();
|
3595
|
0
|
|
|
|
|
|
chomp $numbor;
|
3596
|
0
|
|
|
|
|
|
my $cnt=0;my $ct=0;my @splice=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3597
|
0
|
|
|
|
|
|
my $sort_ed='';
|
3598
|
0
|
0
|
0
|
|
|
|
if ($one) {
|
|
|
0
|
|
|
|
|
|
3599
|
|
|
|
|
|
|
|
3600
|
|
|
|
|
|
|
} elsif ($sorted && $sorted eq 'forward') {
|
3601
|
0
|
|
|
|
|
|
@spl=reverse @all_menu_items_array;$sort_ed='reverse';
|
|
0
|
|
|
|
|
|
|
3602
|
0
|
|
|
|
|
|
} else { @spl=sort @all_menu_items_array;$sort_ed='forward' }
|
|
0
|
|
|
|
|
|
|
3603
|
0
|
0
|
|
|
|
|
next if $#spl==-1;
|
3604
|
0
|
|
|
|
|
|
my %sort=();
|
3605
|
0
|
|
|
|
|
|
foreach my $line (@all_menu_items_array) {
|
3606
|
0
|
|
|
|
|
|
$cnt++;
|
3607
|
0
|
0
|
0
|
|
|
|
if (exists $pn{$picknum} &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3608
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[8]
|
3609
|
|
|
|
|
|
|
{$pn{$picknum}[0]} && $FullMenu->
|
3610
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$pn{$picknum}[0]} &&
|
3611
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[8]
|
3612
|
|
|
|
|
|
|
{$pn{$picknum}[0]} eq 'HASH' &&
|
3613
|
|
|
|
|
|
|
keys %{$FullMenu->{$MenuUnit_hash_ref}[8]
|
3614
|
0
|
|
|
|
|
|
{$pn{$picknum}[0]}} && $FullMenu->
|
3615
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$pn{$picknum}[0]}) {
|
3616
|
0
|
|
|
|
|
|
$sort{$line}=$FullMenu->{$MenuUnit_hash_ref}[8]{$line};
|
3617
|
0
|
|
|
|
|
|
} else { $sort{$line}=$cnt }
|
3618
|
0
|
|
|
|
|
|
} $cnt=0;
|
3619
|
0
|
|
|
|
|
|
my $chosen='';
|
3620
|
0
|
0
|
|
|
|
|
if (!$sorted) {
|
3621
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
3622
|
|
|
|
|
|
|
$chosen={
|
3623
|
|
|
|
|
|
|
Select => $send_select,
|
3624
|
0
|
|
|
|
|
|
Banner => ${$MenuUnit_hash_ref}{Banner},
|
3625
|
0
|
|
|
|
|
|
};
|
3626
|
0
|
|
|
|
|
|
my $cnt=0;
|
3627
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
3628
|
0
|
|
|
|
|
|
my $num=$sort{$text};
|
3629
|
0
|
|
|
|
|
|
$cnt++;
|
3630
|
0
|
0
|
|
|
|
|
if (exists $picks{$num}) {
|
3631
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3632
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
3633
|
|
|
|
|
|
|
} else {
|
3634
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3635
|
|
|
|
|
|
|
{ Text => $text,__NUM__=>$num };
|
3636
|
|
|
|
|
|
|
}
|
3637
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
3638
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3639
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
3640
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3641
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3642
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Sort}=$sort_ed;
|
3643
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
3644
|
0
|
|
|
|
|
|
} $sorted=$sort_ed;
|
3645
|
|
|
|
|
|
|
} else {
|
3646
|
0
|
|
|
|
|
|
@all_menu_items_array=reverse @all_menu_items_array;
|
3647
|
0
|
|
|
|
|
|
next;
|
3648
|
|
|
|
|
|
|
}
|
3649
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
3650
|
0
|
|
|
|
|
|
my @return_from_filtered_menu=();
|
3651
|
0
|
|
|
|
|
|
eval {
|
3652
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3653
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3654
|
|
|
|
|
|
|
@return_from_filtered_menu)=&Menu(
|
3655
|
|
|
|
|
|
|
$chosen,$picks_from_parent,
|
3656
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
3657
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3658
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3659
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
3660
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 2
|
3661
|
0
|
0
|
|
|
|
|
print "MENU RETURN 2\n" if $menu_return_debug;
|
3662
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3663
|
0
|
0
|
|
|
|
|
if (-1<$#return_from_filtered_menu) {
|
3664
|
0
|
0
|
|
|
|
|
if ((values %{$menu_output})[0] eq 'recurse') {
|
|
0
|
|
|
|
|
|
|
3665
|
0
|
|
|
|
|
|
my %k=%{$menu_output};
|
|
0
|
|
|
|
|
|
|
3666
|
0
|
|
|
|
|
|
delete $k{Menu};
|
3667
|
0
|
|
|
|
|
|
my $lab=(keys %k)[0];
|
3668
|
0
|
|
|
|
|
|
$menu_output=$labels{$lab};
|
3669
|
|
|
|
|
|
|
}
|
3670
|
0
|
|
|
|
|
|
$MenuMap=$Persists->{$MenuUnit_hash_ref};
|
3671
|
0
|
|
|
|
|
|
eval {
|
3672
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3673
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu(
|
3674
|
|
|
|
|
|
|
$menu_output,$FullMenu,
|
3675
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3676
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3677
|
|
|
|
|
|
|
$return_from_filtered_menu[0],
|
3678
|
|
|
|
|
|
|
$MenuUnit_hash_ref,
|
3679
|
|
|
|
|
|
|
$return_from_filtered_menu[2]);
|
3680
|
|
|
|
|
|
|
};
|
3681
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3682
|
|
|
|
|
|
|
}
|
3683
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
3684
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3685
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$chosen}};
|
|
0
|
|
|
|
|
|
|
3686
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3687
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
3688
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$chosen}};
|
|
0
|
|
|
|
|
|
|
3689
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3690
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3691
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
3692
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3693
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
3694
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
3695
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
3696
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
3697
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3698
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3699
|
0
|
|
|
|
|
|
my @resu=();
|
3700
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3701
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3702
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3703
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3704
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3705
|
|
|
|
|
|
|
#print "IN MAKEPLAN5\n";
|
3706
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3707
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3708
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3709
|
|
|
|
|
|
|
'Title'}) {
|
3710
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3711
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3712
|
|
|
|
|
|
|
}
|
3713
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3714
|
0
|
|
|
|
|
|
'Plan'}},
|
3715
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3716
|
|
|
|
|
|
|
Number => $numbor,
|
3717
|
|
|
|
|
|
|
PlanID =>
|
3718
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3719
|
0
|
|
|
|
|
|
'Number'},
|
3720
|
|
|
|
|
|
|
Item =>
|
3721
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
3722
|
|
|
|
|
|
|
}
|
3723
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
3724
|
0
|
0
|
|
|
|
|
if ($@) {
|
3725
|
0
|
0
|
0
|
|
|
|
if (10
|
3726
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
3727
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3728
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3729
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3730
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3731
|
|
|
|
|
|
|
}
|
3732
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3733
|
|
|
|
|
|
|
-1
|
3734
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3735
|
0
|
|
|
|
|
|
close($log_handle);
|
3736
|
|
|
|
|
|
|
}
|
3737
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3738
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3739
|
0
|
|
|
|
|
|
} else { die $@ }
|
3740
|
|
|
|
|
|
|
} else {
|
3741
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
3742
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3743
|
|
|
|
|
|
|
."Conveyed\n"
|
3744
|
|
|
|
|
|
|
." the Following "
|
3745
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3746
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3747
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3748
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3749
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3750
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3751
|
|
|
|
|
|
|
}
|
3752
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3753
|
|
|
|
|
|
|
-1
|
3754
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3755
|
0
|
|
|
|
|
|
close($log_handle);
|
3756
|
|
|
|
|
|
|
}
|
3757
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3758
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3759
|
0
|
|
|
|
|
|
} else { die $die }
|
3760
|
|
|
|
|
|
|
}
|
3761
|
|
|
|
|
|
|
}
|
3762
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3763
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3764
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3765
|
0
|
|
|
|
|
|
return @resu;
|
3766
|
|
|
|
|
|
|
} else {
|
3767
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3768
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3769
|
|
|
|
|
|
|
}
|
3770
|
|
|
|
|
|
|
}
|
3771
|
0
|
|
|
|
|
|
$done=1;last
|
3772
|
0
|
|
|
|
|
|
}
|
3773
|
0
|
|
|
|
|
|
eval {
|
3774
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
3775
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3776
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3777
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3778
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3779
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3780
|
|
|
|
|
|
|
#print "IN MAKEPLAN6\n";
|
3781
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3782
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3783
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3784
|
|
|
|
|
|
|
'Title'}) {
|
3785
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3786
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3787
|
|
|
|
|
|
|
}
|
3788
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3789
|
0
|
|
|
|
|
|
'Plan'}},
|
3790
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
3791
|
|
|
|
|
|
|
Number => $numbor,
|
3792
|
|
|
|
|
|
|
PlanID =>
|
3793
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3794
|
0
|
|
|
|
|
|
'Number'},
|
3795
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
3796
|
|
|
|
|
|
|
}
|
3797
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
3798
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
3799
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
3800
|
|
|
|
|
|
|
(-1
|
3801
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3802
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3803
|
|
|
|
|
|
|
} else {
|
3804
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3805
|
|
|
|
|
|
|
}
|
3806
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
3807
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
3808
|
0
|
0
|
|
|
|
|
if ($FullMenu->{$MenuUnit_hash_ref}
|
3809
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
3810
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
3811
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
3812
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
3813
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
3814
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
3815
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
3816
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
3817
|
|
|
|
|
|
|
." that Does NOT Exist"
|
3818
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
3819
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
3820
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
3821
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
3822
|
|
|
|
|
|
|
." main:: script.\n";
|
3823
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
3824
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
3825
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3826
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
3827
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
3828
|
|
|
|
|
|
|
}
|
3829
|
|
|
|
|
|
|
} else {
|
3830
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
3831
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
3832
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
3833
|
|
|
|
|
|
|
} else {
|
3834
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
3835
|
|
|
|
|
|
|
}
|
3836
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3837
|
|
|
|
|
|
|
}
|
3838
|
|
|
|
|
|
|
};
|
3839
|
0
|
0
|
|
|
|
|
if ($@) {
|
3840
|
0
|
0
|
0
|
|
|
|
if (10
|
3841
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3842
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3843
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3844
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
3845
|
|
|
|
|
|
|
}
|
3846
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3847
|
|
|
|
|
|
|
-1
|
3848
|
0
|
|
|
|
|
|
print $log_handle $@;
|
3849
|
0
|
|
|
|
|
|
close($log_handle);
|
3850
|
|
|
|
|
|
|
}
|
3851
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3852
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
3853
|
0
|
|
|
|
|
|
} else { die $@ }
|
3854
|
|
|
|
|
|
|
} else {
|
3855
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
3856
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
3857
|
|
|
|
|
|
|
."Conveyed\n"
|
3858
|
|
|
|
|
|
|
." the Following "
|
3859
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
3860
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
3861
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3862
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
3863
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
3864
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
3865
|
|
|
|
|
|
|
}
|
3866
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
3867
|
|
|
|
|
|
|
-1
|
3868
|
0
|
|
|
|
|
|
print $log_handle $die;
|
3869
|
0
|
|
|
|
|
|
close($log_handle);
|
3870
|
|
|
|
|
|
|
}
|
3871
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
3872
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
3873
|
0
|
|
|
|
|
|
} else { die $die }
|
3874
|
|
|
|
|
|
|
}
|
3875
|
|
|
|
|
|
|
}
|
3876
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
3877
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3878
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
3879
|
0
|
|
|
|
|
|
return @resu;
|
3880
|
|
|
|
|
|
|
} else {
|
3881
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
3882
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
3883
|
|
|
|
|
|
|
}
|
3884
|
|
|
|
|
|
|
}
|
3885
|
|
|
|
|
|
|
}
|
3886
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3887
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
3888
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
3889
|
0
|
|
|
|
|
|
return $menu_output;
|
3890
|
|
|
|
|
|
|
} else {
|
3891
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3892
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3893
|
|
|
|
|
|
|
}
|
3894
|
|
|
|
|
|
|
} elsif ($numbor=~/^\*\s*$/s) {
|
3895
|
|
|
|
|
|
|
# SHOW DEFAULT SELECTIONS using STAR symbol
|
3896
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
3897
|
0
|
|
|
|
|
|
print "\n WARNING!: Only -ONE- Level of Filtering",
|
3898
|
|
|
|
|
|
|
" is Supported!\n";
|
3899
|
0
|
|
|
|
|
|
sleep 2;
|
3900
|
0
|
|
|
|
|
|
last;
|
3901
|
|
|
|
|
|
|
}
|
3902
|
0
|
|
|
|
|
|
my @splice=();
|
3903
|
0
|
|
|
|
|
|
my @spl=();
|
3904
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SavePick->{$parent_menu}}) {
|
|
0
|
|
|
|
|
|
|
3905
|
0
|
|
|
|
|
|
$picks{$key}='*';
|
3906
|
|
|
|
|
|
|
}
|
3907
|
0
|
|
0
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}||={};
|
3908
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
3909
|
0
|
0
|
|
|
|
|
if ($parent_menu) {
|
3910
|
0
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='*';
|
3911
|
|
|
|
|
|
|
} else {
|
3912
|
0
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}->{$key}='*';
|
3913
|
|
|
|
|
|
|
}
|
3914
|
|
|
|
|
|
|
}
|
3915
|
0
|
0
|
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults}) {
|
3916
|
0
|
|
|
|
|
|
my $it=${[keys %{$FullMenu->{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3917
|
0
|
|
|
|
|
|
my $def=$FullMenu->{$MenuUnit_hash_ref}[5]{$it};
|
3918
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
3919
|
0
|
0
|
|
|
|
|
if ($def) {
|
3920
|
0
|
|
|
|
|
|
my $cnt=1;
|
3921
|
0
|
|
|
|
|
|
foreach my $item (@all_menu_items_array) {
|
3922
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
3923
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
3924
|
0
|
|
|
|
|
|
} $cnt++
|
3925
|
|
|
|
|
|
|
}
|
3926
|
|
|
|
|
|
|
}
|
3927
|
|
|
|
|
|
|
}
|
3928
|
0
|
|
|
|
|
|
foreach my $pick (sort numerically keys %picks) {
|
3929
|
0
|
|
|
|
|
|
push @splice,($pick-1)
|
3930
|
|
|
|
|
|
|
}
|
3931
|
0
|
|
|
|
|
|
foreach my $spl (@splice) {
|
3932
|
0
|
|
|
|
|
|
push @spl, $FullMenu->{$MenuUnit_hash_ref}[10]->[$spl];
|
3933
|
|
|
|
|
|
|
}
|
3934
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
3935
|
|
|
|
|
|
|
my $chosen={
|
3936
|
|
|
|
|
|
|
Select => $send_select,
|
3937
|
|
|
|
|
|
|
Banner => $MenuUnit_hash_ref->{Banner},
|
3938
|
0
|
|
|
|
|
|
}; my $cnt=0;
|
|
0
|
|
|
|
|
|
|
3939
|
0
|
|
0
|
|
|
|
my $hash_ref=$parent_menu||$MenuUnit_hash_ref;
|
3940
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
3941
|
0
|
|
|
|
|
|
my $num=shift @splice;
|
3942
|
0
|
|
|
|
|
|
$cnt++;
|
3943
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
3944
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num+1 };
|
3945
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
3946
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3947
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
3948
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${${$FullMenu}
|
|
0
|
|
|
|
|
|
|
3949
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3950
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
3951
|
|
|
|
|
|
|
}
|
3952
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
3953
|
0
|
|
|
|
|
|
$hidedefaults=1;
|
3954
|
0
|
|
|
|
|
|
eval {
|
3955
|
0
|
|
|
|
|
|
my ($ignore1,$ignore2,$ignore3)=('','','');
|
3956
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
3957
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,$ignore1,$ignore2,
|
3958
|
|
|
|
|
|
|
$ignore3)
|
3959
|
|
|
|
|
|
|
=&Menu($chosen,$picks_from_parent,
|
3960
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
3961
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
3962
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
3963
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
3964
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 3
|
3965
|
0
|
0
|
|
|
|
|
print "MENU RETURN 3\n" if $menu_return_debug;
|
3966
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
3967
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
3968
|
0
|
0
|
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3969
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3970
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
3971
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
3972
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
3973
|
0
|
|
|
|
|
|
$start=${$FullMenu}{$MenuUnit_hash_ref}[11];
|
|
0
|
|
|
|
|
|
|
3974
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
3975
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
3976
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
3977
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
3978
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
3979
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
3980
|
0
|
|
0
|
|
|
|
$subfile||='';
|
3981
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
3982
|
0
|
|
|
|
|
|
my @resu=();
|
3983
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
3984
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
3985
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
3986
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
3987
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
3988
|
|
|
|
|
|
|
#print "IN MAKEPLAN7\n";
|
3989
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
3990
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
3991
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
3992
|
|
|
|
|
|
|
'Title'}) {
|
3993
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
3994
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
3995
|
|
|
|
|
|
|
}
|
3996
|
0
|
|
|
|
|
|
my $n='Number';
|
3997
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
3998
|
0
|
|
|
|
|
|
'Plan'}},
|
3999
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4000
|
|
|
|
|
|
|
Number => $numbor,
|
4001
|
|
|
|
|
|
|
PlanID =>
|
4002
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4003
|
|
|
|
|
|
|
Item =>
|
4004
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4005
|
|
|
|
|
|
|
}
|
4006
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4007
|
0
|
0
|
|
|
|
|
if ($@) {
|
4008
|
0
|
0
|
0
|
|
|
|
if (10
|
4009
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
4010
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4011
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4012
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4013
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4014
|
|
|
|
|
|
|
}
|
4015
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4016
|
|
|
|
|
|
|
-1
|
4017
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4018
|
0
|
|
|
|
|
|
close($log_handle);
|
4019
|
|
|
|
|
|
|
}
|
4020
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4021
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4022
|
0
|
|
|
|
|
|
} else { die $@ }
|
4023
|
|
|
|
|
|
|
} else {
|
4024
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4025
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4026
|
|
|
|
|
|
|
."Conveyed\n"
|
4027
|
|
|
|
|
|
|
." the Following "
|
4028
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4029
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4030
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4031
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4032
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4033
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4034
|
|
|
|
|
|
|
}
|
4035
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4036
|
|
|
|
|
|
|
-1
|
4037
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4038
|
0
|
|
|
|
|
|
close($log_handle);
|
4039
|
|
|
|
|
|
|
}
|
4040
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4041
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4042
|
0
|
|
|
|
|
|
} else { die $die }
|
4043
|
|
|
|
|
|
|
}
|
4044
|
|
|
|
|
|
|
}
|
4045
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4046
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4047
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4048
|
0
|
|
|
|
|
|
return @resu;
|
4049
|
|
|
|
|
|
|
} else {
|
4050
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4051
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4052
|
|
|
|
|
|
|
}
|
4053
|
|
|
|
|
|
|
}
|
4054
|
0
|
|
|
|
|
|
$done=1;last
|
4055
|
0
|
|
|
|
|
|
}
|
4056
|
0
|
|
|
|
|
|
eval {
|
4057
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4058
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4059
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4060
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4061
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4062
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4063
|
|
|
|
|
|
|
#print "IN MAKEPLAN8\n";
|
4064
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4065
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4066
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4067
|
|
|
|
|
|
|
'Title'}) {
|
4068
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4069
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4070
|
|
|
|
|
|
|
}
|
4071
|
0
|
|
|
|
|
|
my $n='Number';
|
4072
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4073
|
0
|
|
|
|
|
|
'Plan'}},
|
4074
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4075
|
|
|
|
|
|
|
Number => $numbor,
|
4076
|
|
|
|
|
|
|
PlanID =>
|
4077
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4078
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4079
|
|
|
|
|
|
|
}
|
4080
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4081
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4082
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4083
|
|
|
|
|
|
|
(-1
|
4084
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4085
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4086
|
|
|
|
|
|
|
} else {
|
4087
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4088
|
|
|
|
|
|
|
}
|
4089
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4090
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4091
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4092
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4093
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4094
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4095
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4096
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4097
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4098
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4099
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4100
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4101
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4102
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4103
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4104
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4105
|
|
|
|
|
|
|
." main:: script.\n";
|
4106
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4107
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4108
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4109
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4110
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4111
|
|
|
|
|
|
|
}
|
4112
|
|
|
|
|
|
|
} else {
|
4113
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4114
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4115
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4116
|
|
|
|
|
|
|
} else {
|
4117
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4118
|
|
|
|
|
|
|
}
|
4119
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4120
|
|
|
|
|
|
|
}
|
4121
|
|
|
|
|
|
|
};
|
4122
|
0
|
0
|
|
|
|
|
if ($@) {
|
4123
|
0
|
0
|
0
|
|
|
|
if (10
|
4124
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4125
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4126
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4127
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4128
|
|
|
|
|
|
|
}
|
4129
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4130
|
|
|
|
|
|
|
-1
|
4131
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4132
|
0
|
|
|
|
|
|
close($log_handle);
|
4133
|
|
|
|
|
|
|
}
|
4134
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4135
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4136
|
0
|
|
|
|
|
|
} else { die $@ }
|
4137
|
|
|
|
|
|
|
} else {
|
4138
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4139
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4140
|
|
|
|
|
|
|
."Conveyed\n"
|
4141
|
|
|
|
|
|
|
." the Following "
|
4142
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4143
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4144
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4145
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4146
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4147
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4148
|
|
|
|
|
|
|
}
|
4149
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4150
|
|
|
|
|
|
|
-1
|
4151
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4152
|
0
|
|
|
|
|
|
close($log_handle);
|
4153
|
|
|
|
|
|
|
}
|
4154
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4155
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4156
|
0
|
|
|
|
|
|
} else { die $die }
|
4157
|
|
|
|
|
|
|
}
|
4158
|
|
|
|
|
|
|
}
|
4159
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4160
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4161
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4162
|
0
|
|
|
|
|
|
return @resu;
|
4163
|
|
|
|
|
|
|
} else {
|
4164
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4165
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4166
|
|
|
|
|
|
|
}
|
4167
|
|
|
|
|
|
|
}
|
4168
|
|
|
|
|
|
|
}
|
4169
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4170
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4171
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4172
|
0
|
|
|
|
|
|
return $menu_output;
|
4173
|
|
|
|
|
|
|
} else {
|
4174
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4175
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4176
|
|
|
|
|
|
|
}
|
4177
|
|
|
|
|
|
|
} elsif ($numbor=~/^\s*\/(.+)$/s) {
|
4178
|
|
|
|
|
|
|
## SLASH SEARCH
|
4179
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
4180
|
0
|
|
|
|
|
|
print "\n WARNING!: ",
|
4181
|
|
|
|
|
|
|
"Only -ONE- Level of Search is Supported!\n";
|
4182
|
0
|
|
|
|
|
|
sleep 2;
|
4183
|
0
|
|
|
|
|
|
last;
|
4184
|
|
|
|
|
|
|
}
|
4185
|
0
|
|
0
|
|
|
|
my $one=$1||'';
|
4186
|
0
|
|
|
|
|
|
chomp $one;
|
4187
|
0
|
|
|
|
|
|
$one=~s/\*/[\*]/g;
|
4188
|
0
|
|
|
|
|
|
$one=~s/\+/[\+]/g;
|
4189
|
0
|
0
|
|
|
|
|
$one=qr/$one/ if $one;
|
4190
|
0
|
|
|
|
|
|
my @spl=();
|
4191
|
0
|
|
|
|
|
|
chomp $numbor;
|
4192
|
0
|
|
|
|
|
|
my $def='';
|
4193
|
0
|
0
|
|
|
|
|
unless (exists $Persists->{$MenuUnit_hash_ref}{defaults}) {
|
4194
|
0
|
|
|
|
|
|
my $it=${[keys %{${$FullMenu}{$MenuUnit_hash_ref}[5]}]}[0];
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4195
|
0
|
|
|
|
|
|
$def=${$FullMenu}{$MenuUnit_hash_ref}[5]{$it};
|
|
0
|
|
|
|
|
|
|
4196
|
0
|
0
|
|
|
|
|
$def='.*' if $def eq '*';
|
4197
|
0
|
0
|
|
|
|
|
if ($def) {
|
4198
|
0
|
|
|
|
|
|
my $cnt=1;
|
4199
|
0
|
|
|
|
|
|
foreach my $item (sort
|
4200
|
0
|
|
|
|
|
|
@{[keys %{${$FullMenu}{$MenuUnit_hash_ref}[5]}]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4201
|
0
|
0
|
|
|
|
|
if ($item=~/$def/) {
|
4202
|
0
|
|
|
|
|
|
$picks{$cnt}='*';
|
4203
|
0
|
|
|
|
|
|
} $cnt++
|
4204
|
|
|
|
|
|
|
}
|
4205
|
|
|
|
|
|
|
}
|
4206
|
|
|
|
|
|
|
}
|
4207
|
|
|
|
|
|
|
|
4208
|
0
|
|
|
|
|
|
my $cnt=0;my $ct=0;my @splice=();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4209
|
0
|
|
|
|
|
|
foreach my $pik (@all_menu_items_array) {
|
4210
|
0
|
|
|
|
|
|
$cnt++;
|
4211
|
0
|
0
|
|
|
|
|
if ($pik=~/$one/s) {
|
4212
|
0
|
|
|
|
|
|
push @spl, $pik;
|
4213
|
0
|
|
|
|
|
|
$splice[$ct++]=$cnt;
|
4214
|
|
|
|
|
|
|
}
|
4215
|
|
|
|
|
|
|
}
|
4216
|
0
|
0
|
|
|
|
|
next if $#spl==-1;
|
4217
|
0
|
0
|
|
|
|
|
my $send_select='Many' if $select_many;
|
4218
|
|
|
|
|
|
|
my $chosen={
|
4219
|
|
|
|
|
|
|
Select => $send_select,
|
4220
|
0
|
|
|
|
|
|
Banner => ${$MenuUnit_hash_ref}{Banner},
|
4221
|
0
|
|
|
|
|
|
}; $cnt=0;
|
|
0
|
|
|
|
|
|
|
4222
|
0
|
|
|
|
|
|
foreach my $text (@spl) {
|
4223
|
0
|
|
|
|
|
|
my $num=$splice[$cnt];
|
4224
|
0
|
|
|
|
|
|
$cnt++;
|
4225
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$num}) {
|
|
|
0
|
|
|
|
|
|
4226
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4227
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
4228
|
|
|
|
|
|
|
} elsif ($def && $text=~/$def/) {
|
4229
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4230
|
|
|
|
|
|
|
{ Text => $text,Default => '*',__NUM__=>$num };
|
4231
|
0
|
|
|
|
|
|
$picks{$num}='*';
|
4232
|
|
|
|
|
|
|
} else {
|
4233
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}=
|
4234
|
|
|
|
|
|
|
{ Text => $text,__NUM__=>$num };
|
4235
|
|
|
|
|
|
|
}
|
4236
|
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Result}=
|
4237
|
0
|
|
|
|
|
|
${${$MenuUnit_hash_ref}{${$FullMenu->
|
4238
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'}
|
|
0
|
|
|
|
|
|
|
4239
|
0
|
|
|
|
|
|
if exists ${${$MenuUnit_hash_ref}{${$FullMenu->
|
4240
|
0
|
0
|
|
|
|
|
{$MenuUnit_hash_ref}[4]}{$text}}}{'Result'};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4241
|
0
|
|
|
|
|
|
$chosen->{'Item_'.$cnt}{Filter}=1;
|
4242
|
|
|
|
|
|
|
}
|
4243
|
0
|
|
|
|
|
|
%{$SavePick->{$chosen}}=%picks;
|
|
0
|
|
|
|
|
|
|
4244
|
0
|
|
|
|
|
|
my @return_from_filtered_menu=();
|
4245
|
0
|
|
|
|
|
|
eval {
|
4246
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
4247
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4248
|
|
|
|
|
|
|
@return_from_filtered_menu)=&Menu(
|
4249
|
|
|
|
|
|
|
$chosen,$picks_from_parent,
|
4250
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
4251
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4252
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4253
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
4254
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 4
|
4255
|
0
|
0
|
|
|
|
|
print "MENU RETURN 4\n" if $menu_return_debug;
|
4256
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4257
|
0
|
0
|
|
|
|
|
if (-1<$#return_from_filtered_menu) {
|
4258
|
0
|
0
|
|
|
|
|
if ((values %{$menu_output})[0] eq 'recurse') {
|
|
0
|
|
|
|
|
|
|
4259
|
0
|
|
|
|
|
|
my %k=%{$menu_output};
|
|
0
|
|
|
|
|
|
|
4260
|
0
|
|
|
|
|
|
delete $k{Menu};
|
4261
|
0
|
|
|
|
|
|
my $lab=(keys %k)[0];
|
4262
|
0
|
|
|
|
|
|
$menu_output=$labels{$lab};
|
4263
|
|
|
|
|
|
|
}
|
4264
|
0
|
|
|
|
|
|
$MenuMap=$Persists->{$MenuUnit_hash_ref};
|
4265
|
0
|
|
|
|
|
|
eval {
|
4266
|
0
|
|
|
|
|
|
($menu_output,$FullMenu,$Selected,$Conveyed,$SavePick,
|
4267
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists)=&Menu(
|
4268
|
|
|
|
|
|
|
$menu_output,$FullMenu,
|
4269
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4270
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4271
|
|
|
|
|
|
|
$return_from_filtered_menu[0],
|
4272
|
|
|
|
|
|
|
$MenuUnit_hash_ref,
|
4273
|
|
|
|
|
|
|
$return_from_filtered_menu[2]);
|
4274
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 5
|
4275
|
0
|
0
|
|
|
|
|
print "MENU RETURN 5\n" if $menu_return_debug;
|
4276
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4277
|
|
|
|
|
|
|
}
|
4278
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
4279
|
0
|
0
|
0
|
|
|
|
if (($menu_output eq '-') && exists
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4280
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}) {
|
4281
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4282
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4283
|
|
|
|
|
|
|
} elsif ($menu_output eq '+' && exists
|
4284
|
|
|
|
|
|
|
$SavePick->{$MenuUnit_hash_ref}) {
|
4285
|
0
|
|
|
|
|
|
%picks=%{$SavePick->{$MenuUnit_hash_ref}};
|
|
0
|
|
|
|
|
|
|
4286
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11];
|
4287
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
4288
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4289
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
4290
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
4291
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
4292
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
4293
|
0
|
|
0
|
|
|
|
$subfile||='';
|
4294
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
4295
|
0
|
|
|
|
|
|
my @resu=();
|
4296
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
4297
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4298
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4299
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4300
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4301
|
|
|
|
|
|
|
#print "IN MAKEPLAN9\n";
|
4302
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4303
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4304
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4305
|
|
|
|
|
|
|
'Title'}) {
|
4306
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4307
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4308
|
|
|
|
|
|
|
}
|
4309
|
0
|
|
|
|
|
|
my $n='Number';
|
4310
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4311
|
0
|
|
|
|
|
|
'Plan'}},
|
4312
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4313
|
|
|
|
|
|
|
Number => $numbor,
|
4314
|
|
|
|
|
|
|
PlanID =>
|
4315
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4316
|
|
|
|
|
|
|
Item =>
|
4317
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4318
|
|
|
|
|
|
|
}
|
4319
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4320
|
0
|
0
|
|
|
|
|
if ($@) {
|
4321
|
0
|
0
|
0
|
|
|
|
if (10
|
4322
|
|
|
|
|
|
|
'FATAL ERROR') {
|
4323
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4324
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4325
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4326
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4327
|
|
|
|
|
|
|
}
|
4328
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4329
|
|
|
|
|
|
|
-1
|
4330
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4331
|
0
|
|
|
|
|
|
close($log_handle);
|
4332
|
|
|
|
|
|
|
}
|
4333
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4334
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4335
|
0
|
|
|
|
|
|
} else { die $@ }
|
4336
|
|
|
|
|
|
|
} else {
|
4337
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4338
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4339
|
|
|
|
|
|
|
."Conveyed\n"
|
4340
|
|
|
|
|
|
|
." the Following "
|
4341
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4342
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4343
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4344
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4345
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4346
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4347
|
|
|
|
|
|
|
}
|
4348
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4349
|
|
|
|
|
|
|
-1
|
4350
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4351
|
0
|
|
|
|
|
|
close($log_handle);
|
4352
|
|
|
|
|
|
|
}
|
4353
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4354
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4355
|
0
|
|
|
|
|
|
} else { die $die }
|
4356
|
|
|
|
|
|
|
}
|
4357
|
|
|
|
|
|
|
}
|
4358
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4359
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4360
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4361
|
0
|
|
|
|
|
|
return @resu;
|
4362
|
|
|
|
|
|
|
} else {
|
4363
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4364
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4365
|
|
|
|
|
|
|
}
|
4366
|
|
|
|
|
|
|
}
|
4367
|
0
|
|
|
|
|
|
$done=1;last
|
4368
|
0
|
|
|
|
|
|
}
|
4369
|
0
|
|
|
|
|
|
eval {
|
4370
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4371
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4372
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4373
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4374
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4375
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4376
|
|
|
|
|
|
|
#print "IN MAKEPLAN10\n";
|
4377
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4378
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4379
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4380
|
|
|
|
|
|
|
'Title'}) {
|
4381
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4382
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4383
|
|
|
|
|
|
|
}
|
4384
|
0
|
|
|
|
|
|
my $n='Number';
|
4385
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4386
|
0
|
|
|
|
|
|
'Plan'}},
|
4387
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4388
|
|
|
|
|
|
|
Number => $numbor,
|
4389
|
|
|
|
|
|
|
PlanID =>
|
4390
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4391
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4392
|
|
|
|
|
|
|
}
|
4393
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4394
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4395
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4396
|
|
|
|
|
|
|
(-1
|
4397
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4398
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4399
|
|
|
|
|
|
|
} else {
|
4400
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4401
|
|
|
|
|
|
|
}
|
4402
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4403
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4404
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4405
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4406
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4407
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4408
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4409
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4410
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4411
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4412
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4413
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4414
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4415
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4416
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4417
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4418
|
|
|
|
|
|
|
." main:: script.\n";
|
4419
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4420
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4421
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4422
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4423
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4424
|
|
|
|
|
|
|
}
|
4425
|
|
|
|
|
|
|
} else {
|
4426
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4427
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4428
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4429
|
|
|
|
|
|
|
} else {
|
4430
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4431
|
|
|
|
|
|
|
}
|
4432
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4433
|
|
|
|
|
|
|
}
|
4434
|
|
|
|
|
|
|
};
|
4435
|
0
|
0
|
|
|
|
|
if ($@) {
|
4436
|
0
|
0
|
0
|
|
|
|
if (10
|
4437
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4438
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4439
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4440
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4441
|
|
|
|
|
|
|
}
|
4442
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4443
|
|
|
|
|
|
|
-1
|
4444
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4445
|
0
|
|
|
|
|
|
close($log_handle);
|
4446
|
|
|
|
|
|
|
}
|
4447
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4448
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4449
|
0
|
|
|
|
|
|
} else { die $@ }
|
4450
|
|
|
|
|
|
|
} else {
|
4451
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4452
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4453
|
|
|
|
|
|
|
."Conveyed\n"
|
4454
|
|
|
|
|
|
|
." the Following "
|
4455
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4456
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4457
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4458
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4459
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4460
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4461
|
|
|
|
|
|
|
}
|
4462
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4463
|
|
|
|
|
|
|
-1
|
4464
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4465
|
0
|
|
|
|
|
|
close($log_handle);
|
4466
|
|
|
|
|
|
|
}
|
4467
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4468
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4469
|
0
|
|
|
|
|
|
} else { die $die }
|
4470
|
|
|
|
|
|
|
}
|
4471
|
|
|
|
|
|
|
}
|
4472
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4473
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4474
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4475
|
0
|
|
|
|
|
|
return @resu;
|
4476
|
|
|
|
|
|
|
} else {
|
4477
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4478
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4479
|
|
|
|
|
|
|
}
|
4480
|
|
|
|
|
|
|
}
|
4481
|
|
|
|
|
|
|
}
|
4482
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4483
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4484
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
4485
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
4486
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
4487
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
4488
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4489
|
0
|
|
|
|
|
|
return $menu_output;
|
4490
|
|
|
|
|
|
|
}
|
4491
|
|
|
|
|
|
|
} elsif (($numbor=~/^\ || $ikey eq 'LEFTARROW') && $FullMenu) {
|
4492
|
0
|
0
|
|
|
|
|
if ($recurse_level==1) {
|
|
|
0
|
|
|
|
|
|
4493
|
0
|
|
|
|
|
|
print "\n WARNING! - You are at the First Menu!\n";
|
4494
|
0
|
|
|
|
|
|
sleep 2;
|
4495
|
0
|
|
|
|
|
|
} elsif (grep { /\+|\*/ } values %picks) {
|
4496
|
0
|
|
|
|
|
|
return '+',
|
4497
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4498
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4499
|
|
|
|
|
|
|
$Persists;
|
4500
|
|
|
|
|
|
|
} else {
|
4501
|
0
|
|
|
|
|
|
my %sp_copy=%{$SavePick->{$parent_menu}}
|
4502
|
0
|
0
|
|
|
|
|
if exists $SavePick->{$parent_menu};
|
4503
|
0
|
|
|
|
|
|
foreach my $key (keys %sp_copy) {
|
4504
|
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='-' if
|
4505
|
0
|
0
|
|
|
|
|
$sp_copy{$key} eq '+';
|
4506
|
|
|
|
|
|
|
}
|
4507
|
0
|
|
0
|
|
|
|
$parent_menu->{Scroll}->[1]||=0;
|
4508
|
0
|
|
0
|
|
|
|
$main::maintain_scroll_flag||={};
|
4509
|
0
|
0
|
0
|
|
|
|
if ($parent_menu->{Scroll}->[1]>1 &&
|
4510
|
|
|
|
|
|
|
!exists $main::maintain_scroll_flag->{$parent_menu}) {
|
4511
|
0
|
|
|
|
|
|
--$parent_menu->{Scroll}->[1];
|
4512
|
0
|
|
|
|
|
|
$main::maintain_scroll_flag->{$parent_menu}='';
|
4513
|
|
|
|
|
|
|
}
|
4514
|
0
|
|
|
|
|
|
return '-',
|
4515
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4516
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4517
|
|
|
|
|
|
|
$Persists;
|
4518
|
0
|
|
|
|
|
|
} last;
|
4519
|
|
|
|
|
|
|
} elsif (($numbor=~/^\>/ || $ikey eq 'RIGHTARROW') && exists
|
4520
|
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref} &&
|
4521
|
|
|
|
|
|
|
((grep { /-|\+/ } values %picks) || $show_banner_only)) {
|
4522
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$MenuUnit_hash_ref};
|
4523
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
4524
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
4525
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
4526
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
4527
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
4528
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
4529
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
4530
|
0
|
|
|
|
|
|
my $menu_result='';
|
4531
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$MenuUnit_hash_ref}
|
4532
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
4533
|
|
|
|
|
|
|
$menu_result=$Selected->{$MenuUnit_hash_ref}
|
4534
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
4535
|
0
|
0
|
|
|
|
|
$menu_result=$menu_result->() if ref
|
4536
|
|
|
|
|
|
|
$menu_result eq 'CODE';
|
4537
|
|
|
|
|
|
|
} else {
|
4538
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$MenuUnit_hash_ref}[2]
|
4539
|
0
|
|
|
|
|
|
{$all_menu_items_array[(keys %{$SavePick->
|
4540
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}})[0]-1]};
|
4541
|
|
|
|
|
|
|
}
|
4542
|
0
|
|
|
|
|
|
eval {
|
4543
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
4544
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
4545
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
4546
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
4547
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
4548
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
4549
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
4550
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
4551
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
4552
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 6
|
4553
|
0
|
0
|
|
|
|
|
print "MENU RETURN 6\n" if $menu_return_debug;
|
4554
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4555
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
4556
|
0
|
0
|
0
|
|
|
|
if (ref $menu_output eq 'ARRAY' &&
|
4557
|
|
|
|
|
|
|
$menu_output->[0]=~/^[{](.*)[}][<]$/) {
|
4558
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
4559
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
4560
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
4561
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
4562
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
4563
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
4564
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
4565
|
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref}[2]
|
4566
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
4567
|
0
|
|
|
|
|
|
%picks=();
|
4568
|
0
|
|
|
|
|
|
next;
|
4569
|
|
|
|
|
|
|
} else {
|
4570
|
0
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref};
|
4571
|
0
|
|
|
|
|
|
return $menu_output,
|
4572
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
4573
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4574
|
|
|
|
|
|
|
$Persists;
|
4575
|
|
|
|
|
|
|
}
|
4576
|
|
|
|
|
|
|
} else {
|
4577
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
4578
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
4579
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
4580
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
4581
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
4582
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
4583
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
4584
|
|
|
|
|
|
|
}
|
4585
|
0
|
0
|
|
|
|
|
if ($menu_output eq 'DONE_SUB') {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4586
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4587
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE') {
|
4588
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
4589
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4590
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
4591
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
4592
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4593
|
|
|
|
|
|
|
#print "IN MAKEPLAN11\n";
|
4594
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
4595
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{
|
4596
|
|
|
|
|
|
|
'Title'}) {
|
4597
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4598
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4599
|
|
|
|
|
|
|
}
|
4600
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
4601
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
4602
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4603
|
|
|
|
|
|
|
Number => $numbor,
|
4604
|
|
|
|
|
|
|
PlanID =>
|
4605
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
4606
|
0
|
|
|
|
|
|
Item => $pn{$numbor}[0] }
|
4607
|
|
|
|
|
|
|
}
|
4608
|
|
|
|
|
|
|
}
|
4609
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
4610
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
4611
|
0
|
|
0
|
|
|
|
$subfile||='';
|
4612
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
4613
|
0
|
|
|
|
|
|
my @resu=();
|
4614
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
4615
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4616
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4617
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4618
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4619
|
|
|
|
|
|
|
#print "IN MAKEPLAN12\n";
|
4620
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4621
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4622
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4623
|
|
|
|
|
|
|
'Title'}) {
|
4624
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4625
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4626
|
|
|
|
|
|
|
}
|
4627
|
0
|
|
|
|
|
|
my $n='Number';
|
4628
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4629
|
0
|
|
|
|
|
|
'Plan'}},
|
4630
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4631
|
|
|
|
|
|
|
Number => $numbor,
|
4632
|
|
|
|
|
|
|
PlanID =>
|
4633
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4634
|
|
|
|
|
|
|
Item =>
|
4635
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
4636
|
|
|
|
|
|
|
}
|
4637
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
4638
|
0
|
0
|
|
|
|
|
if ($@) {
|
4639
|
0
|
0
|
0
|
|
|
|
if (10
|
4640
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
4641
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4642
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4643
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4644
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4645
|
|
|
|
|
|
|
}
|
4646
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4647
|
|
|
|
|
|
|
-1
|
4648
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4649
|
0
|
|
|
|
|
|
close($log_handle);
|
4650
|
|
|
|
|
|
|
}
|
4651
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4652
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4653
|
0
|
|
|
|
|
|
} else { die $@ }
|
4654
|
|
|
|
|
|
|
} else {
|
4655
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4656
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4657
|
|
|
|
|
|
|
."Conveyed\n"
|
4658
|
|
|
|
|
|
|
." the Following "
|
4659
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4660
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4661
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4662
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4663
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4664
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4665
|
|
|
|
|
|
|
}
|
4666
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4667
|
|
|
|
|
|
|
-1
|
4668
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4669
|
0
|
|
|
|
|
|
close($log_handle);
|
4670
|
|
|
|
|
|
|
}
|
4671
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4672
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4673
|
0
|
|
|
|
|
|
} else { die $die }
|
4674
|
|
|
|
|
|
|
}
|
4675
|
|
|
|
|
|
|
}
|
4676
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4677
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4678
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4679
|
0
|
|
|
|
|
|
return @resu;
|
4680
|
|
|
|
|
|
|
} else {
|
4681
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4682
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4683
|
|
|
|
|
|
|
}
|
4684
|
|
|
|
|
|
|
}
|
4685
|
0
|
|
|
|
|
|
$done=1;last
|
4686
|
0
|
|
|
|
|
|
}
|
4687
|
0
|
|
|
|
|
|
eval {
|
4688
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
4689
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4690
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4691
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
4692
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
4693
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
4694
|
|
|
|
|
|
|
#print "IN MAKEPLAN13\n";
|
4695
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
4696
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
4697
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
4698
|
|
|
|
|
|
|
'Title'}) {
|
4699
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
4700
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
4701
|
|
|
|
|
|
|
}
|
4702
|
0
|
|
|
|
|
|
my $n='Number';
|
4703
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
4704
|
0
|
|
|
|
|
|
'Plan'}},
|
4705
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
4706
|
|
|
|
|
|
|
Number => $numbor,
|
4707
|
|
|
|
|
|
|
PlanID =>
|
4708
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
4709
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
4710
|
|
|
|
|
|
|
}
|
4711
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
4712
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
4713
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
4714
|
|
|
|
|
|
|
(-1
|
4715
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4716
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4717
|
|
|
|
|
|
|
} else {
|
4718
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4719
|
|
|
|
|
|
|
}
|
4720
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
4721
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
4722
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
4723
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
4724
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
4725
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
4726
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
4727
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
4728
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
4729
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
4730
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
4731
|
|
|
|
|
|
|
." that Does NOT Exist"
|
4732
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
4733
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
4734
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
4735
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
4736
|
|
|
|
|
|
|
." main:: script.\n";
|
4737
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
4738
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
4739
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4740
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
4741
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
4742
|
|
|
|
|
|
|
}
|
4743
|
|
|
|
|
|
|
} else {
|
4744
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
4745
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
4746
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
4747
|
|
|
|
|
|
|
} else {
|
4748
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
4749
|
|
|
|
|
|
|
}
|
4750
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
4751
|
|
|
|
|
|
|
}
|
4752
|
|
|
|
|
|
|
};
|
4753
|
0
|
0
|
|
|
|
|
if ($@) {
|
4754
|
0
|
0
|
0
|
|
|
|
if (10
|
4755
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4756
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4757
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4758
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
4759
|
|
|
|
|
|
|
}
|
4760
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4761
|
|
|
|
|
|
|
-1
|
4762
|
0
|
|
|
|
|
|
print $log_handle $@;
|
4763
|
0
|
|
|
|
|
|
close($log_handle);
|
4764
|
|
|
|
|
|
|
}
|
4765
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4766
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
4767
|
0
|
|
|
|
|
|
} else { die $@ }
|
4768
|
|
|
|
|
|
|
} else {
|
4769
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
4770
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
4771
|
|
|
|
|
|
|
."Conveyed\n"
|
4772
|
|
|
|
|
|
|
." the Following "
|
4773
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
4774
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
4775
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4776
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
4777
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
4778
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
4779
|
|
|
|
|
|
|
}
|
4780
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
4781
|
|
|
|
|
|
|
-1
|
4782
|
0
|
|
|
|
|
|
print $log_handle $die;
|
4783
|
0
|
|
|
|
|
|
close($log_handle);
|
4784
|
|
|
|
|
|
|
}
|
4785
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
4786
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
4787
|
0
|
|
|
|
|
|
} else { die $die }
|
4788
|
|
|
|
|
|
|
}
|
4789
|
|
|
|
|
|
|
}
|
4790
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
4791
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4792
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
4793
|
0
|
|
|
|
|
|
return @resu;
|
4794
|
|
|
|
|
|
|
} else {
|
4795
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
4796
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
4797
|
|
|
|
|
|
|
}
|
4798
|
|
|
|
|
|
|
}
|
4799
|
|
|
|
|
|
|
}
|
4800
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
4801
|
0
|
|
|
|
|
|
} else { return 'DONE' }
|
4802
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
4803
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
4804
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
4805
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
4806
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
4807
|
0
|
|
|
|
|
|
return $menu_output;
|
4808
|
|
|
|
|
|
|
}
|
4809
|
|
|
|
|
|
|
} elsif ($ikey eq 'ESC' || $numbor=~/^quit|exit|bye$/i) {
|
4810
|
0
|
0
|
|
|
|
|
print "\n" if $^O ne 'cygwin';
|
4811
|
0
|
|
|
|
|
|
return ']quit['
|
4812
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto and $ikey eq 'F1' ||
|
4813
|
|
|
|
|
|
|
$numbor=~/^help$/i) {
|
4814
|
0
|
|
|
|
|
|
system('man Net::FullAuto');
|
4815
|
|
|
|
|
|
|
} elsif ($ikey eq 'F1' || $numbor=~/^help$/i) {
|
4816
|
0
|
|
|
|
|
|
system('man Term::Menus');
|
4817
|
|
|
|
|
|
|
} elsif ($Term::Menus::fullauto and $numbor=~/^admin$/i) {
|
4818
|
0
|
0
|
|
|
|
|
if (!exists $Net::FullAuto::FA_Core::admin_menus{
|
4819
|
|
|
|
|
|
|
&pw($MenuUnit_hash_ref)}) {
|
4820
|
0
|
|
|
|
|
|
while (1) {
|
4821
|
0
|
0
|
|
|
|
|
my @menu_output=Menu($Net::FullAuto::FA_Core::admin_menu->())
|
4822
|
|
|
|
|
|
|
if $Net::FullAuto::FA_Core::admin_menu;
|
4823
|
0
|
0
|
0
|
|
|
|
last if $menu_output[0] ne '-' && $menu_output[0] ne '+';
|
4824
|
|
|
|
|
|
|
}
|
4825
|
|
|
|
|
|
|
} else {
|
4826
|
0
|
|
|
|
|
|
return ['{admin}<'],$FullMenu,$Selected,$Conveyed,
|
4827
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,$Persists;
|
4828
|
|
|
|
|
|
|
}
|
4829
|
0
|
|
|
|
|
|
} elsif (!keys %{$FullMenu->{$MenuUnit_hash_ref}[1]}
|
4830
|
|
|
|
|
|
|
&& $numbor=~/^[Aa]$/) {
|
4831
|
0
|
0
|
0
|
|
|
|
if (!$select_many && !(keys %{$MenuUnit_hash_ref->{Select}})) {
|
|
0
|
|
|
|
|
|
|
4832
|
0
|
|
|
|
|
|
print "\n ERROR: Cannot Select All Items\n".
|
4833
|
|
|
|
|
|
|
" When 'Select' is NOT set to 'Many'\n";
|
4834
|
0
|
|
|
|
|
|
sleep 2;next;
|
|
0
|
|
|
|
|
|
|
4835
|
|
|
|
|
|
|
}
|
4836
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
4837
|
0
|
|
|
|
|
|
foreach my $num (0..$#all_menu_items_array) {
|
4838
|
0
|
|
|
|
|
|
$picks{$num+1}='*';
|
4839
|
|
|
|
|
|
|
}
|
4840
|
0
|
|
|
|
|
|
foreach my $key (keys %{$FullMenu->{$MenuUnit_hash_ref}[8]}) {
|
|
0
|
|
|
|
|
|
|
4841
|
|
|
|
|
|
|
$SavePick->{$parent_menu}{$FullMenu->
|
4842
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$key}}='*';
|
4843
|
|
|
|
|
|
|
}
|
4844
|
|
|
|
|
|
|
} else {
|
4845
|
0
|
|
|
|
|
|
my $nmp=$num_pick-1;
|
4846
|
0
|
|
|
|
|
|
foreach my $pck (0..$nmp) {
|
4847
|
0
|
0
|
0
|
|
|
|
if ($select_many ||
|
4848
|
|
|
|
|
|
|
exists $FullMenu->{$MenuUnit_hash_ref}[6]->{
|
4849
|
|
|
|
|
|
|
$all_menu_items_array[$pck]}) {
|
4850
|
0
|
|
|
|
|
|
$picks{$pck+1}='*'
|
4851
|
|
|
|
|
|
|
}
|
4852
|
|
|
|
|
|
|
}
|
4853
|
|
|
|
|
|
|
}
|
4854
|
|
|
|
|
|
|
} elsif ($numbor=~/^[Cc]$/) {
|
4855
|
|
|
|
|
|
|
## CLEAR ALL CLEARALL
|
4856
|
0
|
|
|
|
|
|
foreach my $key (keys %{${$FullMenu}{$MenuUnit_hash_ref}[8]}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4857
|
0
|
|
|
|
|
|
delete ${$SavePick}{$parent_menu}{${$FullMenu}
|
|
0
|
|
|
|
|
|
|
4858
|
0
|
|
|
|
|
|
{$MenuUnit_hash_ref}[8]{$key}};
|
4859
|
|
|
|
|
|
|
}
|
4860
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
4861
|
0
|
0
|
|
|
|
|
if (exists $picks{$pick}) {
|
4862
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
4863
|
0
|
|
|
|
|
|
delete $items{$pick};
|
4864
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$pick};
|
4865
|
0
|
|
|
|
|
|
delete $Selected->{$parent_menu}{$pick};
|
4866
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$pick};
|
4867
|
0
|
|
|
|
|
|
delete $SavePick->{$parent_menu}{$pick};
|
4868
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
4869
|
|
|
|
|
|
|
}
|
4870
|
0
|
|
|
|
|
|
} $FullMenu->{$parent_menu}[5]='';
|
4871
|
0
|
|
|
|
|
|
$return_from_child_menu=0;
|
4872
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
4873
|
0
|
0
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0 if defined $parent_menu;
|
4874
|
|
|
|
|
|
|
}
|
4875
|
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
|
|
|
|
|
4876
|
0
|
0
|
0
|
|
|
|
if ($ikey ne 'PAGEUP' && exists $MenuUnit_hash_ref->{Scroll}
|
|
|
0
|
0
|
|
|
|
|
4877
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll}) {
|
4878
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]-- if
|
4879
|
0
|
0
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]!=1;
|
4880
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
4881
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $display_this_many_items if $num_pick;
|
4882
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
4883
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4884
|
0
|
0
|
0
|
|
|
|
if ($curscreennum-$remainder==
|
|
|
0
|
|
|
|
|
|
4885
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1] &&
|
4886
|
|
|
|
|
|
|
$curscreennum==$num_pick) {
|
4887
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4888
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4889
|
|
|
|
|
|
|
} elsif ($start==$MenuUnit_hash_ref->{Scroll}->[1]) {
|
4890
|
0
|
0
|
0
|
|
|
|
if ($display_this_many_items<$num_pick-$start
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4891
|
|
|
|
|
|
|
|| $remainder || (!$remainder &&
|
4892
|
|
|
|
|
|
|
(($num_pick==$start+1) ||
|
4893
|
|
|
|
|
|
|
($num_pick==$start+$display_this_many_items)))) {
|
4894
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4895
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4896
|
|
|
|
|
|
|
}
|
4897
|
0
|
|
|
|
|
|
} else { next }
|
4898
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4899
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4900
|
0
|
|
|
|
|
|
last;
|
4901
|
|
|
|
|
|
|
} elsif (0<=$start-$display_this_many_items) {
|
4902
|
0
|
|
|
|
|
|
$start=$start-$display_this_many_items;
|
4903
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=
|
4904
|
|
|
|
|
|
|
$start+$display_this_many_items
|
4905
|
|
|
|
|
|
|
if $ikey eq 'PAGEUP' &&
|
4906
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
4907
|
0
|
0
|
0
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll};
|
|
|
|
0
|
|
|
|
|
4908
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4909
|
|
|
|
|
|
|
} else {
|
4910
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
4911
|
|
|
|
|
|
|
}
|
4912
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4913
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4914
|
0
|
|
|
|
|
|
last;
|
4915
|
|
|
|
|
|
|
} elsif ($ikey eq 'END') {
|
4916
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$num_pick;
|
4917
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$num_pick if
|
4918
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll} &&
|
4919
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Scroll};
|
4920
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4921
|
0
|
0
|
|
|
|
|
if ($num_pick==$start+$choose_num) {
|
4922
|
0
|
|
|
|
|
|
next;
|
4923
|
|
|
|
|
|
|
}
|
4924
|
0
|
|
|
|
|
|
my $remainder=$num_pick % $choose_num;
|
4925
|
0
|
0
|
|
|
|
|
if ($remainder) {
|
4926
|
0
|
|
|
|
|
|
$start=$num_pick-$remainder;
|
4927
|
|
|
|
|
|
|
} else {
|
4928
|
0
|
|
|
|
|
|
$start=$num_pick-$display_this_many_items;
|
4929
|
|
|
|
|
|
|
}
|
4930
|
0
|
|
|
|
|
|
last;
|
4931
|
|
|
|
|
|
|
} elsif ($ikey eq 'HOME') {
|
4932
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
4933
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=1 if
|
4934
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll} &&
|
4935
|
0
|
0
|
0
|
|
|
|
$MenuUnit_hash_ref->{Scroll};
|
4936
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4937
|
0
|
|
|
|
|
|
$start=0;
|
4938
|
0
|
|
|
|
|
|
last;
|
4939
|
|
|
|
|
|
|
} elsif ($numbor && unpack('a1',$numbor) eq '!') {
|
4940
|
|
|
|
|
|
|
# SHELLOUT shellout
|
4941
|
0
|
|
0
|
|
|
|
my $username=getlogin || getpwuid($<);
|
4942
|
0
|
|
|
|
|
|
my $cmd=unpack('x1 a*',$numbor);
|
4943
|
0
|
|
|
|
|
|
print "\n";
|
4944
|
0
|
0
|
|
|
|
|
unless ($^O eq 'cygwin') {
|
4945
|
0
|
|
|
|
|
|
system("su -l -c$cmd $username");
|
4946
|
|
|
|
|
|
|
} else {
|
4947
|
0
|
|
|
|
|
|
system($cmd);
|
4948
|
|
|
|
|
|
|
}
|
4949
|
0
|
|
|
|
|
|
print "\nPress ENTER to continue";;
|
|
0
|
|
|
|
|
|
|
4950
|
0
|
|
|
|
|
|
next;
|
4951
|
|
|
|
|
|
|
} elsif (((!$ikey || $ikey eq 'ENTER') &&
|
4952
|
|
|
|
|
|
|
($numbor=~/^()$/ || $numbor=~/^\n/)) || $numbor=~/^d$/i
|
4953
|
|
|
|
|
|
|
|| $ikey eq 'DOWNARROW' || $ikey eq 'PAGEDOWN') {
|
4954
|
0
|
|
0
|
|
|
|
$ikey||='ENTER';
|
4955
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
4956
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
4957
|
0
|
0
|
0
|
|
|
|
if (($ikey eq 'DOWNARROW' || $numbor=~/^d$/i) &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
4958
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
4959
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll}) {
|
4960
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
4961
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $choose_num if $num_pick;
|
4962
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
4963
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4964
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]++
|
4965
|
0
|
0
|
|
|
|
|
if $MenuUnit_hash_ref->{Scroll}->[1]!=$num_pick;
|
4966
|
0
|
0
|
|
|
|
|
if ($curscreennum<$MenuUnit_hash_ref->{Scroll}->[1]) {
|
4967
|
0
|
0
|
|
|
|
|
if ($display_this_many_items<$num_pick-$start) {
|
4968
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
4969
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
4970
|
|
|
|
|
|
|
} else {
|
4971
|
0
|
|
|
|
|
|
$start=$start+$remainder;
|
4972
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$num_pick;
|
4973
|
|
|
|
|
|
|
}
|
4974
|
0
|
|
|
|
|
|
} else { next }
|
4975
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
4976
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
4977
|
0
|
|
|
|
|
|
last;
|
4978
|
|
|
|
|
|
|
} elsif ($ikey eq 'ENTER' && exists $MenuUnit_hash_ref->{Scroll}
|
4979
|
|
|
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll} && !$show_banner_only) {
|
4980
|
0
|
|
|
|
|
|
$numbor=$MenuUnit_hash_ref->{Scroll}->[1];
|
4981
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]++
|
4982
|
0
|
0
|
|
|
|
|
if $MenuUnit_hash_ref->{Scroll}->[1]!=$num_pick;
|
4983
|
|
|
|
|
|
|
} else {
|
4984
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
4985
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
4986
|
0
|
|
|
|
|
|
$numbor='f';
|
4987
|
0
|
|
|
|
|
|
$picks{'__FA_Banner__'}='';
|
4988
|
0
|
|
|
|
|
|
my $remainder=0;
|
4989
|
0
|
0
|
|
|
|
|
$remainder=$choose_num % $num_pick if $num_pick;
|
4990
|
0
|
0
|
|
|
|
|
my $curscreennum=($start+$remainder==$num_pick)?
|
4991
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
4992
|
0
|
|
|
|
|
|
my $numpick=0;
|
4993
|
0
|
0
|
0
|
|
|
|
if ($parent_menu and exists $parent_menu->{Scroll}) {
|
4994
|
0
|
0
|
|
|
|
|
if (ref $parent_menu->{Scroll} eq 'ARRAY') {
|
4995
|
0
|
|
|
|
|
|
$numpick=$#{[keys %{$FullMenu->{$parent_menu}[2]}]};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4996
|
0
|
0
|
0
|
|
|
|
if ($curscreennum+$display_this_many_items
|
4997
|
|
|
|
|
|
|
<$parent_menu->{Scroll}->[1] &&
|
4998
|
|
|
|
|
|
|
$parent_menu->{Scroll}->[1]<$numpick) {
|
4999
|
|
|
|
|
|
|
$FullMenu->{$parent_menu}[11]=
|
5000
|
0
|
|
|
|
|
|
$parent_menu->{Scroll}->[1];
|
5001
|
|
|
|
|
|
|
}
|
5002
|
|
|
|
|
|
|
}
|
5003
|
0
|
|
0
|
|
|
|
$parent_menu->{Scroll}->[1]||=0;
|
5004
|
|
|
|
|
|
|
}
|
5005
|
|
|
|
|
|
|
} else {
|
5006
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5007
|
|
|
|
|
|
|
}
|
5008
|
|
|
|
|
|
|
} elsif ($display_this_many_items<$num_pick-$start) {
|
5009
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
5010
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{Scroll}->[1]=$start+1 if
|
5011
|
|
|
|
|
|
|
exists $MenuUnit_hash_ref->{Scroll}
|
5012
|
0
|
0
|
0
|
|
|
|
&& $MenuUnit_hash_ref->{Scroll};
|
5013
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
5014
|
|
|
|
|
|
|
} elsif ($ikey ne 'PAGEDOWN') {
|
5015
|
0
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]=0;
|
5016
|
|
|
|
|
|
|
}
|
5017
|
0
|
0
|
0
|
|
|
|
unless ($show_banner_only || $numbor!~/^\d+/) {
|
5018
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5019
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
5020
|
0
|
|
|
|
|
|
last;
|
5021
|
|
|
|
|
|
|
}
|
5022
|
|
|
|
|
|
|
}
|
5023
|
0
|
|
|
|
|
|
} chomp $numbor;
|
5024
|
0
|
0
|
0
|
|
|
|
if (!((keys %picks) && $numbor=~/^[Ff]$/) &&
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5025
|
|
|
|
|
|
|
$numbor!~/^\d+|admin$/ && !$return_from_child_menu) {
|
5026
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
5027
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
5028
|
0
|
|
|
|
|
|
$numbor=$start+$choose_num+1;
|
5029
|
0
|
|
|
|
|
|
last;
|
5030
|
|
|
|
|
|
|
} elsif (exists $pn{$numbor} || ((keys %picks) && $numbor=~/^[Ff]$/)) {
|
5031
|
|
|
|
|
|
|
# NUMBOR CHOSEN
|
5032
|
0
|
0
|
|
|
|
|
delete $main::maintain_scroll_flag->{$MenuUnit_hash_ref}
|
5033
|
|
|
|
|
|
|
if defined $main::maintain_scroll_flag;
|
5034
|
0
|
0
|
|
|
|
|
delete $picks{'__FA_Banner__'} if exists $picks{'__FA_Banner__'};
|
5035
|
0
|
0
|
|
|
|
|
%pn=() unless %pn;
|
5036
|
0
|
|
|
|
|
|
my $callertest=__PACKAGE__."::Menu";
|
5037
|
0
|
0
|
0
|
|
|
|
if ($Persists->{$MenuUnit_hash_ref}{defaults} && !$filtered_menu) {
|
5038
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
5039
|
0
|
0
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0 if $parent_menu;
|
5040
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
5041
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$pick} && !$picks{$numbor}) {
|
5042
|
0
|
0
|
|
|
|
|
if ($picks{$pick} eq '*') {
|
|
|
0
|
|
|
|
|
|
5043
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5044
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5045
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$pick};
|
5046
|
|
|
|
|
|
|
} elsif ($picks{$pick} eq '+') {
|
5047
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$pick,
|
5048
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5049
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5050
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5051
|
|
|
|
|
|
|
}
|
5052
|
|
|
|
|
|
|
}
|
5053
|
0
|
|
|
|
|
|
} $FullMenu->{$MenuUnit_hash_ref}[5]='';
|
5054
|
|
|
|
|
|
|
}
|
5055
|
0
|
|
0
|
|
|
|
$pn{$numbor}[1]||=1;
|
5056
|
0
|
0
|
|
|
|
|
my $digital_numbor=($numbor=~/^\d+$/) ? $numbor : 1;
|
5057
|
0
|
|
0
|
|
|
|
$all_menu_items_array[0]||='';
|
5058
|
0
|
0
|
0
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result} &&
|
5059
|
|
|
|
|
|
|
!defined $MenuUnit_hash_ref->{Result}) {
|
5060
|
0
|
|
|
|
|
|
my $name=$MenuUnit_hash_ref->{Name};
|
5061
|
0
|
|
|
|
|
|
print "\n\n";
|
5062
|
0
|
|
|
|
|
|
my $fatal_error=<
|
5063
|
|
|
|
|
|
|
|
5064
|
|
|
|
|
|
|
FATAL ERROR!: The Menu Block \"$name\" :
|
5065
|
|
|
|
|
|
|
|
5066
|
|
|
|
|
|
|
END
|
5067
|
0
|
|
|
|
|
|
$fatal_error.=<<'END';
|
5068
|
|
|
|
|
|
|
has a Result => undef element defined, but not instantiated.
|
5069
|
|
|
|
|
|
|
There may be a couple reasons for this, having to do with scope
|
5070
|
|
|
|
|
|
|
and where code blocks are located in relation to each other in
|
5071
|
|
|
|
|
|
|
the script. It could also be that you didn't provide a value
|
5072
|
|
|
|
|
|
|
for the element. If blocks are locally scoped with "my" than
|
5073
|
|
|
|
|
|
|
the result block must exist ABOVE the calling block:
|
5074
|
|
|
|
|
|
|
|
5075
|
|
|
|
|
|
|
my $block_being_called = { ... };
|
5076
|
|
|
|
|
|
|
my $block_doing_calling = { Result => $block_being_called, };
|
5077
|
|
|
|
|
|
|
|
5078
|
|
|
|
|
|
|
However, with more complex menu implementations, this
|
5079
|
|
|
|
|
|
|
convenience is not always possible or workable. In this
|
5080
|
|
|
|
|
|
|
situation, the approach is different. It will be necessary to
|
5081
|
|
|
|
|
|
|
globally scope code blocks, and use full package naming
|
5082
|
|
|
|
|
|
|
conventions when calling code blocks:
|
5083
|
|
|
|
|
|
|
|
5084
|
|
|
|
|
|
|
our $block_doing_calling = {
|
5085
|
|
|
|
|
|
|
|
5086
|
|
|
|
|
|
|
Result => $Full::Package::Name::Of::block_being_called,
|
5087
|
|
|
|
|
|
|
|
5088
|
|
|
|
|
|
|
};
|
5089
|
|
|
|
|
|
|
our $block_being_called = { ... };
|
5090
|
|
|
|
|
|
|
|
5091
|
|
|
|
|
|
|
---------------------------------------------------------------
|
5092
|
|
|
|
|
|
|
|
5093
|
|
|
|
|
|
|
Result => elements MUST have a value. A NULL value will work:
|
5094
|
|
|
|
|
|
|
|
5095
|
|
|
|
|
|
|
my|our $block_being_called = { Result => '', }
|
5096
|
|
|
|
|
|
|
|
5097
|
|
|
|
|
|
|
END
|
5098
|
0
|
|
|
|
|
|
die $fatal_error;
|
5099
|
|
|
|
|
|
|
}
|
5100
|
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
|
|
|
|
|
5101
|
|
|
|
|
|
|
(exists ${$MenuUnit_hash_ref}{Select}{$numbor}))
|
5102
|
|
|
|
|
|
|
&& $numbor!~/^[Ff]$/) {
|
5103
|
0
|
0
|
0
|
|
|
|
if ($filtered_menu && (exists
|
|
|
0
|
|
|
|
|
|
5104
|
|
|
|
|
|
|
$SavePick->{$parent_menu}{$numbor})) {
|
5105
|
0
|
0
|
|
|
|
|
if ($Persists->{$parent_menu}{defaults}) {
|
5106
|
0
|
|
|
|
|
|
$Persists->{$parent_menu}{defaults}=0;
|
5107
|
0
|
|
|
|
|
|
$Persists->{$MenuUnit_hash_ref}{defaults}=0;
|
5108
|
0
|
|
|
|
|
|
foreach my $pick (keys %picks) {
|
5109
|
0
|
0
|
0
|
|
|
|
if (exists $picks{$pick} && !$picks{$numbor}) {
|
5110
|
0
|
0
|
|
|
|
|
if ($picks{$pick} eq '*') {
|
|
|
0
|
|
|
|
|
|
5111
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5112
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5113
|
0
|
|
|
|
|
|
delete $Selected->{$parent_menu}{$pick};
|
5114
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5115
|
|
|
|
|
|
|
} elsif ($picks{$pick} eq '+') {
|
5116
|
0
|
|
|
|
|
|
&delete_Selected($parent_menu,$pick,
|
5117
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5118
|
0
|
|
|
|
|
|
$SaveNext={%{$SavePick}};
|
|
0
|
|
|
|
|
|
|
5119
|
0
|
|
|
|
|
|
delete $picks{$pick};
|
5120
|
0
|
|
|
|
|
|
delete $items{$pick};
|
5121
|
|
|
|
|
|
|
}
|
5122
|
|
|
|
|
|
|
}
|
5123
|
0
|
|
|
|
|
|
} $FullMenu->{$MenuUnit_hash_ref}[5]='';
|
5124
|
|
|
|
|
|
|
}
|
5125
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$numbor};
|
5126
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5127
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5128
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5129
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5130
|
0
|
|
|
|
|
|
delete $SavePick->{$parent_menu}{$numbor};
|
5131
|
|
|
|
|
|
|
} elsif (exists $picks{$numbor}) {
|
5132
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
5133
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5134
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5135
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref}{$numbor};
|
5136
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref}{$numbor};
|
5137
|
0
|
0
|
|
|
|
|
delete $SavePick->{$parent_menu}{$numbor}
|
5138
|
|
|
|
|
|
|
if $filtered_menu;
|
5139
|
|
|
|
|
|
|
} else {
|
5140
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$numbor,
|
5141
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5142
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5143
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5144
|
|
|
|
|
|
|
}
|
5145
|
|
|
|
|
|
|
} else {
|
5146
|
|
|
|
|
|
|
$items{$numbor}=$FullMenu->{$MenuUnit_hash_ref}
|
5147
|
0
|
|
|
|
|
|
[4]{$all_menu_items_array[$numbor-1]};
|
5148
|
0
|
0
|
|
|
|
|
$SavePick->{$parent_menu}{$numbor}='*'
|
5149
|
|
|
|
|
|
|
if $filtered_menu;
|
5150
|
0
|
|
|
|
|
|
my $skip=0;
|
5151
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5152
|
0
|
0
|
0
|
|
|
|
if (defined $all_menu_items_array[$key-1] &&
|
|
|
0
|
0
|
|
|
|
|
5153
|
0
|
|
|
|
|
|
exists ${$FullMenu}{$MenuUnit_hash_ref}[1]->{
|
5154
|
|
|
|
|
|
|
$all_menu_items_array[$key-1]}
|
5155
|
0
|
|
|
|
|
|
&& (grep { $items{$numbor} eq $_ }
|
5156
|
0
|
|
|
|
|
|
@{${$FullMenu}{$MenuUnit_hash_ref}[1]->{
|
5157
|
0
|
|
|
|
|
|
$all_menu_items_array[$key-1]}})) {
|
5158
|
0
|
|
|
|
|
|
my $warn="\n WARNING! You Cannot Select ";
|
5159
|
0
|
|
|
|
|
|
$warn.="Line $numbor while Line $key is Selected!\n";
|
5160
|
0
|
|
|
|
|
|
print "$warn";sleep 2;
|
|
0
|
|
|
|
|
|
|
5161
|
0
|
|
|
|
|
|
$skip=1;
|
5162
|
|
|
|
|
|
|
} elsif ($picks{$key} eq '-') {
|
5163
|
0
|
|
|
|
|
|
delete ${$Selected}{$MenuUnit_hash_ref}{$key};
|
|
0
|
|
|
|
|
|
|
5164
|
0
|
|
|
|
|
|
delete $picks{$key};
|
5165
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5166
|
|
|
|
|
|
|
}
|
5167
|
|
|
|
|
|
|
}
|
5168
|
0
|
0
|
|
|
|
|
if ($skip==0) {
|
5169
|
0
|
|
|
|
|
|
$picks{$numbor}='*';
|
5170
|
|
|
|
|
|
|
$negate{$numbor}=
|
5171
|
0
|
|
|
|
|
|
${${$FullMenu}{$MenuUnit_hash_ref}[1]}
|
|
0
|
|
|
|
|
|
|
5172
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5173
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%picks;
|
|
0
|
|
|
|
|
|
|
5174
|
|
|
|
|
|
|
}
|
5175
|
|
|
|
|
|
|
}
|
5176
|
0
|
0
|
0
|
|
|
|
if ($prev_menu && $prev_menu!=$numbor) {
|
5177
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$prev_menu,
|
5178
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5179
|
0
|
|
|
|
|
|
delete $picks{$prev_menu};
|
5180
|
0
|
|
|
|
|
|
delete $items{$prev_menu};
|
5181
|
|
|
|
|
|
|
}
|
5182
|
|
|
|
|
|
|
} elsif (($show_banner_only && exists $MenuUnit_hash_ref->
|
5183
|
|
|
|
|
|
|
{Result} and ref $MenuUnit_hash_ref->
|
5184
|
|
|
|
|
|
|
{Result} eq 'HASH') || ($numbor=~/^\d+$/ &&
|
5185
|
|
|
|
|
|
|
(ref $FullMenu->{$MenuUnit_hash_ref}[2]
|
5186
|
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]||
|
5187
|
|
|
|
|
|
|
$all_menu_items_array[$pn{$digital_numbor}[1]-1]}
|
5188
|
|
|
|
|
|
|
eq 'HASH')) || ($numbor=~/^[Ff]$/ &&
|
5189
|
|
|
|
|
|
|
ref $FullMenu->{$MenuUnit_hash_ref}[2]
|
5190
|
|
|
|
|
|
|
{$all_menu_items_array[((keys %picks)[0]||1)-1]}
|
5191
|
|
|
|
|
|
|
eq 'HASH')) {
|
5192
|
0
|
|
|
|
|
|
my $numbor_is_eff=0;
|
5193
|
0
|
0
|
|
|
|
|
if ($numbor=~/^[Ff]$/) {
|
5194
|
0
|
|
|
|
|
|
$numbor=(keys %picks)[0];
|
5195
|
0
|
|
|
|
|
|
$numbor_is_eff=1;
|
5196
|
|
|
|
|
|
|
}
|
5197
|
0
|
0
|
|
|
|
|
if (grep { /Item_/ } keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5198
|
0
|
|
|
|
|
|
my @items=();
|
5199
|
0
|
|
|
|
|
|
foreach my $key (keys %{$MenuUnit_hash_ref}) {
|
|
0
|
|
|
|
|
|
|
5200
|
0
|
0
|
|
|
|
|
next unless $key=~/Item_/;
|
5201
|
0
|
|
|
|
|
|
push @items, $MenuUnit_hash_ref->{$key};
|
5202
|
|
|
|
|
|
|
}
|
5203
|
0
|
0
|
0
|
|
|
|
if ($#items==0 && ref $items[0] eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5204
|
0
|
|
|
|
|
|
(!grep { /Item_/ } keys %{$items[0]}) &&
|
|
0
|
|
|
|
|
|
|
5205
|
0
|
|
|
|
|
|
grep { /Banner/ } keys %{$items[0]}) {
|
|
0
|
|
|
|
|
|
|
5206
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
5207
|
|
|
|
|
|
|
}
|
5208
|
|
|
|
|
|
|
}
|
5209
|
0
|
0
|
0
|
|
|
|
if ($show_banner_only ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5210
|
0
|
|
|
|
|
|
(grep { /Item_/ } keys %{$FullMenu->{
|
5211
|
|
|
|
|
|
|
$MenuUnit_hash_ref}[2]{$all_menu_items_array[
|
5212
|
|
|
|
|
|
|
$numbor-1]||$all_menu_items_array[
|
5213
|
0
|
|
0
|
|
|
|
$pn{$numbor}[1]-1]}})|| exists $labels{
|
5214
|
|
|
|
|
|
|
(keys %{$FullMenu->{$MenuUnit_hash_ref}[2]
|
5215
|
0
|
|
0
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]
|
5216
|
|
|
|
|
|
|
||''}})[0]or[]}||
|
5217
|
|
|
|
|
|
|
&test_hashref($FullMenu->{$MenuUnit_hash_ref}[2]
|
5218
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]||
|
5219
|
|
|
|
|
|
|
$all_menu_items_array[$pn{$numbor}[1]-1]})) {
|
5220
|
0
|
|
|
|
|
|
my $menyou='';
|
5221
|
0
|
0
|
|
|
|
|
my $cur_menu=($filtered_menu)?$parent_menu:$MenuUnit_hash_ref;
|
5222
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
5223
|
0
|
|
|
|
|
|
my @all_copy=@all_menu_items_array;
|
5224
|
0
|
|
|
|
|
|
@all_menu_items_array=();
|
5225
|
0
|
|
|
|
|
|
my $pstart=0;
|
5226
|
0
|
|
|
|
|
|
my $pstop=0;
|
5227
|
0
|
|
|
|
|
|
foreach my $pik (sort numerically keys %pn) {
|
5228
|
0
|
|
|
|
|
|
$pstop=$pik-2;
|
5229
|
0
|
|
|
|
|
|
foreach my $item ($pstart..$pstop) {
|
5230
|
0
|
|
|
|
|
|
push @all_menu_items_array,'';
|
5231
|
|
|
|
|
|
|
}
|
5232
|
0
|
|
|
|
|
|
push @all_menu_items_array, shift @all_copy;
|
5233
|
0
|
|
|
|
|
|
$pstart=$pstop+2;
|
5234
|
0
|
|
|
|
|
|
$pstop=0;
|
5235
|
|
|
|
|
|
|
}
|
5236
|
0
|
|
|
|
|
|
while (my $pst=$pstart--) {
|
5237
|
0
|
0
|
|
|
|
|
if ($pst=~/0$/) {
|
5238
|
0
|
|
|
|
|
|
$FullMenu->{$cur_menu}[11]=$pst;
|
5239
|
0
|
|
|
|
|
|
last;
|
5240
|
|
|
|
|
|
|
}
|
5241
|
|
|
|
|
|
|
}
|
5242
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
5243
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5244
|
|
|
|
|
|
|
}
|
5245
|
0
|
0
|
|
|
|
|
if (!$filtered_menu) {
|
5246
|
0
|
0
|
|
|
|
|
if (exists $MenuUnit_hash_ref->{Result}) {
|
|
|
0
|
|
|
|
|
|
5247
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
5248
|
|
|
|
|
|
|
{'__FA_Banner__'}
|
5249
|
0
|
|
|
|
|
|
=$MenuUnit_hash_ref->{Result};
|
5250
|
|
|
|
|
|
|
} elsif (exists $labels{(keys %{$FullMenu->
|
5251
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5252
|
0
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]}})[0]}) {
|
5253
|
0
|
|
|
|
|
|
my %men_result=%{$FullMenu->
|
5254
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5255
|
0
|
|
|
|
|
|
{$all_menu_items_array[$digital_numbor-1]}};
|
5256
|
|
|
|
|
|
|
$menyou=&Data::Dump::Streamer::Dump($labels{
|
5257
|
0
|
|
|
|
|
|
(keys %men_result)[0]})->Out();
|
5258
|
|
|
|
|
|
|
#print "MENYOU=$menyou<==\n";;
|
5259
|
0
|
|
|
|
|
|
$menyou=~s/\$HASH\d*\s*=\s*//s;
|
5260
|
0
|
|
|
|
|
|
my $mnyou=eval $menyou;
|
5261
|
|
|
|
|
|
|
#print "WHAT IS THE CONVEY=$mnyou->{Item_1}->{Convey}<==\n";
|
5262
|
|
|
|
|
|
|
$FullMenu->
|
5263
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5264
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}=$mnyou;
|
5265
|
|
|
|
|
|
|
my $itemnum=$FullMenu->{$MenuUnit_hash_ref}[4]
|
5266
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5267
|
|
|
|
|
|
|
}
|
5268
|
|
|
|
|
|
|
}
|
5269
|
0
|
0
|
|
|
|
|
chomp($numbor) if $numbor;
|
5270
|
0
|
0
|
0
|
|
|
|
unless ($numbor_is_eff) {
|
5271
|
0
|
0
|
|
|
|
|
if (exists $picks{$numbor}) {
|
5272
|
|
|
|
|
|
|
#$FullMenu->{$cur_menu}[5]='ERASE';
|
5273
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5274
|
0
|
|
|
|
|
|
foreach my $key (keys %{$SaveNext}) {
|
|
0
|
|
|
|
|
|
|
5275
|
0
|
|
|
|
|
|
delete $SaveNext->{$key};
|
5276
|
|
|
|
|
|
|
}
|
5277
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
|
|
0
|
|
|
|
|
|
5278
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5279
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5280
|
0
|
|
|
|
|
|
delete $Selected->{$cur_menu}{$numbor};
|
5281
|
|
|
|
|
|
|
} elsif ($picks{$numbor} ne ' ') {
|
5282
|
0
|
|
|
|
|
|
&delete_Selected($cur_menu,$numbor,
|
5283
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5284
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5285
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5286
|
|
|
|
|
|
|
}
|
5287
|
|
|
|
|
|
|
}
|
5288
|
0
|
0
|
0
|
|
|
|
if ($prev_menu && $prev_menu!=$numbor) {
|
5289
|
|
|
|
|
|
|
#$FullMenu->{$cur_menu}[5]='ERASE';
|
5290
|
0
|
|
|
|
|
|
$hidedefaults=0;
|
5291
|
0
|
|
|
|
|
|
&delete_Selected($cur_menu,$prev_menu,
|
5292
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5293
|
0
|
|
|
|
|
|
delete $picks{$prev_menu};
|
5294
|
0
|
|
|
|
|
|
delete $items{$prev_menu};
|
5295
|
|
|
|
|
|
|
}
|
5296
|
|
|
|
|
|
|
} elsif (!$show_banner_only) {
|
5297
|
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5298
|
|
|
|
|
|
|
if (($start<=$key) || ($key<=$start+$choose_num)) {
|
5299
|
|
|
|
|
|
|
$numbor=$key;
|
5300
|
|
|
|
|
|
|
last;
|
5301
|
|
|
|
|
|
|
}
|
5302
|
|
|
|
|
|
|
}
|
5303
|
|
|
|
|
|
|
}
|
5304
|
0
|
|
|
|
|
|
my $next_menu_ref='';
|
5305
|
0
|
0
|
|
|
|
|
unless ($show_banner_only) {
|
5306
|
|
|
|
|
|
|
$next_menu_ref=$FullMenu->
|
5307
|
|
|
|
|
|
|
{$cur_menu}[2]
|
5308
|
0
|
0
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5309
|
|
|
|
|
|
|
unless $filtered_menu;
|
5310
|
0
|
|
0
|
|
|
|
$next_menu_ref||='';
|
5311
|
0
|
0
|
|
|
|
|
delete $SavePick->{$next_menu_ref}
|
5312
|
|
|
|
|
|
|
unless $filtered_menu;
|
5313
|
0
|
0
|
|
|
|
|
$FullMenu->{$next_menu_ref}[11]=0
|
5314
|
|
|
|
|
|
|
unless $filtered_menu;
|
5315
|
|
|
|
|
|
|
%picks=() if (!$select_many &&
|
5316
|
0
|
0
|
0
|
|
|
|
!exists ${$MenuUnit_hash_ref}{Select}{$numbor});
|
|
0
|
|
|
|
|
|
|
5317
|
0
|
0
|
0
|
|
|
|
$picks{$numbor}='-' if !(keys %picks) || $numbor!~/^[Ff]$/;
|
5318
|
|
|
|
|
|
|
}
|
5319
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,$Selected,
|
5320
|
|
|
|
|
|
|
$convey,$parent_menu)
|
5321
|
|
|
|
|
|
|
=$get_result->($cur_menu,
|
5322
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,
|
5323
|
|
|
|
|
|
|
$picks_from_parent,$FullMenu,$Conveyed,$Selected,
|
5324
|
|
|
|
|
|
|
$SaveNext,$Persists,$parent_menu);
|
5325
|
0
|
|
|
|
|
|
%{$SavePick->{$cur_menu}}=%picks;
|
|
0
|
|
|
|
|
|
|
5326
|
0
|
|
|
|
|
|
$Conveyed->{&pw($cur_menu)}=[];
|
5327
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
0
|
|
|
|
|
|
5328
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %picks) {
|
5329
|
0
|
|
|
|
|
|
push @{$Conveyed->{&pw($cur_menu)}},
|
|
0
|
|
|
|
|
|
|
5330
|
|
|
|
|
|
|
$all_menu_items_array[$key-1];
|
5331
|
|
|
|
|
|
|
}
|
5332
|
|
|
|
|
|
|
} elsif ($numbor) {
|
5333
|
0
|
|
|
|
|
|
$Conveyed->{&pw($cur_menu)}=
|
5334
|
|
|
|
|
|
|
$all_menu_items_array[$numbor-1];
|
5335
|
|
|
|
|
|
|
}
|
5336
|
0
|
|
|
|
|
|
my $mcount=0;
|
5337
|
0
|
0
|
|
|
|
|
unless (exists $SaveMMap->{$cur_menu}) {
|
5338
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
5339
|
0
|
|
|
|
|
|
my $pmap=[];
|
5340
|
0
|
|
|
|
|
|
foreach my $kee (keys %{$SaveMMap}) {
|
|
0
|
|
|
|
|
|
|
5341
|
|
|
|
|
|
|
my $map=&Data::Dump::Streamer::Dump(
|
5342
|
0
|
|
|
|
|
|
$SaveMMap->{$kee})->Out();
|
5343
|
0
|
|
|
|
|
|
$map=~s/\$ARRAY\d*\s*=\s*//s;
|
5344
|
0
|
|
|
|
|
|
my $m=eval $map;
|
5345
|
0
|
0
|
|
|
|
|
$pmap=$m if $#{$pmap}<$#{$m};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5346
|
|
|
|
|
|
|
}
|
5347
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=$pmap;
|
5348
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
5349
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu});
|
5350
|
|
|
|
|
|
|
} elsif ($parent_menu) {
|
5351
|
|
|
|
|
|
|
my $parent_map=&Data::Dump::Streamer::Dump(
|
5352
|
0
|
|
|
|
|
|
$SaveMMap->{$parent_menu})->Out();
|
5353
|
0
|
|
|
|
|
|
$parent_map=~s/\$ARRAY\d*\s*=\s*//s;
|
5354
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=eval $parent_map;
|
5355
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
5356
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu});
|
5357
|
|
|
|
|
|
|
} else {
|
5358
|
0
|
|
|
|
|
|
$SaveMMap->{$cur_menu}=[];
|
5359
|
|
|
|
|
|
|
}
|
5360
|
|
|
|
|
|
|
}
|
5361
|
0
|
0
|
|
|
|
|
if (ref $convey eq 'ARRAY') {
|
5362
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$cur_menu}},
|
|
0
|
|
|
|
|
|
|
5363
|
|
|
|
|
|
|
[ ++$mcount, $convey->[0] ];
|
5364
|
|
|
|
|
|
|
} else {
|
5365
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$cur_menu}},
|
|
0
|
|
|
|
|
|
|
5366
|
|
|
|
|
|
|
[ ++$mcount, $convey ];
|
5367
|
|
|
|
|
|
|
}
|
5368
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
5369
|
|
|
|
|
|
|
return $FullMenu->
|
5370
|
|
|
|
|
|
|
{$cur_menu}[2]
|
5371
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]},$convey,
|
5372
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
5373
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
5374
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
5375
|
|
|
|
|
|
|
$cur_menu,$no_wantarray;
|
5376
|
|
|
|
|
|
|
}
|
5377
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$cur_menu};
|
5378
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
5379
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
5380
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
5381
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
5382
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
5383
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
5384
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
5385
|
0
|
|
|
|
|
|
my $menu_result='';
|
5386
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$cur_menu}
|
5387
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
5388
|
|
|
|
|
|
|
$menu_result=$Selected->{$cur_menu}
|
5389
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
5390
|
0
|
0
|
|
|
|
|
$menu_result=$menu_result->() if ref
|
5391
|
|
|
|
|
|
|
$menu_result eq 'CODE';
|
5392
|
|
|
|
|
|
|
} else {
|
5393
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$cur_menu}[2]
|
5394
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5395
|
|
|
|
|
|
|
}
|
5396
|
0
|
|
|
|
|
|
eval {
|
5397
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
5398
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
5399
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
5400
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
5401
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
5402
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
5403
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
5404
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
5405
|
|
|
|
|
|
|
$cur_menu,$no_wantarray);
|
5406
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 7
|
5407
|
0
|
0
|
|
|
|
|
print "MENU RETURN 7\n" if $menu_return_debug;
|
5408
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
5409
|
0
|
0
|
0
|
|
|
|
if (ref $menu_output eq 'ARRAY' &&
|
5410
|
|
|
|
|
|
|
$menu_output->[0]=~/^[{](.*)[}][<]$/) {
|
5411
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
5412
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
5413
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
5414
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
5415
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
5416
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
5417
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
5418
|
0
|
|
|
|
|
|
%picks=();
|
5419
|
0
|
|
|
|
|
|
my $remainder=0;my $curscreennum=0;
|
|
0
|
|
|
|
|
|
|
5420
|
0
|
0
|
|
|
|
|
$remainder=$num_pick % $choose_num if $num_pick;
|
5421
|
0
|
0
|
|
|
|
|
$curscreennum=($start+$remainder==$num_pick)?
|
5422
|
|
|
|
|
|
|
$start+$remainder:$start+$choose_num;
|
5423
|
0
|
0
|
0
|
|
|
|
if ($curscreennum<$MenuUnit_hash_ref->{Scroll}->[1]
|
5424
|
|
|
|
|
|
|
&& $display_this_many_items<$num_pick-$start) {
|
5425
|
0
|
|
|
|
|
|
$start=$start+$display_this_many_items;
|
5426
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[11]=$start;
|
5427
|
0
|
0
|
|
|
|
|
if ($start+$remainder==$num_pick) {
|
5428
|
0
|
|
|
|
|
|
$choose_num=$num_pick-$start;
|
5429
|
|
|
|
|
|
|
} else {
|
5430
|
0
|
|
|
|
|
|
$choose_num=$display_this_many_items;
|
5431
|
|
|
|
|
|
|
}
|
5432
|
|
|
|
|
|
|
}
|
5433
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5434
|
0
|
|
|
|
|
|
next;
|
5435
|
|
|
|
|
|
|
} else {
|
5436
|
0
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref};
|
5437
|
0
|
|
|
|
|
|
return $menu_output,
|
5438
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5439
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5440
|
|
|
|
|
|
|
$Persists;
|
5441
|
|
|
|
|
|
|
}
|
5442
|
|
|
|
|
|
|
} else {
|
5443
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
5444
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
5445
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
5446
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
5447
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
5448
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
5449
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
5450
|
|
|
|
|
|
|
}
|
5451
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
5452
|
0
|
0
|
0
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
5453
|
0
|
0
|
|
|
|
|
if (grep { /\+|\*/ } values %picks) {
|
|
0
|
|
|
|
|
|
|
5454
|
0
|
|
|
|
|
|
return '+',
|
5455
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5456
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5457
|
|
|
|
|
|
|
$Persists;
|
5458
|
|
|
|
|
|
|
} else {
|
5459
|
0
|
|
|
|
|
|
my %sp_copy=%{$SavePick->{$parent_menu}}
|
5460
|
0
|
0
|
|
|
|
|
if exists $SavePick->{$parent_menu};
|
5461
|
0
|
|
|
|
|
|
foreach my $key (keys %sp_copy) {
|
5462
|
|
|
|
|
|
|
$SavePick->{$parent_menu}->{$key}='-' if
|
5463
|
0
|
0
|
|
|
|
|
$sp_copy{$key} eq '+';
|
5464
|
|
|
|
|
|
|
}
|
5465
|
0
|
|
|
|
|
|
return '-',
|
5466
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
5467
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5468
|
|
|
|
|
|
|
$Persists;
|
5469
|
|
|
|
|
|
|
}
|
5470
|
|
|
|
|
|
|
} elsif ($menu_output eq '-') {
|
5471
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
5472
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
5473
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
5474
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
5475
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5476
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE' and 1<$recurse_level) {
|
5477
|
0
|
|
|
|
|
|
return 'DONE';
|
5478
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
5479
|
0
|
|
|
|
|
|
return $menu_output;
|
5480
|
|
|
|
|
|
|
} else {
|
5481
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5482
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5483
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5484
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5485
|
|
|
|
|
|
|
#print "IN MAKEPLAN14\n";
|
5486
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}}
|
|
0
|
|
|
|
|
|
|
5487
|
|
|
|
|
|
|
&& !exists
|
5488
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
5489
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5490
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5491
|
|
|
|
|
|
|
}
|
5492
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
5493
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
5494
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5495
|
|
|
|
|
|
|
Number => $numbor,
|
5496
|
|
|
|
|
|
|
PlanID =>
|
5497
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
5498
|
0
|
|
|
|
|
|
Item => $all_menu_items_array[$numbor-1] }
|
5499
|
|
|
|
|
|
|
}
|
5500
|
|
|
|
|
|
|
}
|
5501
|
0
|
0
|
|
|
|
|
my $subfile=substr(
|
5502
|
|
|
|
|
|
|
$Term::Menus::fa_code,0,-3).'::'
|
5503
|
|
|
|
|
|
|
if $Term::Menus::fa_code;
|
5504
|
0
|
|
0
|
|
|
|
$subfile||='';
|
5505
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
5506
|
0
|
|
|
|
|
|
my @resu=();
|
5507
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
5508
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5509
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5510
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5511
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5512
|
|
|
|
|
|
|
#print "IN MAKEPLAN15\n";
|
5513
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5514
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5515
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5516
|
|
|
|
|
|
|
'Title'}) {
|
5517
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5518
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5519
|
|
|
|
|
|
|
}
|
5520
|
0
|
|
|
|
|
|
my $n='Numbor';
|
5521
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5522
|
0
|
|
|
|
|
|
'Plan'}},
|
5523
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5524
|
|
|
|
|
|
|
Number => $numbor,
|
5525
|
|
|
|
|
|
|
PlanID =>
|
5526
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5527
|
|
|
|
|
|
|
Item =>
|
5528
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out()
|
5529
|
|
|
|
|
|
|
}
|
5530
|
|
|
|
|
|
|
}
|
5531
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5532
|
0
|
0
|
|
|
|
|
if ($@) {
|
5533
|
0
|
0
|
0
|
|
|
|
if (10
|
5534
|
|
|
|
|
|
|
'FATAL ERROR') {
|
5535
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray &&
|
|
|
|
0
|
|
|
|
|
5536
|
|
|
|
|
|
|
!$no_wantarray) {
|
5537
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5538
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5539
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5540
|
|
|
|
|
|
|
}
|
5541
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5542
|
|
|
|
|
|
|
-1
|
5543
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5544
|
0
|
|
|
|
|
|
close($log_handle);
|
5545
|
|
|
|
|
|
|
}
|
5546
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5547
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5548
|
0
|
|
|
|
|
|
} else { die $@ }
|
5549
|
|
|
|
|
|
|
} else {
|
5550
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5551
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5552
|
|
|
|
|
|
|
."Conveyed\n"
|
5553
|
|
|
|
|
|
|
." the Following "
|
5554
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5555
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5556
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray &&
|
|
|
|
0
|
|
|
|
|
5557
|
|
|
|
|
|
|
!$no_wantarray) {
|
5558
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5559
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5560
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5561
|
|
|
|
|
|
|
}
|
5562
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5563
|
|
|
|
|
|
|
-1
|
5564
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5565
|
0
|
|
|
|
|
|
close($log_handle);
|
5566
|
|
|
|
|
|
|
}
|
5567
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5568
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5569
|
0
|
|
|
|
|
|
} else { die $die }
|
5570
|
|
|
|
|
|
|
}
|
5571
|
|
|
|
|
|
|
}
|
5572
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5573
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') {
|
5574
|
0
|
|
|
|
|
|
%picks=();
|
5575
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5576
|
|
|
|
|
|
|
next
|
5577
|
0
|
|
|
|
|
|
}
|
5578
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5579
|
0
|
|
|
|
|
|
return @resu;
|
5580
|
|
|
|
|
|
|
} else {
|
5581
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5582
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5583
|
|
|
|
|
|
|
}
|
5584
|
|
|
|
|
|
|
}
|
5585
|
0
|
|
|
|
|
|
$done=1;last
|
5586
|
0
|
|
|
|
|
|
}
|
5587
|
0
|
|
|
|
|
|
eval {
|
5588
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
5589
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5590
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5591
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5592
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5593
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5594
|
|
|
|
|
|
|
#print "IN MAKEPLAN16\n";
|
5595
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5596
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5597
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5598
|
|
|
|
|
|
|
'Title'}) {
|
5599
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5600
|
|
|
|
|
|
|
=$all_menu_items_array[$numbor-1];
|
5601
|
|
|
|
|
|
|
}
|
5602
|
0
|
|
|
|
|
|
my $n='Number';
|
5603
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5604
|
0
|
|
|
|
|
|
'Plan'}},
|
5605
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5606
|
|
|
|
|
|
|
Number => $numbor,
|
5607
|
|
|
|
|
|
|
PlanID =>
|
5608
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5609
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
5610
|
|
|
|
|
|
|
}
|
5611
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
5612
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
5613
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
5614
|
|
|
|
|
|
|
(-1
|
5615
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5616
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5617
|
|
|
|
|
|
|
} else {
|
5618
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5619
|
|
|
|
|
|
|
}
|
5620
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
5621
|
0
|
|
|
|
|
|
my $c=$Term::Menus::fa_code;
|
5622
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
5623
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}[2]
|
|
0
|
|
|
|
|
|
|
5624
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}) {
|
5625
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
5626
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
5627
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5628
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5629
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
5630
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
5631
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
5632
|
|
|
|
|
|
|
." that Does NOT Exist"
|
5633
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
5634
|
|
|
|
|
|
|
.$c.",\n\t\tnor was a routine with "
|
5635
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
5636
|
|
|
|
|
|
|
." main:: script.\n";
|
5637
|
|
|
|
|
|
|
} else {
|
5638
|
0
|
|
|
|
|
|
$die="$firsterr\n $seconderr"
|
5639
|
|
|
|
|
|
|
}
|
5640
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
5641
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5642
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5643
|
|
|
|
|
|
|
} else {
|
5644
|
0
|
|
|
|
|
|
die $die;
|
5645
|
|
|
|
|
|
|
}
|
5646
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
5647
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5648
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error(
|
5649
|
|
|
|
|
|
|
$firsterr);
|
5650
|
|
|
|
|
|
|
} else {
|
5651
|
0
|
|
|
|
|
|
die $firsterr;
|
5652
|
|
|
|
|
|
|
}
|
5653
|
|
|
|
|
|
|
}
|
5654
|
|
|
|
|
|
|
} else {
|
5655
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5656
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5657
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5658
|
|
|
|
|
|
|
} else {
|
5659
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5660
|
|
|
|
|
|
|
}
|
5661
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
5662
|
|
|
|
|
|
|
}
|
5663
|
|
|
|
|
|
|
};
|
5664
|
0
|
0
|
|
|
|
|
if ($@) {
|
5665
|
0
|
0
|
0
|
|
|
|
if (10
|
5666
|
|
|
|
|
|
|
'FATAL ERROR') {
|
5667
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5668
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5669
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5670
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5671
|
|
|
|
|
|
|
}
|
5672
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5673
|
|
|
|
|
|
|
-1
|
5674
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5675
|
0
|
|
|
|
|
|
close($log_handle);
|
5676
|
|
|
|
|
|
|
}
|
5677
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5678
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5679
|
0
|
|
|
|
|
|
} else { die $@ }
|
5680
|
|
|
|
|
|
|
} else {
|
5681
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5682
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5683
|
|
|
|
|
|
|
."Conveyed\n"
|
5684
|
|
|
|
|
|
|
." the Following "
|
5685
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5686
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5687
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5688
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5689
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5690
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5691
|
|
|
|
|
|
|
}
|
5692
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5693
|
|
|
|
|
|
|
-1
|
5694
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5695
|
0
|
|
|
|
|
|
close($log_handle);
|
5696
|
|
|
|
|
|
|
}
|
5697
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5698
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5699
|
0
|
|
|
|
|
|
} else { die $die }
|
5700
|
|
|
|
|
|
|
}
|
5701
|
|
|
|
|
|
|
}
|
5702
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5703
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') {
|
5704
|
0
|
|
|
|
|
|
%picks=();
|
5705
|
0
|
|
|
|
|
|
$show_banner_only=0;
|
5706
|
|
|
|
|
|
|
next
|
5707
|
0
|
|
|
|
|
|
}
|
5708
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5709
|
0
|
|
|
|
|
|
return @resu;
|
5710
|
|
|
|
|
|
|
} else {
|
5711
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5712
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5713
|
|
|
|
|
|
|
}
|
5714
|
|
|
|
|
|
|
}
|
5715
|
|
|
|
|
|
|
}
|
5716
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
5717
|
|
|
|
|
|
|
}
|
5718
|
|
|
|
|
|
|
}
|
5719
|
|
|
|
|
|
|
} elsif ($FullMenu && $caller eq $callertest &&
|
5720
|
|
|
|
|
|
|
($select_many || (keys %{$MenuUnit_hash_ref->{Select}}))) {
|
5721
|
0
|
0
|
0
|
|
|
|
if ($numbor!~/^[Ff]$/ && exists $picks{$numbor}) {
|
5722
|
0
|
0
|
|
|
|
|
if ($picks{$numbor} eq '*') {
|
5723
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5724
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5725
|
0
|
|
|
|
|
|
delete ${$Selected}{$MenuUnit_hash_ref}{$numbor};
|
|
0
|
|
|
|
|
|
|
5726
|
|
|
|
|
|
|
} else {
|
5727
|
0
|
|
|
|
|
|
&delete_Selected($MenuUnit_hash_ref,$numbor,
|
5728
|
|
|
|
|
|
|
$Selected,$SavePick,$SaveNext,$Persists);
|
5729
|
0
|
|
|
|
|
|
$SaveNext={%{$SavePick}};
|
|
0
|
|
|
|
|
|
|
5730
|
0
|
|
|
|
|
|
delete $picks{$numbor};
|
5731
|
0
|
|
|
|
|
|
delete $items{$numbor};
|
5732
|
0
|
|
|
|
|
|
} last;
|
5733
|
|
|
|
|
|
|
}
|
5734
|
0
|
0
|
|
|
|
|
if (keys %{$FullMenu->{$MenuUnit_hash_ref}[2]}) {
|
|
0
|
|
|
|
|
|
|
5735
|
0
|
0
|
|
|
|
|
$numbor=(keys %picks)[0] if $numbor=~/^[Ff]$/;
|
5736
|
|
|
|
|
|
|
my $test_result=
|
5737
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
5738
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
5739
|
0
|
0
|
0
|
|
|
|
if (ref $test_result eq 'CODE') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
5740
|
0
|
|
|
|
|
|
my $cd='';
|
5741
|
|
|
|
|
|
|
my $sub=$FullMenu->{$MenuUnit_hash_ref}[2]
|
5742
|
0
|
|
|
|
|
|
{$all_menu_items_array[$picknum-1]};
|
5743
|
0
|
|
|
|
|
|
my $select_ed=[];
|
5744
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
|
|
|
|
|
|
5745
|
0
|
|
|
|
|
|
foreach my $key (keys %picks) {
|
5746
|
0
|
|
|
|
|
|
push @{$select_ed}, $pn{$key}[0];
|
|
0
|
|
|
|
|
|
|
5747
|
|
|
|
|
|
|
}
|
5748
|
|
|
|
|
|
|
} else {
|
5749
|
0
|
|
|
|
|
|
$select_ed=$pn{$numbor}[0];
|
5750
|
|
|
|
|
|
|
}
|
5751
|
0
|
0
|
|
|
|
|
if ($Term::Menus::data_dump_streamer) {
|
5752
|
0
|
|
|
|
|
|
$cd=&Data::Dump::Streamer::Dump($sub)->Out();
|
5753
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
5754
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,'',
|
5755
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
5756
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
5757
|
|
|
|
|
|
|
#print "CD3=$cd\n<=CD\n";;
|
5758
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
5759
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
5760
|
|
|
|
|
|
|
$picks_from_parent);
|
5761
|
|
|
|
|
|
|
#print "CD4=$cd\n<=CD2\n";;
|
5762
|
|
|
|
|
|
|
}
|
5763
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
5764
|
0
|
|
|
|
|
|
$sub=eval $cd;
|
5765
|
0
|
|
|
|
|
|
my @resu=();
|
5766
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5767
|
0
|
0
|
|
|
|
|
if ($@) {
|
5768
|
0
|
0
|
0
|
|
|
|
if (10
|
5769
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5770
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5771
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5772
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5773
|
|
|
|
|
|
|
}
|
5774
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5775
|
|
|
|
|
|
|
-1
|
5776
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5777
|
0
|
|
|
|
|
|
close($log_handle);
|
5778
|
|
|
|
|
|
|
}
|
5779
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5780
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5781
|
0
|
|
|
|
|
|
} else { die $@ }
|
5782
|
|
|
|
|
|
|
} else {
|
5783
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5784
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5785
|
|
|
|
|
|
|
."Conveyed\n"
|
5786
|
|
|
|
|
|
|
." the Following "
|
5787
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5788
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5789
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5790
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5791
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5792
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5793
|
|
|
|
|
|
|
}
|
5794
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5795
|
|
|
|
|
|
|
-1
|
5796
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5797
|
0
|
|
|
|
|
|
close($log_handle);
|
5798
|
|
|
|
|
|
|
}
|
5799
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5800
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5801
|
0
|
|
|
|
|
|
} else { die $die }
|
5802
|
|
|
|
|
|
|
}
|
5803
|
|
|
|
|
|
|
}
|
5804
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5805
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5806
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5807
|
0
|
|
|
|
|
|
return @resu;
|
5808
|
|
|
|
|
|
|
} else {
|
5809
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5810
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5811
|
|
|
|
|
|
|
}
|
5812
|
|
|
|
|
|
|
}
|
5813
|
|
|
|
|
|
|
} elsif ($test_result &&
|
5814
|
|
|
|
|
|
|
($test_result!~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ ||
|
5815
|
|
|
|
|
|
|
(!grep { $1 eq $_ } list_module('main',
|
5816
|
|
|
|
|
|
|
$Term::Menus::fa_code) && $picks{$numbor} ne '*'))) {
|
5817
|
0
|
|
|
|
|
|
my $die="The \"Result12 =>\" Setting\n -> "
|
5818
|
|
|
|
|
|
|
."$test_result\n Found in the Menu "
|
5819
|
|
|
|
|
|
|
."Unit -> ".$MenuUnit_hash_ref
|
5820
|
|
|
|
|
|
|
."\n is NOT a Menu Unit\,"
|
5821
|
|
|
|
|
|
|
."\ and it is NOT a Valid Subroutine.\n\n"
|
5822
|
|
|
|
|
|
|
."\n Cannot Determine "
|
5823
|
|
|
|
|
|
|
."if it is a Valid SubRoutine.\n\n";
|
5824
|
0
|
|
|
|
|
|
die $die;
|
5825
|
|
|
|
|
|
|
} elsif (!defined $pn{$numbor}[0] ||
|
5826
|
|
|
|
|
|
|
!exists ${$FullMenu}{$MenuUnit_hash_ref}[2]{
|
5827
|
|
|
|
|
|
|
$pn{$numbor}[0]}) {
|
5828
|
0
|
|
|
|
|
|
my @resu=map { $all_menu_items_array[$_-1] }
|
|
0
|
|
|
|
|
|
|
5829
|
|
|
|
|
|
|
sort numerically keys %picks;
|
5830
|
0
|
|
|
|
|
|
push @resu,\%picks,$MenuUnit_hash_ref;
|
5831
|
0
|
0
|
0
|
|
|
|
if (wantarray && !$no_wantarray) {
|
|
|
0
|
|
|
|
|
|
5832
|
0
|
|
|
|
|
|
return @resu;
|
5833
|
|
|
|
|
|
|
} elsif ($#resu==0) {
|
5834
|
0
|
|
|
|
|
|
return @resu;
|
5835
|
|
|
|
|
|
|
} else {
|
5836
|
0
|
|
|
|
|
|
return \@resu;
|
5837
|
|
|
|
|
|
|
}
|
5838
|
|
|
|
|
|
|
}
|
5839
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}[2]
|
|
0
|
|
|
|
|
|
|
5840
|
|
|
|
|
|
|
{$pn{$numbor}[0]}) { }
|
5841
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,
|
5842
|
|
|
|
|
|
|
$Persists,$Selected,$convey,$parent_menu)
|
5843
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
5844
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
5845
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
5846
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
5847
|
0
|
|
|
|
|
|
my %pick=();
|
5848
|
0
|
|
|
|
|
|
$pick{$numbor}='*';
|
5849
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%pick;
|
|
0
|
|
|
|
|
|
|
5850
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5851
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
5852
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
5853
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5854
|
|
|
|
|
|
|
#print "IN MAKEPLAN17\n";
|
5855
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
5856
|
|
|
|
|
|
|
!exists
|
5857
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
5858
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5859
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5860
|
|
|
|
|
|
|
}
|
5861
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
5862
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
5863
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5864
|
|
|
|
|
|
|
Number => $numbor,
|
5865
|
|
|
|
|
|
|
PlanID =>
|
5866
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
5867
|
0
|
|
|
|
|
|
Item => $pn{$numbor}[0] }
|
5868
|
|
|
|
|
|
|
}
|
5869
|
|
|
|
|
|
|
}
|
5870
|
0
|
0
|
|
|
|
|
my $subfile=substr($Term::Menus::fa_code,0,-3)
|
5871
|
|
|
|
|
|
|
.'::' if $Term::Menus::fa_code;
|
5872
|
0
|
|
0
|
|
|
|
$subfile||='';
|
5873
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
5874
|
0
|
|
|
|
|
|
my @resu=();
|
5875
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
5876
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5877
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5878
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5879
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5880
|
|
|
|
|
|
|
#print "IN MAKEPLAN18\n";
|
5881
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5882
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5883
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5884
|
|
|
|
|
|
|
'Title'}) {
|
5885
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5886
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5887
|
|
|
|
|
|
|
}
|
5888
|
0
|
|
|
|
|
|
my $n='Number';
|
5889
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5890
|
0
|
|
|
|
|
|
'Plan'}},
|
5891
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5892
|
|
|
|
|
|
|
Number => $numbor,
|
5893
|
|
|
|
|
|
|
PlanID =>
|
5894
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5895
|
|
|
|
|
|
|
Item =>
|
5896
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out()
|
5897
|
|
|
|
|
|
|
}
|
5898
|
|
|
|
|
|
|
}
|
5899
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
5900
|
0
|
0
|
|
|
|
|
if ($@) {
|
5901
|
0
|
0
|
0
|
|
|
|
if (10
|
5902
|
|
|
|
|
|
|
eq 'FATAL ERROR') {
|
5903
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5904
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5905
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5906
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
5907
|
|
|
|
|
|
|
}
|
5908
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5909
|
|
|
|
|
|
|
-1
|
5910
|
0
|
|
|
|
|
|
print $log_handle $@;
|
5911
|
0
|
|
|
|
|
|
close($log_handle);
|
5912
|
|
|
|
|
|
|
}
|
5913
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5914
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
5915
|
0
|
|
|
|
|
|
} else { die $@ }
|
5916
|
|
|
|
|
|
|
} else {
|
5917
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
5918
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
5919
|
|
|
|
|
|
|
."Conveyed\n"
|
5920
|
|
|
|
|
|
|
." the Following "
|
5921
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
5922
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
5923
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5924
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
5925
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
5926
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
5927
|
|
|
|
|
|
|
}
|
5928
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
5929
|
|
|
|
|
|
|
-1
|
5930
|
0
|
|
|
|
|
|
print $log_handle $die;
|
5931
|
0
|
|
|
|
|
|
close($log_handle);
|
5932
|
|
|
|
|
|
|
}
|
5933
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
5934
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
5935
|
0
|
|
|
|
|
|
} else { die $die }
|
5936
|
|
|
|
|
|
|
}
|
5937
|
|
|
|
|
|
|
}
|
5938
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
5939
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5940
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
5941
|
0
|
|
|
|
|
|
return @resu;
|
5942
|
|
|
|
|
|
|
} else {
|
5943
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
5944
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
5945
|
|
|
|
|
|
|
}
|
5946
|
|
|
|
|
|
|
}
|
5947
|
0
|
|
|
|
|
|
$done=1;last
|
5948
|
0
|
|
|
|
|
|
}
|
5949
|
0
|
|
|
|
|
|
eval {
|
5950
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
5951
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
5952
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
5953
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
5954
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
5955
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
5956
|
|
|
|
|
|
|
#print "IN MAKEPLAN19\n";
|
5957
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
5958
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
5959
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
5960
|
|
|
|
|
|
|
'Title'}) {
|
5961
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
5962
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
5963
|
|
|
|
|
|
|
}
|
5964
|
0
|
|
|
|
|
|
my $n='Number';
|
5965
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
5966
|
0
|
|
|
|
|
|
'Plan'}},
|
5967
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
5968
|
|
|
|
|
|
|
Number => $numbor,
|
5969
|
|
|
|
|
|
|
PlanID =>
|
5970
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
5971
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
5972
|
|
|
|
|
|
|
}
|
5973
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
5974
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
5975
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
5976
|
|
|
|
|
|
|
(-1
|
5977
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
5978
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
5979
|
|
|
|
|
|
|
} else {
|
5980
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
5981
|
|
|
|
|
|
|
}
|
5982
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
5983
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
5984
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
5985
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
5986
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
5987
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
5988
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
5989
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
5990
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
5991
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
5992
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
5993
|
|
|
|
|
|
|
." that Does NOT Exist"
|
5994
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
5995
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
5996
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
5997
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
5998
|
|
|
|
|
|
|
." main:: script.\n";
|
5999
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
6000
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
6001
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6002
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
6003
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr);
|
6004
|
|
|
|
|
|
|
}
|
6005
|
|
|
|
|
|
|
} else {
|
6006
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6007
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6008
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6009
|
|
|
|
|
|
|
} else {
|
6010
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6011
|
|
|
|
|
|
|
}
|
6012
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
6013
|
|
|
|
|
|
|
}
|
6014
|
|
|
|
|
|
|
};
|
6015
|
0
|
0
|
|
|
|
|
if ($@) {
|
6016
|
0
|
0
|
0
|
|
|
|
if (10
|
6017
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6018
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6019
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6020
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6021
|
|
|
|
|
|
|
}
|
6022
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6023
|
|
|
|
|
|
|
-1
|
6024
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6025
|
0
|
|
|
|
|
|
close($log_handle);
|
6026
|
|
|
|
|
|
|
}
|
6027
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6028
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6029
|
0
|
|
|
|
|
|
} else { die $@ }
|
6030
|
|
|
|
|
|
|
} else {
|
6031
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6032
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6033
|
|
|
|
|
|
|
."Conveyed\n"
|
6034
|
|
|
|
|
|
|
." the Following "
|
6035
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6036
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6037
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6038
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6039
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6040
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6041
|
|
|
|
|
|
|
}
|
6042
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6043
|
|
|
|
|
|
|
-1
|
6044
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6045
|
0
|
|
|
|
|
|
close($log_handle);
|
6046
|
|
|
|
|
|
|
}
|
6047
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6048
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6049
|
0
|
|
|
|
|
|
} else { die $die }
|
6050
|
|
|
|
|
|
|
}
|
6051
|
|
|
|
|
|
|
}
|
6052
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6053
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6054
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6055
|
0
|
|
|
|
|
|
return @resu;
|
6056
|
|
|
|
|
|
|
} else {
|
6057
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6058
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6059
|
|
|
|
|
|
|
}
|
6060
|
|
|
|
|
|
|
}
|
6061
|
0
|
|
|
|
|
|
$done=1;last
|
6062
|
0
|
|
|
|
|
|
}
|
6063
|
0
|
|
|
|
|
|
} else { $done=1;last }
|
|
0
|
|
|
|
|
|
|
6064
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6065
|
|
|
|
|
|
|
} elsif (($show_banner_only && exists $MenuUnit_hash_ref->
|
6066
|
|
|
|
|
|
|
{Result} && ref $MenuUnit_hash_ref->{Result}
|
6067
|
0
|
|
|
|
|
|
eq 'CODE')||(keys %{$FullMenu->{$MenuUnit_hash_ref}[2]}
|
6068
|
|
|
|
|
|
|
&& exists $FullMenu->{$MenuUnit_hash_ref}[2]
|
6069
|
|
|
|
|
|
|
{$pn{$numbor}[0]})) {
|
6070
|
0
|
|
|
|
|
|
my $test_result='';
|
6071
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
6072
|
0
|
|
|
|
|
|
$test_result=$MenuUnit_hash_ref->{Result};
|
6073
|
0
|
|
|
|
|
|
$numbor=1;
|
6074
|
|
|
|
|
|
|
} else {
|
6075
|
|
|
|
|
|
|
$test_result=
|
6076
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{$pn{$numbor}[0]};
|
6077
|
|
|
|
|
|
|
}
|
6078
|
0
|
0
|
0
|
|
|
|
if (ref $test_result eq 'CODE') {
|
|
|
0
|
|
|
|
|
|
6079
|
0
|
|
|
|
|
|
my @resu=();
|
6080
|
0
|
|
|
|
|
|
my $test_result_loop=$test_result;
|
6081
|
0
|
|
|
|
|
|
while (1) {
|
6082
|
0
|
|
|
|
|
|
my $look_at_test_result=
|
6083
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump(
|
6084
|
|
|
|
|
|
|
$test_result_loop)->Out();
|
6085
|
0
|
|
|
|
|
|
my $tspmi_regex=qr/\](!)?t(?:e+st[-_]*)*[p|s]*
|
6086
|
|
|
|
|
|
|
(?:r+vious[-_]*|e+lected[-_]*)
|
6087
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
6088
|
0
|
|
|
|
|
|
my $sicm_regex=
|
6089
|
|
|
|
|
|
|
qr/\](!)?s(?:e+lected[-_]*)*i*(?:t+ems[-_]*)
|
6090
|
|
|
|
|
|
|
*c*(?:u+rrent[-_]*)*m*(?:e+nu[-_]*)*\[/xi;
|
6091
|
0
|
|
|
|
|
|
my $tbii_regex=qr/\](!)?i(?:n+put[-_]*)*b*(?:a+nner[-_]*)
|
6092
|
|
|
|
|
|
|
*m*(?:e+nu[-_]*)*i*(?:t+ems[-_]*)*\[/xi;
|
6093
|
0
|
|
|
|
|
|
my $trim_look=$look_at_test_result;
|
6094
|
0
|
|
|
|
|
|
$trim_look=~s/^.*(\$CODE\d+\s*=\s*.*$)/$1/s;
|
6095
|
0
|
0
|
0
|
|
|
|
if ((($trim_look!~/Item_/s &&
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6096
|
|
|
|
|
|
|
$trim_look!~/[']Result['][,]/s) ||
|
6097
|
|
|
|
|
|
|
$trim_look=~/=\s*[']Item_/s) ||
|
6098
|
|
|
|
|
|
|
$look_at_test_result=~/$tspmi_regex/ ||
|
6099
|
|
|
|
|
|
|
$trim_look=~/$sicm_regex/ ||
|
6100
|
|
|
|
|
|
|
$trim_look=~/$tbii_regex/) {
|
6101
|
0
|
0
|
|
|
|
|
%picks=() unless $select_many;
|
6102
|
0
|
|
|
|
|
|
$picks{$numbor}='';
|
6103
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,
|
6104
|
|
|
|
|
|
|
$Selected,$convey,$parent_menu)
|
6105
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
6106
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
6107
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
6108
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
6109
|
0
|
0
|
|
|
|
|
my $item=($show_banner_only)?'__FA_Banner__':$numbor;
|
6110
|
|
|
|
|
|
|
$test_result_loop=
|
6111
|
|
|
|
|
|
|
$Selected->{$MenuUnit_hash_ref}->{$item}
|
6112
|
0
|
0
|
|
|
|
|
if $Selected->{$MenuUnit_hash_ref}->{$item};
|
6113
|
0
|
|
|
|
|
|
my $cd=&Data::Dump::Streamer::Dump(
|
6114
|
|
|
|
|
|
|
$test_result_loop)->Out();
|
6115
|
|
|
|
|
|
|
$cd=&transform_sicm($cd,$numbor,
|
6116
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6117
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6118
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6119
|
0
|
|
|
|
|
|
$cd=&transform_pmsi($cd,
|
6120
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6121
|
|
|
|
|
|
|
$picks_from_parent);
|
6122
|
0
|
|
|
|
|
|
$cd=&transform_mbir($cd,$Conveyed,$MenuUnit_hash_ref,
|
6123
|
|
|
|
|
|
|
$log_handle);
|
6124
|
0
|
|
|
|
|
|
$cd=~s/\$CODE\d*\s*=\s*//s;
|
6125
|
0
|
|
|
|
|
|
eval { $test_result_loop=eval $cd };
|
|
0
|
|
|
|
|
|
|
6126
|
|
|
|
|
|
|
}
|
6127
|
0
|
|
|
|
|
|
eval { @resu=$test_result_loop->() };
|
|
0
|
|
|
|
|
|
|
6128
|
0
|
0
|
|
|
|
|
if ($@) {
|
6129
|
0
|
0
|
0
|
|
|
|
if (10
|
6130
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6131
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6132
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6133
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6134
|
|
|
|
|
|
|
}
|
6135
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6136
|
|
|
|
|
|
|
-1
|
6137
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6138
|
0
|
|
|
|
|
|
close($log_handle);
|
6139
|
|
|
|
|
|
|
}
|
6140
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6141
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6142
|
0
|
|
|
|
|
|
} else { die $@ }
|
6143
|
|
|
|
|
|
|
} else {
|
6144
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6145
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6146
|
|
|
|
|
|
|
."Conveyed\n"
|
6147
|
|
|
|
|
|
|
." the Following "
|
6148
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6149
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6150
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6151
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6152
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6153
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6154
|
|
|
|
|
|
|
}
|
6155
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6156
|
|
|
|
|
|
|
-1
|
6157
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6158
|
0
|
|
|
|
|
|
close($log_handle);
|
6159
|
|
|
|
|
|
|
}
|
6160
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6161
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6162
|
0
|
|
|
|
|
|
} else { die $die }
|
6163
|
|
|
|
|
|
|
}
|
6164
|
|
|
|
|
|
|
}
|
6165
|
0
|
0
|
0
|
|
|
|
if (0==$#resu && ref $resu[0] eq 'CODE') {
|
6166
|
0
|
|
|
|
|
|
$test_result_loop=$resu[0];
|
6167
|
0
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref}=$resu[0];
|
6168
|
0
|
|
|
|
|
|
next;
|
6169
|
|
|
|
|
|
|
} else {
|
6170
|
0
|
|
|
|
|
|
last;
|
6171
|
|
|
|
|
|
|
}
|
6172
|
|
|
|
|
|
|
}
|
6173
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6174
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6175
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
0
|
0
|
|
|
|
|
6176
|
0
|
0
|
|
|
|
|
if (1==$recurse_level) {
|
6177
|
0
|
|
|
|
|
|
return \@resu;
|
6178
|
|
|
|
|
|
|
} else {
|
6179
|
0
|
|
|
|
|
|
return @resu;
|
6180
|
|
|
|
|
|
|
}
|
6181
|
|
|
|
|
|
|
} elsif (ref $resu[0] eq 'HASH') {
|
6182
|
0
|
0
|
0
|
|
|
|
if (grep { /Item_/ } keys %{$resu[0]} && $parent_menu) {
|
|
0
|
|
|
|
|
|
|
6183
|
0
|
0
|
|
|
|
|
if (exists $FullMenu->{$parent_menu}[2]
|
6184
|
|
|
|
|
|
|
{'__FA_Banner__'}) {
|
6185
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
6186
|
0
|
|
|
|
|
|
{'__FA_Banner__'}=$resu[0];
|
6187
|
|
|
|
|
|
|
} else {
|
6188
|
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]
|
6189
|
0
|
|
|
|
|
|
{$pn{$numbor}[0]}=$resu[0];
|
6190
|
|
|
|
|
|
|
}
|
6191
|
|
|
|
|
|
|
} else {
|
6192
|
0
|
|
|
|
|
|
$FullMenu->{$MenuUnit_hash_ref}[2]{'__FA_Banner__'}=
|
6193
|
|
|
|
|
|
|
$resu[0];
|
6194
|
|
|
|
|
|
|
}
|
6195
|
|
|
|
|
|
|
} else {
|
6196
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6197
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6198
|
|
|
|
|
|
|
}
|
6199
|
|
|
|
|
|
|
}
|
6200
|
|
|
|
|
|
|
} elsif ($test_result!~/^&?(?:.*::)*(\w+)\s*[(]?.*[)]?\s*$/ ||
|
6201
|
|
|
|
|
|
|
!grep { $1 eq $_ } list_module(
|
6202
|
|
|
|
|
|
|
'main',$Term::Menus::fa_code)) {
|
6203
|
0
|
|
|
|
|
|
my $die="The \"Result14 =>\" Setting\n -> "
|
6204
|
|
|
|
|
|
|
.$test_result
|
6205
|
|
|
|
|
|
|
."\n Found in the Menu Unit -> "
|
6206
|
|
|
|
|
|
|
.$MenuUnit_hash_ref
|
6207
|
|
|
|
|
|
|
."\n is not a Menu Unit\,"
|
6208
|
|
|
|
|
|
|
." and not a Valid SubRoutine.\n\n";
|
6209
|
0
|
|
|
|
|
|
die $die;
|
6210
|
|
|
|
|
|
|
}
|
6211
|
0
|
0
|
|
|
|
|
%picks=() unless $select_many;
|
6212
|
0
|
|
|
|
|
|
$picks{$numbor}='';
|
6213
|
0
|
|
|
|
|
|
($FullMenu,$Conveyed,$SaveNext,$Persists,
|
6214
|
|
|
|
|
|
|
$Selected,$convey,$parent_menu)
|
6215
|
|
|
|
|
|
|
=$get_result->($MenuUnit_hash_ref,
|
6216
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,$picks_from_parent,
|
6217
|
|
|
|
|
|
|
$FullMenu,$Conveyed,$Selected,$SaveNext,
|
6218
|
|
|
|
|
|
|
$Persists,$parent_menu);
|
6219
|
0
|
|
|
|
|
|
my $show_banner_only=0;
|
6220
|
0
|
|
|
|
|
|
my $test_item='';
|
6221
|
0
|
0
|
|
|
|
|
if (exists $Selected->{$MenuUnit_hash_ref}{'__FA_Banner__'}) {
|
6222
|
0
|
|
|
|
|
|
$test_item=$Selected->{$MenuUnit_hash_ref}{'__FA_Banner__'};
|
6223
|
0
|
|
|
|
|
|
$show_banner_only=1;
|
6224
|
|
|
|
|
|
|
} else {
|
6225
|
|
|
|
|
|
|
$test_item=$FullMenu->{$MenuUnit_hash_ref}[2]
|
6226
|
0
|
|
|
|
|
|
{$pn{$numbor}[0]};
|
6227
|
|
|
|
|
|
|
}
|
6228
|
0
|
|
0
|
|
|
|
$test_item||='';
|
6229
|
0
|
0
|
0
|
|
|
|
if ((ref $test_item eq 'HASH' &&
|
|
|
|
0
|
|
|
|
|
6230
|
0
|
|
|
|
|
|
grep { /Item_/ } keys %{$test_item}) ||
|
|
0
|
|
|
|
|
|
|
6231
|
|
|
|
|
|
|
$show_banner_only) {
|
6232
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=[];
|
6233
|
0
|
0
|
|
|
|
|
if (0<$#{[keys %picks]}) {
|
|
0
|
|
|
|
|
|
|
6234
|
0
|
|
|
|
|
|
foreach my $key (sort numerically keys %picks) {
|
6235
|
0
|
|
|
|
|
|
push @{$Conveyed->{&pw($MenuUnit_hash_ref)}},
|
|
0
|
|
|
|
|
|
|
6236
|
|
|
|
|
|
|
$all_menu_items_array[$key-1];
|
6237
|
|
|
|
|
|
|
}
|
6238
|
|
|
|
|
|
|
} else {
|
6239
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=
|
6240
|
|
|
|
|
|
|
$all_menu_items_array[$numbor-1];
|
6241
|
|
|
|
|
|
|
}
|
6242
|
0
|
|
|
|
|
|
my $mcount=0;
|
6243
|
0
|
0
|
|
|
|
|
unless (exists $SaveMMap->{$MenuUnit_hash_ref}) {
|
6244
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
6245
|
0
|
|
|
|
|
|
my $pmap=[];
|
6246
|
0
|
|
|
|
|
|
foreach my $kee (keys %{$SaveMMap}) {
|
|
0
|
|
|
|
|
|
|
6247
|
|
|
|
|
|
|
my $map=&Data::Dump::Streamer::Dump(
|
6248
|
0
|
|
|
|
|
|
$SaveMMap->{$kee})->Out();
|
6249
|
0
|
|
|
|
|
|
$map=~s/\$ARRAY\d*\s*=\s*//s;
|
6250
|
0
|
|
|
|
|
|
my $m=eval $map;
|
6251
|
0
|
0
|
|
|
|
|
$pmap=$m if $#{$pmap}<$#{$m};
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6252
|
|
|
|
|
|
|
}
|
6253
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=$pmap;
|
6254
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
6255
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref});
|
6256
|
|
|
|
|
|
|
} elsif ($parent_menu) {
|
6257
|
|
|
|
|
|
|
my $parent_map=&Data::Dump::Streamer::Dump(
|
6258
|
0
|
|
|
|
|
|
$SaveMMap->{$parent_menu})->Out();
|
6259
|
0
|
|
|
|
|
|
$parent_map=~s/\$ARRAY\d*\s*=\s*//s;
|
6260
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=eval $parent_map;
|
6261
|
|
|
|
|
|
|
$mcount=&get_Menu_map_count(
|
6262
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref});
|
6263
|
|
|
|
|
|
|
} else {
|
6264
|
0
|
|
|
|
|
|
$SaveMMap->{$MenuUnit_hash_ref}=[];
|
6265
|
|
|
|
|
|
|
}
|
6266
|
|
|
|
|
|
|
}
|
6267
|
0
|
0
|
|
|
|
|
if (ref $convey eq 'ARRAY') {
|
6268
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$MenuUnit_hash_ref}},
|
|
0
|
|
|
|
|
|
|
6269
|
|
|
|
|
|
|
[ ++$mcount, $convey->[0] ];
|
6270
|
|
|
|
|
|
|
} else {
|
6271
|
0
|
|
|
|
|
|
push @{$SaveMMap->{$MenuUnit_hash_ref}},
|
|
0
|
|
|
|
|
|
|
6272
|
|
|
|
|
|
|
[ ++$mcount, $convey ];
|
6273
|
|
|
|
|
|
|
}
|
6274
|
0
|
|
|
|
|
|
$MenuMap=$SaveMMap->{$MenuUnit_hash_ref};
|
6275
|
0
|
|
|
|
|
|
my $returned_FullMenu='';
|
6276
|
0
|
|
|
|
|
|
my $returned_Selected='';
|
6277
|
0
|
|
|
|
|
|
my $returned_Conveyed='';
|
6278
|
0
|
|
|
|
|
|
my $returned_SavePick='';
|
6279
|
0
|
|
|
|
|
|
my $returned_SaveMMap='';
|
6280
|
0
|
|
|
|
|
|
my $returned_SaveNext='';
|
6281
|
0
|
|
|
|
|
|
my $returned_Persists='';
|
6282
|
0
|
|
|
|
|
|
my $menu_result='';
|
6283
|
0
|
0
|
|
|
|
|
if ($show_banner_only) {
|
6284
|
0
|
|
|
|
|
|
$menu_result=$test_item;
|
6285
|
|
|
|
|
|
|
} else {
|
6286
|
|
|
|
|
|
|
$menu_result=$FullMenu->{$MenuUnit_hash_ref}[2]
|
6287
|
0
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]};
|
6288
|
|
|
|
|
|
|
}
|
6289
|
|
|
|
|
|
|
$SaveNext->{$MenuUnit_hash_ref}=$menu_result
|
6290
|
0
|
0
|
|
|
|
|
unless exists $SaveNext->{$MenuUnit_hash_ref};
|
6291
|
0
|
|
|
|
|
|
eval {
|
6292
|
0
|
|
|
|
|
|
($menu_output,$returned_FullMenu,
|
6293
|
|
|
|
|
|
|
$returned_Selected,$returned_Conveyed,
|
6294
|
|
|
|
|
|
|
$returned_SavePick,$returned_SaveMMap,
|
6295
|
|
|
|
|
|
|
$returned_SaveNext,$returned_Persists)
|
6296
|
|
|
|
|
|
|
=&Menu($menu_result,$convey,
|
6297
|
|
|
|
|
|
|
$recurse_level,$FullMenu,
|
6298
|
|
|
|
|
|
|
$Selected,$Conveyed,$SavePick,
|
6299
|
|
|
|
|
|
|
$SaveMMap,$SaveNext,$Persists,
|
6300
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$no_wantarray);
|
6301
|
|
|
|
|
|
|
}; # MENU RETURN MENURETURN 8
|
6302
|
0
|
0
|
|
|
|
|
print "MENU RETURN 8\n" if $menu_return_debug;
|
6303
|
0
|
0
|
|
|
|
|
die $@ if $@;
|
6304
|
0
|
0
|
|
|
|
|
chomp($menu_output) if !(ref $menu_output);
|
6305
|
0
|
|
|
|
|
|
my $test_for_menu_name=$MenuUnit_hash_ref->{Name};
|
6306
|
0
|
0
|
0
|
|
|
|
if ($menu_output eq '-') {
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
6307
|
0
|
|
|
|
|
|
$return_from_child_menu='-';
|
6308
|
0
|
|
|
|
|
|
next;
|
6309
|
|
|
|
|
|
|
} elsif ($menu_output eq '+') {
|
6310
|
0
|
|
|
|
|
|
$return_from_child_menu='+';
|
6311
|
0
|
|
|
|
|
|
next;
|
6312
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE_SUB') {
|
6313
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6314
|
|
|
|
|
|
|
} elsif ($menu_output eq 'DONE' and 1<$recurse_level) {
|
6315
|
0
|
|
|
|
|
|
return 'DONE';
|
6316
|
|
|
|
|
|
|
} elsif (ref $menu_output eq 'ARRAY' &&
|
6317
|
|
|
|
|
|
|
$menu_output->[0]=~
|
6318
|
|
|
|
|
|
|
/^[{]$test_for_menu_name[}][<]$/) {
|
6319
|
0
|
|
|
|
|
|
delete $Selected->{$MenuUnit_hash_ref};
|
6320
|
0
|
|
|
|
|
|
delete $Conveyed->{$MenuUnit_hash_ref};
|
6321
|
0
|
|
|
|
|
|
delete $SavePick->{$MenuUnit_hash_ref};
|
6322
|
0
|
|
|
|
|
|
delete $SaveMMap->{$MenuUnit_hash_ref};
|
6323
|
0
|
|
|
|
|
|
delete $SaveNext->{$MenuUnit_hash_ref};
|
6324
|
0
|
|
|
|
|
|
delete $Persists->{$MenuUnit_hash_ref};
|
6325
|
|
|
|
|
|
|
delete $FullMenu->{$MenuUnit_hash_ref}[2]
|
6326
|
0
|
|
|
|
|
|
{'__FA_Banner__'};
|
6327
|
0
|
|
|
|
|
|
%picks=();
|
6328
|
|
|
|
|
|
|
$start=$FullMenu->{$MenuUnit_hash_ref}[11]-1 if
|
6329
|
0
|
0
|
|
|
|
|
$start+$choose_num<$FullMenu->{$MenuUnit_hash_ref}[11];
|
6330
|
0
|
0
|
|
|
|
|
$choose_num=$num_pick-$start if
|
6331
|
|
|
|
|
|
|
$display_this_many_items>=$num_pick-$start;
|
6332
|
0
|
|
|
|
|
|
next;
|
6333
|
|
|
|
|
|
|
} elsif ($menu_output) {
|
6334
|
0
|
|
|
|
|
|
return $menu_output;
|
6335
|
|
|
|
|
|
|
} else {
|
6336
|
0
|
|
|
|
|
|
$FullMenu=$returned_FullMenu;
|
6337
|
0
|
|
|
|
|
|
$Selected=$returned_Selected;
|
6338
|
0
|
|
|
|
|
|
$Conveyed=$returned_Conveyed;
|
6339
|
0
|
|
|
|
|
|
$SavePick=$returned_SavePick;
|
6340
|
0
|
|
|
|
|
|
$SaveMMap=$returned_SaveMMap;
|
6341
|
0
|
|
|
|
|
|
$SaveNext=$returned_SaveNext;
|
6342
|
0
|
|
|
|
|
|
$Persists=$returned_Persists;
|
6343
|
|
|
|
|
|
|
}
|
6344
|
|
|
|
|
|
|
}
|
6345
|
0
|
|
|
|
|
|
my %pick=();
|
6346
|
0
|
|
|
|
|
|
$pick{$numbor}='*';
|
6347
|
0
|
|
|
|
|
|
%{$SavePick->{$MenuUnit_hash_ref}}=%pick;
|
|
0
|
|
|
|
|
|
|
6348
|
0
|
0
|
|
|
|
|
my $subfile=($Term::Menus::fullauto)
|
6349
|
|
|
|
|
|
|
?substr($Term::Menus::fa_code,0,-3).'::'
|
6350
|
|
|
|
|
|
|
:'';
|
6351
|
0
|
|
|
|
|
|
foreach my $sub (&get_subs_from_menu($Selected)) {
|
6352
|
0
|
|
|
|
|
|
my @resu=();
|
6353
|
0
|
0
|
|
|
|
|
if (ref $sub eq 'CODE') {
|
6354
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6355
|
|
|
|
|
|
|
$MenuUnit_hash_ref->{'NoPlan'} ||
|
6356
|
|
|
|
|
|
|
!$MenuUnit_hash_ref->{'NoPlan'}) &&
|
6357
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6358
|
|
|
|
|
|
|
#print "IN MAKEPLAN20\n";
|
6359
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
6360
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
6361
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
6362
|
|
|
|
|
|
|
'Title'}) {
|
6363
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
6364
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
6365
|
|
|
|
|
|
|
}
|
6366
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
6367
|
0
|
|
|
|
|
|
'Plan'}},
|
6368
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6369
|
|
|
|
|
|
|
Number => $numbor,
|
6370
|
|
|
|
|
|
|
PlanID =>
|
6371
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
6372
|
0
|
|
|
|
|
|
Item =>
|
6373
|
|
|
|
|
|
|
&Data::Dump::Streamer::Dump($sub)->Out() }
|
6374
|
|
|
|
|
|
|
}
|
6375
|
0
|
|
|
|
|
|
eval { @resu=$sub->() };
|
|
0
|
|
|
|
|
|
|
6376
|
0
|
0
|
|
|
|
|
if ($@) {
|
6377
|
0
|
0
|
0
|
|
|
|
if (10
|
6378
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6379
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6380
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6381
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6382
|
|
|
|
|
|
|
}
|
6383
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6384
|
|
|
|
|
|
|
-1
|
6385
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6386
|
0
|
|
|
|
|
|
close($log_handle);
|
6387
|
|
|
|
|
|
|
}
|
6388
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6389
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6390
|
0
|
|
|
|
|
|
} else { die $@ }
|
6391
|
|
|
|
|
|
|
} else {
|
6392
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6393
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6394
|
|
|
|
|
|
|
."Conveyed\n"
|
6395
|
|
|
|
|
|
|
." the Following "
|
6396
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6397
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6398
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6399
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6400
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6401
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6402
|
|
|
|
|
|
|
}
|
6403
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6404
|
|
|
|
|
|
|
-1
|
6405
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6406
|
0
|
|
|
|
|
|
close($log_handle);
|
6407
|
|
|
|
|
|
|
}
|
6408
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6409
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6410
|
0
|
|
|
|
|
|
} else { die $die }
|
6411
|
|
|
|
|
|
|
}
|
6412
|
|
|
|
|
|
|
}
|
6413
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6414
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6415
|
0
|
0
|
|
|
|
|
if ($resu[0]=~/^[{](.*)[}][<]$/) {
|
6416
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
6417
|
0
|
|
|
|
|
|
%picks=();next;
|
|
0
|
|
|
|
|
|
|
6418
|
|
|
|
|
|
|
} else {
|
6419
|
0
|
|
|
|
|
|
return $resu[0];
|
6420
|
|
|
|
|
|
|
}
|
6421
|
|
|
|
|
|
|
}
|
6422
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6423
|
0
|
|
|
|
|
|
return @resu;
|
6424
|
|
|
|
|
|
|
} else {
|
6425
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6426
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6427
|
|
|
|
|
|
|
}
|
6428
|
|
|
|
|
|
|
}
|
6429
|
0
|
|
|
|
|
|
$done=1;last
|
6430
|
0
|
|
|
|
|
|
}
|
6431
|
0
|
|
|
|
|
|
eval {
|
6432
|
0
|
0
|
|
|
|
|
if ($subfile) {
|
6433
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6434
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6435
|
|
|
|
|
|
|
${$MenuUnit_hash_ref}{'NoPlan'} ||
|
6436
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
6437
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6438
|
|
|
|
|
|
|
#print "IN MAKEPLAN21\n";
|
6439
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{
|
6440
|
0
|
|
|
|
|
|
'Plan'}} && !exists
|
6441
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{
|
6442
|
|
|
|
|
|
|
'Title'}) {
|
6443
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}
|
6444
|
0
|
|
|
|
|
|
=$pn{$numbor}[0];
|
6445
|
|
|
|
|
|
|
}
|
6446
|
0
|
|
|
|
|
|
my $n='Number';
|
6447
|
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{
|
6448
|
0
|
|
|
|
|
|
'Plan'}},
|
6449
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6450
|
|
|
|
|
|
|
Number => $numbor,
|
6451
|
|
|
|
|
|
|
PlanID =>
|
6452
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{$n},
|
6453
|
|
|
|
|
|
|
Item => "&$subfile$sub" }
|
6454
|
|
|
|
|
|
|
}
|
6455
|
|
|
|
|
|
|
$sub=&transform_sicm($sub,$numbor,
|
6456
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6457
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6458
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6459
|
0
|
|
|
|
|
|
$sub=&transform_pmsi($sub,
|
6460
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6461
|
|
|
|
|
|
|
$picks_from_parent);
|
6462
|
0
|
|
|
|
|
|
eval "\@resu=\&$subfile$sub";
|
6463
|
0
|
|
0
|
|
|
|
my $firsterr=$@||'';
|
6464
|
0
|
0
|
0
|
|
|
|
if ((-1
|
|
|
0
|
|
|
|
|
|
6465
|
|
|
|
|
|
|
(-1
|
6466
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6467
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6468
|
|
|
|
|
|
|
} else {
|
6469
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6470
|
|
|
|
|
|
|
}
|
6471
|
0
|
|
0
|
|
|
|
my $seconderr=$@||'';my $die='';
|
|
0
|
|
|
|
|
|
|
6472
|
0
|
0
|
|
|
|
|
if ($seconderr=~/Undefined subroutine/) {
|
6473
|
0
|
0
|
|
|
|
|
if (${$FullMenu}{$MenuUnit_hash_ref}
|
|
0
|
|
|
|
|
|
|
6474
|
|
|
|
|
|
|
[2]{$all_menu_items_array[$numbor-1]}) {
|
6475
|
|
|
|
|
|
|
$die="The \"Result15 =>\" Setting"
|
6476
|
0
|
|
|
|
|
|
."\n\t\t-> " . ${$FullMenu}
|
6477
|
|
|
|
|
|
|
{$MenuUnit_hash_ref}[2]
|
6478
|
|
|
|
|
|
|
{$all_menu_items_array[$numbor-1]}
|
6479
|
|
|
|
|
|
|
."\n\t\tFound in the Menu Unit -> "
|
6480
|
0
|
|
|
|
|
|
.$MenuUnit_hash_ref->{Name}."\n\t\t"
|
6481
|
|
|
|
|
|
|
."Specifies a Subroutine"
|
6482
|
|
|
|
|
|
|
." that Does NOT Exist"
|
6483
|
|
|
|
|
|
|
."\n\t\tin the User Code File "
|
6484
|
|
|
|
|
|
|
.$Term::Menus::fa_code
|
6485
|
|
|
|
|
|
|
.",\n\t\tnor was a routine with "
|
6486
|
|
|
|
|
|
|
."that name\n\t\tlocated in the"
|
6487
|
|
|
|
|
|
|
." main:: script.\n";
|
6488
|
0
|
|
|
|
|
|
} else { $die="$firsterr\n $seconderr" }
|
6489
|
0
|
|
|
|
|
|
} else { $die=$seconderr }
|
6490
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die.
|
6491
|
|
|
|
|
|
|
"\n\n line ".__LINE__);
|
6492
|
|
|
|
|
|
|
} elsif ($firsterr) {
|
6493
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6494
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($firsterr.
|
6495
|
|
|
|
|
|
|
"\n\n line ".__LINE__);
|
6496
|
|
|
|
|
|
|
} else {
|
6497
|
0
|
|
|
|
|
|
die "$firsterr\n\n line ".__LINE__;
|
6498
|
|
|
|
|
|
|
}
|
6499
|
|
|
|
|
|
|
}
|
6500
|
|
|
|
|
|
|
} else {
|
6501
|
|
|
|
|
|
|
$sub=&transform_sicm($sub,$numbor,
|
6502
|
|
|
|
|
|
|
\@all_menu_items_array,\%picks,\%pn,
|
6503
|
|
|
|
|
|
|
$return_from_child_menu,$log_handle,
|
6504
|
0
|
|
|
|
|
|
$MenuUnit_hash_ref->{Name});
|
6505
|
0
|
|
|
|
|
|
$sub=&transform_pmsi($sub,
|
6506
|
|
|
|
|
|
|
$Conveyed,$SaveMMap,
|
6507
|
|
|
|
|
|
|
$picks_from_parent);
|
6508
|
0
|
0
|
|
|
|
|
if ($sub!~/::/) {
|
6509
|
0
|
|
|
|
|
|
$sub=~s/^[&]//;
|
6510
|
0
|
|
|
|
|
|
eval "\@resu=main::$sub";
|
6511
|
|
|
|
|
|
|
} else {
|
6512
|
0
|
|
|
|
|
|
eval "\@resu=$sub";
|
6513
|
|
|
|
|
|
|
}
|
6514
|
0
|
0
|
|
|
|
|
if ($@) {
|
6515
|
0
|
|
|
|
|
|
my $er=$@."\n line ";
|
6516
|
0
|
|
|
|
|
|
die $er.__LINE__;
|
6517
|
|
|
|
|
|
|
}
|
6518
|
|
|
|
|
|
|
}
|
6519
|
|
|
|
|
|
|
};
|
6520
|
0
|
0
|
|
|
|
|
if ($@) {
|
6521
|
0
|
0
|
0
|
|
|
|
if (10
|
6522
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6523
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6524
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6525
|
|
|
|
|
|
|
$Persists,$parent_menu,$@;
|
6526
|
|
|
|
|
|
|
}
|
6527
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6528
|
|
|
|
|
|
|
-1
|
6529
|
0
|
|
|
|
|
|
print $log_handle $@;
|
6530
|
0
|
|
|
|
|
|
close($log_handle);
|
6531
|
|
|
|
|
|
|
}
|
6532
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6533
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($@);
|
6534
|
0
|
|
|
|
|
|
} else { die $@ }
|
6535
|
|
|
|
|
|
|
} else {
|
6536
|
0
|
|
|
|
|
|
my $die="\n FATAL ERROR! - The Local "
|
6537
|
|
|
|
|
|
|
."System $Term::Menus::local_hostname "
|
6538
|
|
|
|
|
|
|
."Conveyed\n"
|
6539
|
|
|
|
|
|
|
." the Following "
|
6540
|
|
|
|
|
|
|
."Unrecoverable Error Condition :\n\n"
|
6541
|
|
|
|
|
|
|
." $@\n line ".__LINE__;
|
6542
|
0
|
0
|
0
|
|
|
|
if ($parent_menu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6543
|
0
|
|
|
|
|
|
return '',$FullMenu,$Selected,$Conveyed,
|
6544
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6545
|
|
|
|
|
|
|
$Persists,$parent_menu,$die;
|
6546
|
|
|
|
|
|
|
}
|
6547
|
0
|
0
|
0
|
|
|
|
if (defined $log_handle &&
|
6548
|
|
|
|
|
|
|
-1
|
6549
|
0
|
|
|
|
|
|
print $log_handle $die;
|
6550
|
0
|
|
|
|
|
|
close($log_handle);
|
6551
|
|
|
|
|
|
|
}
|
6552
|
0
|
0
|
|
|
|
|
if ($Term::Menus::fullauto) {
|
6553
|
0
|
|
|
|
|
|
&Net::FullAuto::FA_Core::handle_error($die);
|
6554
|
0
|
|
|
|
|
|
} else { die $die }
|
6555
|
|
|
|
|
|
|
}
|
6556
|
|
|
|
|
|
|
}
|
6557
|
0
|
0
|
|
|
|
|
if (-1<$#resu) {
|
6558
|
0
|
0
|
|
|
|
|
if ($resu[0] eq '<') { %picks=();next }
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6559
|
0
|
0
|
|
|
|
|
if ($resu[0]=~/^[{](.*)[}][<]$/) {
|
6560
|
0
|
0
|
|
|
|
|
if ($1 eq $MenuUnit_hash_ref->{Name}) {
|
6561
|
0
|
|
|
|
|
|
%picks=();next;
|
|
0
|
|
|
|
|
|
|
6562
|
|
|
|
|
|
|
} else {
|
6563
|
0
|
|
|
|
|
|
return $resu[0];
|
6564
|
|
|
|
|
|
|
}
|
6565
|
|
|
|
|
|
|
}
|
6566
|
0
|
0
|
0
|
|
|
|
if (0<$#resu && wantarray && !$no_wantarray) {
|
|
|
|
0
|
|
|
|
|
6567
|
0
|
|
|
|
|
|
return @resu;
|
6568
|
|
|
|
|
|
|
} else {
|
6569
|
0
|
|
|
|
|
|
return return_result($resu[0],
|
6570
|
|
|
|
|
|
|
$MenuUnit_hash_ref,$Conveyed);
|
6571
|
|
|
|
|
|
|
}
|
6572
|
|
|
|
|
|
|
}
|
6573
|
0
|
|
|
|
|
|
$done=1;last
|
6574
|
0
|
|
|
|
|
|
}
|
6575
|
0
|
|
|
|
|
|
return 'DONE_SUB';
|
6576
|
|
|
|
|
|
|
} elsif ($return_from_child_menu &&
|
6577
|
|
|
|
|
|
|
!exists $SavePick->{$MenuUnit_hash_ref}->{$pn{$numbor}}) {
|
6578
|
0
|
|
|
|
|
|
delete_Selected($MenuUnit_hash_ref);
|
6579
|
0
|
|
|
|
|
|
$done=1;last;
|
|
0
|
|
|
|
|
|
|
6580
|
0
|
|
|
|
|
|
} else { $done=1 }
|
6581
|
0
|
0
|
|
|
|
|
last if !$return_from_child_menu;
|
6582
|
|
|
|
|
|
|
}
|
6583
|
0
|
0
|
|
|
|
|
} last if $done;
|
6584
|
|
|
|
|
|
|
}
|
6585
|
0
|
0
|
0
|
|
|
|
if ($select_many ||
|
|
|
|
0
|
|
|
|
|
6586
|
0
|
|
|
|
|
|
(exists ${$MenuUnit_hash_ref}{Select}{(keys %picks)[0]||''})) {
|
6587
|
0
|
|
|
|
|
|
my @picks=();
|
6588
|
0
|
|
|
|
|
|
foreach (sort numerically keys %picks) {
|
6589
|
0
|
|
|
|
|
|
my $pik=$all_menu_items_array[$_-1];
|
6590
|
0
|
|
|
|
|
|
push @picks, $pik;
|
6591
|
0
|
|
|
|
|
|
} undef @all_menu_items_array;
|
6592
|
0
|
0
|
|
|
|
|
if ($MenuUnit_hash_ref) {
|
6593
|
0
|
|
|
|
|
|
push @picks,\%picks;
|
6594
|
0
|
|
|
|
|
|
push @picks,$MenuUnit_hash_ref;
|
6595
|
0
|
|
|
|
|
|
return \@picks,
|
6596
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
6597
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6598
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
6599
|
|
|
|
|
|
|
} else {
|
6600
|
0
|
|
|
|
|
|
return @picks;
|
6601
|
|
|
|
|
|
|
}
|
6602
|
|
|
|
|
|
|
}
|
6603
|
0
|
|
|
|
|
|
my $pick='';
|
6604
|
0
|
0
|
|
|
|
|
if ($filtered_menu) {
|
|
|
0
|
|
|
|
|
|
6605
|
0
|
|
|
|
|
|
$pick=${$FullMenu}{$MenuUnit_hash_ref}[10]->[$numbor-1];
|
|
0
|
|
|
|
|
|
|
6606
|
|
|
|
|
|
|
} elsif ($numbor=~/^\d+$/) {
|
6607
|
0
|
|
|
|
|
|
$pick=$all_menu_items_array[$numbor-1];
|
6608
|
|
|
|
|
|
|
}
|
6609
|
0
|
|
|
|
|
|
undef @all_menu_items_array;
|
6610
|
0
|
0
|
0
|
|
|
|
if ($Term::Menus::fullauto && (!exists ${$MenuUnit_hash_ref}{'NoPlan'} ||
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
6611
|
|
|
|
|
|
|
!${$MenuUnit_hash_ref}{'NoPlan'}) &&
|
6612
|
|
|
|
|
|
|
defined $Net::FullAuto::FA_Core::makeplan) {
|
6613
|
|
|
|
|
|
|
#print "IN MAKEPLAN23\n";
|
6614
|
0
|
0
|
0
|
|
|
|
if (-1==$#{$Net::FullAuto::FA_Core::makeplan{'Plan'}} &&
|
|
0
|
|
|
|
|
|
|
6615
|
|
|
|
|
|
|
!exists $Net::FullAuto::FA_Core::makeplan->{'Title'}) {
|
6616
|
0
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{'Title'}=$pick;
|
6617
|
|
|
|
|
|
|
}
|
6618
|
0
|
0
|
|
|
|
|
unless ($got_default) {
|
6619
|
0
|
|
|
|
|
|
push @{$Net::FullAuto::FA_Core::makeplan->{'Plan'}},
|
6620
|
|
|
|
|
|
|
{ Menu => &pw($MenuUnit_hash_ref),
|
6621
|
|
|
|
|
|
|
Number => $numbor,
|
6622
|
|
|
|
|
|
|
PlanID =>
|
6623
|
|
|
|
|
|
|
$Net::FullAuto::FA_Core::makeplan->{Number},
|
6624
|
0
|
|
|
|
|
|
Item => $pick }
|
6625
|
|
|
|
|
|
|
}
|
6626
|
|
|
|
|
|
|
}
|
6627
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
6628
|
0
|
|
|
|
|
|
return $pick,
|
6629
|
|
|
|
|
|
|
$FullMenu,$Selected,$Conveyed,
|
6630
|
|
|
|
|
|
|
$SavePick,$SaveMMap,$SaveNext,
|
6631
|
|
|
|
|
|
|
$Persists,$parent_menu;
|
6632
|
|
|
|
|
|
|
} else {
|
6633
|
0
|
|
|
|
|
|
return $pick;
|
6634
|
|
|
|
|
|
|
}
|
6635
|
|
|
|
|
|
|
|
6636
|
|
|
|
|
|
|
}
|
6637
|
|
|
|
|
|
|
|
6638
|
|
|
|
|
|
|
sub return_result {
|
6639
|
|
|
|
|
|
|
|
6640
|
0
|
|
|
0
|
0
|
|
my $result_string=$_[0];
|
6641
|
0
|
|
|
|
|
|
my $MenuUnit_hash_ref=$_[1];
|
6642
|
0
|
|
|
|
|
|
my $Conveyed=$_[2];
|
6643
|
0
|
|
|
|
|
|
$Conveyed->{&pw($MenuUnit_hash_ref)}=$result_string;
|
6644
|
0
|
|
|
|
|
|
my $result_array=[];
|
6645
|
0
|
0
|
0
|
|
|
|
if ((-1
|
6646
|
|
|
|
|
|
|
(-1
|
6647
|
0
|
|
|
|
|
|
$result_string=~s/^\s*\]\[\[\s*//s;
|
6648
|
0
|
|
|
|
|
|
$result_string=~s/\s*\]\]\[\s*$//s;
|
6649
|
0
|
|
|
|
|
|
my @elems=split /\s*\]\|\[\s*/,$result_string;
|
6650
|
0
|
|
|
|
|
|
foreach my $elem (@elems) {
|
6651
|
0
|
0
|
|
|
|
|
if (unpack('a5',$elem) eq 'eval ') {
|
6652
|
0
|
|
|
|
|
|
$elem=unpack('x5 a*',$elem);
|
6653
|
0
|
|
|
|
|
|
push @{$result_array}, eval $elem;
|
|
0
|
|
|
|
|
|
|
6654
|
|
|
|
|
|
|
} else {
|
6655
|
0
|
|
|
|
|
|
push @{$result_array}, $elem;
|
|
0
|
|
|
|
|
|
|
6656
|
|
|
|
|
|
|
}
|
6657
|
|
|
|
|
|
|
}
|
6658
|
0
|
|
|
|
|
|
} return [ $result_string ];
|
6659
|
|
|
|
|
|
|
|
6660
|
|
|
|
|
|
|
}
|
6661
|
|
|
|
|
|
|
|
6662
|
|
|
|
|
|
|
sub escape_quotes {
|
6663
|
|
|
|
|
|
|
|
6664
|
0
|
|
|
0
|
0
|
|
my $sub=$_[0];
|
6665
|
0
|
0
|
|
|
|
|
return $sub if -1==index $sub,'"';
|
6666
|
0
|
|
|
|
|
|
my $routine=substr($sub,0,(index $sub,'(')+1);
|
6667
|
0
|
|
|
|
|
|
my $args=substr($sub,(index $sub,'(')+1,-1);
|
6668
|
0
|
|
|
|
|
|
$args=~s/[']/!%!'%!%/g;
|
6669
|
0
|
|
|
|
|
|
$args=~s/^\s*(["]|!%!)//;$args=~s/(["]|%!%)\s*$//;
|
|
0
|
|
|
|
|
|
|
6670
|
0
|
|
|
|
|
|
my @args=split /(?:["]|%!%)\s*,\s*(?:["]|!%!)/, $args;
|
6671
|
0
|
|
|
|
|
|
my @newargs=();
|
6672
|
0
|
|
|
|
|
|
foreach my $arg (@args) {
|
6673
|
0
|
|
|
|
|
|
$arg=~s/(!%!|%!%)//g;
|
6674
|
0
|
0
|
|
|
|
|
if ($arg=~/^[']/) {
|
6675
|
0
|
|
|
|
|
|
push @newargs, $arg;
|
6676
|
|
|
|
|
|
|
} else {
|
6677
|
0
|
|
|
|
|
|
$arg=~s/["]/\\"/g;
|
6678
|
0
|
|
|
|
|
|
push @newargs, '"'.$arg.'"';
|
6679
|
|
|
|
|
|
|
}
|
6680
|
|
|
|
|
|
|
}
|
6681
|
0
|
|
|
|
|
|
$sub=$routine;
|
6682
|
0
|
|
|
|
|
|
foreach my $arg (@newargs) {
|
6683
|
0
|
|
|
|
|
|
$sub.=$arg.",";
|
6684
|
|
|
|
|
|
|
}
|
6685
|
0
|
|
|
|
|
|
chop $sub;
|
6686
|
0
|
|
|
|
|
|
$sub.=')';
|
6687
|
0
|
|
|
|
|
|
return $sub;
|
6688
|
|
|
|
|
|
|
|
6689
|
|
|
|
|
|
|
}
|
6690
|
|
|
|
|
|
|
|
6691
|
|
|
|
|
|
|
1;
|
6692
|
|
|
|
|
|
|
|
6693
|
|
|
|
|
|
|
package TMMemHandle;
|
6694
|
|
|
|
|
|
|
|
6695
|
1
|
|
|
1
|
|
8
|
use strict;
|
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
241
|
|
6696
|
|
|
|
|
|
|
sub TIEHANDLE {
|
6697
|
0
|
|
|
0
|
|
|
my $class = shift;
|
6698
|
0
|
|
|
|
|
|
bless [], $class;
|
6699
|
|
|
|
|
|
|
}
|
6700
|
|
|
|
|
|
|
|
6701
|
|
|
|
|
|
|
sub PRINT {
|
6702
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6703
|
0
|
|
|
|
|
|
push @$self, join '', @_;
|
6704
|
|
|
|
|
|
|
}
|
6705
|
|
|
|
|
|
|
|
6706
|
|
|
|
|
|
|
sub PRINTF {
|
6707
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6708
|
0
|
|
|
|
|
|
my $fmt = shift;
|
6709
|
0
|
|
|
|
|
|
push @$self, sprintf $fmt, @_;
|
6710
|
|
|
|
|
|
|
}
|
6711
|
|
|
|
|
|
|
|
6712
|
|
|
|
|
|
|
sub READLINE {
|
6713
|
0
|
|
|
0
|
|
|
my $self = shift;
|
6714
|
0
|
|
|
|
|
|
shift @$self;
|
6715
|
|
|
|
|
|
|
}
|
6716
|
|
|
|
|
|
|
|
6717
|
|
|
|
|
|
|
1;
|
6718
|
|
|
|
|
|
|
|
6719
|
|
|
|
|
|
|
__END__;
|