| … | |
… | |
| 62 | $CARET, |
62 | $CARET, |
| 63 | $PI, |
63 | $PI, |
| 64 | $E, |
64 | $E, |
| 65 | @ALPHABET, |
65 | @ALPHABET, |
| 66 | $envir, |
66 | $envir, |
|
|
67 | $PG_random_generator, |
| 67 | ); |
68 | ); |
| 68 | |
69 | |
| 69 | sub _PGbasicmacros_init { |
70 | sub _PGbasicmacros_init { |
| 70 | |
71 | |
| 71 | # The big problem is that at compile time in the cached Safe compartment |
72 | # The big problem is that at compile time in the cached Safe compartment |
| … | |
… | |
| 162 | @ALPHABET = ('A'..'ZZ'); |
163 | @ALPHABET = ('A'..'ZZ'); |
| 163 | |
164 | |
| 164 | # We initialize a local reference to the environment hash rather than transfer the entire hash |
165 | # We initialize a local reference to the environment hash rather than transfer the entire hash |
| 165 | # This way is slightly more efficient. |
166 | # This way is slightly more efficient. |
| 166 | |
167 | |
| 167 | $envir = PG_restricted_eval(q!\%main::envir!); |
168 | $envir = PG_restricted_eval(q!\%main::envir!); |
|
|
169 | $PG_random_generator = PG_restricted_eval(q!$main::PG_random_generator!); |
| 168 | |
170 | |
| 169 | } |
171 | } |
| 170 | |
172 | |
| 171 | =head2 Answer blank macros: |
173 | =head2 Answer blank macros: |
| 172 | |
174 | |
| … | |
… | |
| 964 | return $li[random(1,scalar(@li))-1]; |
966 | return $li[random(1,scalar(@li))-1]; |
| 965 | } |
967 | } |
| 966 | |
968 | |
| 967 | sub SRAND { # resets the main random generator -- use cautiously |
969 | sub SRAND { # resets the main random generator -- use cautiously |
| 968 | my $seed = shift; |
970 | my $seed = shift; |
| 969 | $main::PG_random_generator -> srand($seed); |
971 | PG_random_generator -> srand($seed); |
| 970 | } |
972 | } |
| 971 | |
973 | |
| 972 | # display macros |
974 | # display macros |
| 973 | |
975 | |
| 974 | =head2 Display Macros |
976 | =head2 Display Macros |