Changeset 17179
- Timestamp:
- 07/30/07 20:44:29 (16 months ago)
- Location:
- t
- Files:
-
- 2 modified
-
operators/quoting.t (modified) (12 diffs)
-
syntax/interpolation/strings.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
t/operators/quoting.t
r15822 r17179 81 81 }; 82 82 83 { # non interpolating single quotes with nested parens L<S02/Literals/That is () have no special significance> 83 # L<S02/Literals/That is () have no special significance> 84 { # non interpolating single quotes with nested parens 84 85 my @q = (); 85 86 @q = (q ( ($foo $bar))); … … 88 89 }; 89 90 90 { # q() is bad L<S02/Literals/Which is mandatory for parens> 91 # L<S02/Literals/Which is mandatory for parens> 92 { # q() is bad 91 93 my @q; 92 94 sub q { @_ } … … 95 97 }; 96 98 97 { # adverb variation L<S02/Literals/:q> 99 # L<S02/Literals/:q> 100 { # adverb variation 98 101 my @q = (); 99 102 @q = (q:q/$foo $bar/); … … 116 119 }; 117 120 118 { # interpolating quotes L<S02/Literals/same as qq> 121 # L<S02/Literals/qq:> 122 { # interpolating quotes 119 123 my @q = (); 120 124 @q = qq/$foo $bar/; … … 130 134 }; 131 135 132 { # adverb variation L<S02/Literals/:qq> 136 # L<S02/Literals/:qq> 137 { # adverb variation 133 138 my @q = (); 134 139 @q = q:qq/$foo $bar/; … … 137 142 }; 138 143 139 { # \qq[] constructs interpolate in q[] L<S02/Literals/using the \\qq> 144 # L<S02/Literals/using the \qq> 145 { # \qq[] constructs interpolate in q[] 140 146 my( @q1, @q2, @q3, @q4 ) = (); 141 147 @q1 = q[$foo \qq[$bar]]; … … 172 178 }; 173 179 174 { # angle brackets L<S02/Literals/the qw quote operator bracketed form> 180 # L<S02/Literals/quote operator now has a bracketed form> 181 { # angle brackets 175 182 my @q = (); 176 183 @q = <$foo $bar>; … … 180 187 }; 181 188 182 { # angle brackets L<S02/Literals/the qw quote operator bracketed form>189 { # angle brackets 183 190 my @q = (); 184 191 @q = < $foo $bar >; … … 247 254 }; 248 255 249 { # qw, interpolating, shell quoting L<S02/Literals/respects quotes in a shell-like fashion> 256 # L<S02/Literals/respects quotes in a shell-like fashion> 257 { # qw, interpolating, shell quoting 250 258 my (@q1, @q2) = (); 251 259 my $gorch = "foo bar"; … … 262 270 }; 263 271 264 { # qq:to L<S02/Literals/Heredocs are no longer written> 272 # L<S02/Literals/Heredocs are no longer written> 273 { # qq:to 265 274 my @q = (); 266 275 … … 276 285 }; 277 286 278 { # q:to indented L<S02/Literals/Here docs allow optional whitespace> 287 # L<S02/Literals/Heredocs allow optional whitespace> 288 { # q:to indented 279 289 my @q = (); 280 290 … … 320 330 }; 321 331 322 { # L<S02/Literals/"Pair" notation is also recognized inside> 332 # L<S02/Literals/"Pair" notation is also recognized inside> 333 { 323 334 # <<:Pair>> 324 335 diag "XXX: pair.perl is broken atm so these tests may be unreliable"; -
t/syntax/interpolation/strings.t
r16856 r17179 34 34 eval( q[is("$number {my $number=2} {$number}", '1 2 1', 'original number 35 35 still available in closure after local version in closure: works' );] ); 36 is("$(my $x = 2) $x", '2 2', 'Variable should interpolate and still be available in the outer scope.');37 is("$(my $x = 2)" ~ $x, '22', 'Variable should interpolate and still be available in the outer scope.') 36 eval( q[is("$(my $x = 2) $x", '2 2', 'Variable should interpolate and still be available in the outer scope.');] ); 37 eval( q[is("$(my $x = 2)" ~ $x, '22', 'Variable should interpolate and still be available in the outer scope.');] ); 38 38 39 39 # L<S02/Names and Variables/form of each subscript>
