File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
main/java/org/perlonjava/runtime Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ public static RuntimeScalar getGlobalVariable(String key) {
141
141
return var ;
142
142
}
143
143
144
+ public static RuntimeScalar setGlobalVariable (String key , String value ) {
145
+ return getGlobalVariable (key ).set (value );
146
+ }
147
+
144
148
public static boolean existsGlobalVariable (String key ) {
145
149
return globalVariables .containsKey (key );
146
150
}
Original file line number Diff line number Diff line change 154
154
my $ negative_width = sprintf (" |%-10s|" , " test" );
155
155
print " not " if $ negative_width ne " |test |" ; say " ok # sprintf('|%-10s|', 'test') |$ negative_width |" ;
156
156
157
- # # XXX TODO
158
- # # # Test invalid format string
159
- # # my $invalid_format;
160
- # # eval { $invalid_format = sprintf("%z", "data") };
161
- # # print "not " if $@; # Expecting an error
162
- # # print "ok # sprintf with invalid format string causes an error\n";
157
+ # Test invalid format string
158
+ my $ invalid_format ;
159
+ eval { $ invalid_format = sprintf (" % z" , " data" ) };
160
+ print " not " if $@ ; # Expecting an error
161
+ print " ok # sprintf with invalid format string causes an error\n " ;
163
162
164
163
# ##################
165
164
# Logical Operators
You can’t perform that action at this time.
0 commit comments