1toke.c AOK 2 3 we seem to have lost a few ambiguous warnings!! 4 5 6 $a = <<; 7 Use of comma-less variable list is deprecated 8 (called 3 times via depcom) 9 10 \1 better written as $1 11 use warnings 'syntax' ; 12 s/(abc)/\1/; 13 14 warn(warn_nosemi) 15 Semicolon seems to be missing 16 $a = 1 17 &time ; 18 19 20 Reversed %c= operator 21 my $a =+ 2 ; 22 $a =- 2 ; 23 $a =* 2 ; 24 $a =% 2 ; 25 $a =& 2 ; 26 $a =. 2 ; 27 $a =^ 2 ; 28 $a =| 2 ; 29 $a =< 2 ; 30 $a =/ 2 ; 31 32 Multidimensional syntax %.*s not supported 33 my $a = $a[1,2] ; 34 35 You need to quote \"%s\"" 36 sub fred {} ; $SIG{TERM} = fred; 37 38 Can't use \\%c to mean $%c in expression 39 $_ = "ab" ; s/(ab)/\1/e; 40 41 Unquoted string "abc" may clash with future reserved word at - line 3. 42 warn(warn_reserved 43 $a = abc; 44 45 Possible attempt to separate words with commas 46 @a = qw(a, b, c) ; 47 48 Possible attempt to put comments in qw() list 49 @a = qw(a b # c) ; 50 51 %s (...) interpreted as function 52 print ("") 53 printf ("") 54 sort ("") 55 56 Ambiguous use of %c{%s%s} resolved to %c%s%s 57 $a = ${time[2]} 58 $a = ${time{2}} 59 60 61 Ambiguous use of %c{%s} resolved to %c%s 62 $a = ${time} 63 sub fred {} $a = ${fred} 64 65 Misplaced _ in number 66 $a = 1_2; 67 $a = 1_2345_6; 68 69 Bareword \"%s\" refers to nonexistent package 70 $a = FRED:: ; 71 72 Ambiguous call resolved as CORE::%s(), qualify as such or use & 73 sub time {} 74 my $a = time() 75 76 Unrecognized escape \\%c passed through 77 $a = "\m" ; 78 79 Useless use of \\E. 80 $a = "abcd\E" ; 81 82 Postfix dereference is experimental 83 84 %s number > %s non-portable 85 my $a = 0b011111111111111111111111111111110 ; 86 $a = 0b011111111111111111111111111111111 ; 87 $a = 0b111111111111111111111111111111111 ; 88 $a = 0x0fffffffe ; 89 $a = 0x0ffffffff ; 90 $a = 0x1ffffffff ; 91 $a = 0037777777776 ; 92 $a = 0037777777777 ; 93 $a = 0047777777777 ; 94 95 Integer overflow in binary number 96 my $a = 0b011111111111111111111111111111110 ; 97 $a = 0b011111111111111111111111111111111 ; 98 $a = 0b111111111111111111111111111111111 ; 99 $a = 0x0fffffffe ; 100 $a = 0x0ffffffff ; 101 $a = 0x1ffffffff ; 102 $a = 0037777777776 ; 103 $a = 0037777777777 ; 104 $a = 0047777777777 ; 105 106 dump() better written as CORE::dump() 107 108 Use of /c modifier is meaningless without /g 109 110 Use of /c modifier is meaningless in s/// 111 112 Mandatory Warnings 113 ------------------ 114 Use of "%s" without parentheses is ambiguous [check_uni] 115 rand + 4 116 117 Ambiguous use of -%s resolved as -&%s() [yylex] 118 sub fred {} ; - fred ; 119 120 Precedence problem: open %.*s should be open(%.*s) [yylex] 121 open FOO || die; 122 123 Operator or semicolon missing before %c%s [yylex] 124 Ambiguous use of %c resolved as operator %c 125 *foo *foo 126 127__END__ 128# toke.c 129format STDOUT = 130@<<< @||| @>>> @>>> 131$a $b "abc" 'def' 132. 133no warnings 'deprecated' ; 134format STDOUT = 135@<<< @||| @>>> @>>> 136$a $b "abc" 'def' 137. 138EXPECT 139Use of comma-less variable list is deprecated at - line 4. 140Use of comma-less variable list is deprecated at - line 4. 141Use of comma-less variable list is deprecated at - line 4. 142######## 143# toke.c 144$a = <<; 145 146no warnings 'deprecated' ; 147$a = <<; 148 149EXPECT 150Use of bare << to mean <<"" is deprecated at - line 2. 151######## 152# toke.c 153eval "\$\cT"; 154eval "\${\7LOBAL_PHASE}"; 155eval "\${\cT}"; 156eval "\${\n\cT}"; 157eval "\${\cT\n}"; 158my $ret = eval "\${\n\cT\n}"; 159print "ok\n" if $ret == $^T; 160 161no warnings 'deprecated' ; 162eval "\$\cT"; 163eval "\${\7LOBAL_PHASE}"; 164eval "\${\cT}"; 165eval "\${\n\cT}"; 166eval "\${\cT\n}"; 167eval "\${\n\cT\n}"; 168 169EXPECT 170Use of literal control characters in variable names is deprecated at (eval 1) line 1. 171Use of literal control characters in variable names is deprecated at (eval 2) line 1. 172Use of literal control characters in variable names is deprecated at (eval 3) line 1. 173Use of literal control characters in variable names is deprecated at (eval 4) line 2. 174Use of literal control characters in variable names is deprecated at (eval 5) line 1. 175Use of literal control characters in variable names is deprecated at (eval 6) line 2. 176ok 177######## 178# toke.c 179$a =~ m/$foo/eq; 180$a =~ s/$foo/fool/seq; 181 182EXPECT 183OPTION fatal 184Unknown regexp modifier "/e" at - line 2, near "=~ " 185Unknown regexp modifier "/q" at - line 2, near "=~ " 186Unknown regexp modifier "/q" at - line 3, near "=~ " 187Execution of - aborted due to compilation errors. 188######## 189# toke.c 190use utf8; 191use open qw( :utf8 :std ); 192$a =~ m/$foo/eネq; 193$a =~ s/$foo/fool/seネq; 194 195EXPECT 196OPTION fatal 197Unknown regexp modifier "/e" at - line 4, near "=~ " 198Unknown regexp modifier "/ネ" at - line 4, near "=~ " 199Unknown regexp modifier "/q" at - line 4, near "=~ " 200Unknown regexp modifier "/ネ" at - line 5, near "=~ " 201Unknown regexp modifier "/q" at - line 5, near "=~ " 202Execution of - aborted due to compilation errors. 203######## 204# toke.c 205use warnings 'syntax' ; 206s/(abc)/\1/; 207no warnings 'syntax' ; 208s/(abc)/\1/; 209EXPECT 210\1 better written as $1 at - line 3. 211######## 212# toke.c 213use warnings 'semicolon' ; 214$a = 1 215&time ; 216no warnings 'semicolon' ; 217$a = 1 218&time ; 219EXPECT 220Semicolon seems to be missing at - line 3. 221######## 222# toke.c 223use warnings 'syntax' ; 224my $a =+ 2 ; 225$a =- 2 ; 226$a =* 2 ; 227$a =% 2 ; 228$a =& 2 ; 229$a =. 2 ; 230$a =^ 2 ; 231$a =| 2 ; 232$a =< 2 ; 233$a =/ 2 ; 234EXPECT 235Reversed += operator at - line 3. 236Reversed -= operator at - line 4. 237Reversed *= operator at - line 5. 238Reversed %= operator at - line 6. 239Reversed &= operator at - line 7. 240Reversed .= operator at - line 8. 241Reversed ^= operator at - line 9. 242Reversed |= operator at - line 10. 243Reversed <= operator at - line 11. 244syntax error at - line 8, near "=." 245syntax error at - line 9, near "=^" 246syntax error at - line 10, near "=|" 247Unterminated <> operator at - line 11. 248######## 249# toke.c 250no warnings 'syntax' ; 251my $a =+ 2 ; 252$a =- 2 ; 253$a =* 2 ; 254$a =% 2 ; 255$a =& 2 ; 256$a =. 2 ; 257$a =^ 2 ; 258$a =| 2 ; 259$a =< 2 ; 260$a =/ 2 ; 261EXPECT 262syntax error at - line 8, near "=." 263syntax error at - line 9, near "=^" 264syntax error at - line 10, near "=|" 265Unterminated <> operator at - line 11. 266######## 267# toke.c 268use warnings 'syntax' ; 269my $a = $a[1,2] ; 270no warnings 'syntax' ; 271my $a = $a[1,2] ; 272EXPECT 273Multidimensional syntax $a[1,2] not supported at - line 3. 274######## 275# toke.c 276use warnings 'syntax' ; 277sub fred {} ; $SIG{TERM} = fred; 278no warnings 'syntax' ; 279$SIG{TERM} = fred; 280EXPECT 281You need to quote "fred" at - line 3. 282######## 283# toke.c 284use utf8; 285use open qw( :utf8 :std ); 286use warnings 'syntax' ; 287sub frèd {} ; $SIG{TERM} = frèd; 288no warnings 'syntax' ; 289$SIG{TERM} = frèd; 290EXPECT 291You need to quote "frèd" at - line 5. 292######## 293# toke.c 294use utf8; 295use open qw( :utf8 :std ); 296use warnings 'syntax' ; 297sub ふれど {} ; $SIG{TERM} = ふれど; 298no warnings 'syntax' ; 299$SIG{TERM} = ふれど; 300EXPECT 301You need to quote "ふれど" at - line 5. 302######## 303# toke.c 304use warnings 'syntax' ; 305$_ = "ab" ; 306s/(ab)/\1/e; 307s//\(2)/e; # should be exempt 308s/${\2}//; # same here 309()="${\2}"; # metoo 310no warnings 'syntax' ; 311$_ = "ab" ; 312s/(ab)/\1/e; 313EXPECT 314Can't use \1 to mean $1 in expression at - line 4. 315######## 316# toke.c 317use warnings 'reserved' ; 318$a = abc; 319$a = { def 320 321=> 1 }; 322no warnings 'reserved' ; 323$a = abc; 324EXPECT 325Unquoted string "abc" may clash with future reserved word at - line 3. 326######## 327# toke.c 328use warnings 'qw' ; 329@a = qw(a, b, c) ; 330no warnings 'qw' ; 331@a = qw(a, b, c) ; 332EXPECT 333Possible attempt to separate words with commas at - line 3. 334######## 335# toke.c 336use warnings 'qw' ; 337@a = qw(a b c # #) ; 338no warnings 'qw' ; 339@a = qw(a b c # #) ; 340EXPECT 341Possible attempt to put comments in qw() list at - line 3. 342######## 343# toke.c 344use warnings 'qw' ; 345@a = qw(a, b, c # #) ; 346no warnings 'qw' ; 347@a = qw(a, b, c # #) ; 348EXPECT 349Possible attempt to separate words with commas at - line 3. 350Possible attempt to put comments in qw() list at - line 3. 351######## 352# toke.c 353use warnings 'syntax' ; 354print (""); 355print ("") and $x = 1; 356print ("") or die; 357print ("") // die; 358print (1+2) * 3 if 0; # only this one should warn 359print (1+2) if 0; 360EXPECT 361print (...) interpreted as function at - line 7. 362######## 363# toke.c 364no warnings 'syntax' ; 365print ("") 366EXPECT 367 368######## 369# toke.c 370use warnings 'syntax' ; 371printf (""); 372printf ("") . ''; 373EXPECT 374printf (...) interpreted as function at - line 4. 375######## 376# toke.c 377no warnings 'syntax' ; 378printf ("") 379EXPECT 380 381######## 382# toke.c 383use warnings 'syntax' ; 384sort (""); 385sort ("") . ''; 386EXPECT 387sort (...) interpreted as function at - line 4. 388######## 389# toke.c 390no warnings 'syntax' ; 391sort ("") 392EXPECT 393 394######## 395# toke.c 396use warnings 'ambiguous' ; 397$a = ${time[2]}; 398no warnings 'ambiguous' ; 399$a = ${time[2]}; 400EXPECT 401Ambiguous use of ${time[...]} resolved to $time[...] at - line 3. 402######## 403# toke.c 404use warnings 'ambiguous' ; 405$a = ${time{2}}; 406EXPECT 407Ambiguous use of ${time{...}} resolved to $time{...} at - line 3. 408######## 409# toke.c 410use warnings 'ambiguous' ; 411$a = ${ 412 413 time 414 {2} 415}; 416warn "after"; 417EXPECT 418Ambiguous use of ${time{...}} resolved to $time{...} at - line 5. 419after at - line 8. 420######## 421# toke.c 422use warnings 'ambiguous' ; 423$a = ${ 424 425time[2] 426 427}; 428$a = ${ 429 430time 431 [2] 432 433}; 434warn "after"; 435EXPECT 436Ambiguous use of ${time[...]} resolved to $time[...] at - line 5. 437Ambiguous use of ${time[...]} resolved to $time[...] at - line 10. 438after at - line 14. 439######## 440# toke.c 441no warnings 'ambiguous' ; 442$a = ${time{2}}; 443EXPECT 444 445######## 446# toke.c 447use warnings 'ambiguous' ; 448$a = ${time} ; 449$a = @{time} ; 450$a = $#{time} ; # This one is special cased in toke.c 451$a = %{time} ; 452$a = *{time} ; 453$a = defined &{time} ; # To avoid calling &::time 454no warnings 'ambiguous' ; 455$a = ${time} ; 456$a = @{time} ; 457$a = $#{time} ; # This one is special cased in toke.c 458$a = %{time} ; 459$a = *{time} ; 460$a = defined &{time} ; # To avoid calling &::time 461EXPECT 462Ambiguous use of ${time} resolved to $time at - line 3. 463Ambiguous use of @{time} resolved to @time at - line 4. 464Ambiguous use of @{time} resolved to @time at - line 5. 465Ambiguous use of %{time} resolved to %time at - line 6. 466Ambiguous use of *{time} resolved to *time at - line 7. 467Ambiguous use of &{time} resolved to &time at - line 8. 468######## 469# toke.c 470use warnings 'ambiguous' ; 471$a = ${ 472time 473} ; 474$a = @{ 475time 476} ; 477$a = $#{ 478time 479} ; 480$a = %{ 481time 482} ; 483$a = *{ 484time 485} ; 486$a = defined &{ 487time 488 489 490} ; 491warn "last"; 492EXPECT 493Ambiguous use of ${time} resolved to $time at - line 4. 494Ambiguous use of @{time} resolved to @time at - line 7. 495Ambiguous use of @{time} resolved to @time at - line 10. 496Ambiguous use of %{time} resolved to %time at - line 13. 497Ambiguous use of *{time} resolved to *time at - line 16. 498Ambiguous use of &{time} resolved to &time at - line 19. 499last at - line 23. 500######## 501# toke.c 502use warnings 'ambiguous' ; 503sub fred {} 504$a = ${fred} ; 505no warnings 'ambiguous' ; 506$a = ${fred} ; 507EXPECT 508Ambiguous use of ${fred} resolved to $fred at - line 4. 509######## 510# toke.c 511use warnings 'syntax' ; 512$a = _123; print "$a\n"; #( 3 string) 513$a = 1_23; print "$a\n"; 514$a = 12_3; print "$a\n"; 515$a = 123_; print "$a\n"; # 6 516$a = _+123; print "$a\n"; # 7 string) 517$a = +_123; print "$a\n"; #( 8 string) 518$a = +1_23; print "$a\n"; 519$a = +12_3; print "$a\n"; 520$a = +123_; print "$a\n"; # 11 521$a = _-123; print "$a\n"; #(12 string) 522$a = -_123; print "$a\n"; #(13 string) 523$a = -1_23; print "$a\n"; 524$a = -12_3; print "$a\n"; 525$a = -123_; print "$a\n"; # 16 526$a = 123._456; print "$a\n"; # 17 527$a = 123.4_56; print "$a\n"; 528$a = 123.45_6; print "$a\n"; 529$a = 123.456_; print "$a\n"; # 20 530$a = +123._456; print "$a\n"; # 21 531$a = +123.4_56; print "$a\n"; 532$a = +123.45_6; print "$a\n"; 533$a = +123.456_; print "$a\n"; # 24 534$a = -123._456; print "$a\n"; # 25 535$a = -123.4_56; print "$a\n"; 536$a = -123.45_6; print "$a\n"; 537$a = -123.456_; print "$a\n"; # 28 538$a = 123.456E_12; printf("%.0f\n", $a); # 29 539$a = 123.456E1_2; printf("%.0f\n", $a); 540$a = 123.456E12_; printf("%.0f\n", $a); # 31 541$a = 123.456E_+12; printf("%.0f\n", $a); # 32 542$a = 123.456E+_12; printf("%.0f\n", $a); # 33 543$a = 123.456E+1_2; printf("%.0f\n", $a); 544$a = 123.456E+12_; printf("%.0f\n", $a); # 35 545$a = 123.456E_-12; print "$a\n"; # 36 546$a = 123.456E-_12; print "$a\n"; # 37 547$a = 123.456E-1_2; print "$a\n"; 548$a = 123.456E-12_; print "$a\n"; # 39 549$a = 1__23; print "$a\n"; # 40 550$a = 12.3__4; print "$a\n"; # 41 551$a = 12.34e1__2; printf("%.0f\n", $a); # 42 552no warnings 'syntax' ; 553$a = _123; print "$a\n"; 554$a = 1_23; print "$a\n"; 555$a = 12_3; print "$a\n"; 556$a = 123_; print "$a\n"; 557$a = _+123; print "$a\n"; 558$a = +_123; print "$a\n"; 559$a = +1_23; print "$a\n"; 560$a = +12_3; print "$a\n"; 561$a = +123_; print "$a\n"; 562$a = _-123; print "$a\n"; 563$a = -_123; print "$a\n"; 564$a = -1_23; print "$a\n"; 565$a = -12_3; print "$a\n"; 566$a = -123_; print "$a\n"; 567$a = 123._456; print "$a\n"; 568$a = 123.4_56; print "$a\n"; 569$a = 123.45_6; print "$a\n"; 570$a = 123.456_; print "$a\n"; 571$a = +123._456; print "$a\n"; 572$a = +123.4_56; print "$a\n"; 573$a = +123.45_6; print "$a\n"; 574$a = +123.456_; print "$a\n"; 575$a = -123._456; print "$a\n"; 576$a = -123.4_56; print "$a\n"; 577$a = -123.45_6; print "$a\n"; 578$a = -123.456_; print "$a\n"; 579$a = 123.456E_12; printf("%.0f\n", $a); 580$a = 123.456E1_2; printf("%.0f\n", $a); 581$a = 123.456E12_; printf("%.0f\n", $a); 582$a = 123.456E_+12; printf("%.0f\n", $a); 583$a = 123.456E+_12; printf("%.0f\n", $a); 584$a = 123.456E+1_2; printf("%.0f\n", $a); 585$a = 123.456E+12_; printf("%.0f\n", $a); 586$a = 123.456E_-12; print "$a\n"; 587$a = 123.456E-_12; print "$a\n"; 588$a = 123.456E-1_2; print "$a\n"; 589$a = 123.456E-12_; print "$a\n"; 590$a = 1__23; print "$a\n"; 591$a = 12.3__4; print "$a\n"; 592$a = 12.34e1__2; printf("%.0f\n", $a); 593EXPECT 594OPTIONS regex 595Misplaced _ in number at - line 6. 596Misplaced _ in number at - line 11. 597Misplaced _ in number at - line 16. 598Misplaced _ in number at - line 17. 599Misplaced _ in number at - line 20. 600Misplaced _ in number at - line 21. 601Misplaced _ in number at - line 24. 602Misplaced _ in number at - line 25. 603Misplaced _ in number at - line 28. 604Misplaced _ in number at - line 29. 605Misplaced _ in number at - line 31. 606Misplaced _ in number at - line 32. 607Misplaced _ in number at - line 33. 608Misplaced _ in number at - line 35. 609Misplaced _ in number at - line 36. 610Misplaced _ in number at - line 37. 611Misplaced _ in number at - line 39. 612Misplaced _ in number at - line 40. 613Misplaced _ in number at - line 41. 614Misplaced _ in number at - line 42. 615_123 616123 617123 618123 619123 620_123 621123 622123 623123 624-123 625-_123 626-123 627-123 628-123 629123.456 630123.456 631123.456 632123.456 633123.456 634123.456 635123.456 636123.456 637-123.456 638-123.456 639-123.456 640-123.456 641123456000000000 642123456000000000 643123456000000000 644123456000000000 645123456000000000 646123456000000000 647123456000000000 6481.23456e-0?10 6491.23456e-0?10 6501.23456e-0?10 6511.23456e-0?10 652123 65312.34 65412340000000000 655_123 656123 657123 658123 659123 660_123 661123 662123 663123 664-123 665-_123 666-123 667-123 668-123 669123.456 670123.456 671123.456 672123.456 673123.456 674123.456 675123.456 676123.456 677-123.456 678-123.456 679-123.456 680-123.456 681123456000000000 682123456000000000 683123456000000000 684123456000000000 685123456000000000 686123456000000000 687123456000000000 6881.23456e-0?10 6891.23456e-0?10 6901.23456e-0?10 6911.23456e-0?10 692123 69312.34 69412340000000000 695######## 696# toke.c 697use warnings 'bareword' ; 698#line 25 "bar" 699$a = FRED:: ; 700no warnings 'bareword' ; 701#line 25 "bar" 702$a = FRED:: ; 703EXPECT 704Bareword "FRED::" refers to nonexistent package at bar line 25. 705######## 706# toke.c 707use utf8; 708use open qw( :utf8 :std ); 709use warnings 'bareword' ; 710#line 25 "bar" 711$a = FRÈD:: ; 712no warnings 'bareword' ; 713#line 25 "bar" 714$a = FRÈD:: ; 715EXPECT 716Bareword "FRÈD::" refers to nonexistent package at bar line 25. 717######## 718# toke.c 719use utf8; 720use open qw( :utf8 :std ); 721use warnings 'bareword' ; 722#line 25 "bar" 723$a = ϞϞϞ:: ; 724no warnings 'bareword' ; 725#line 25 "bar" 726$a = ϞϞϞ:: ; 727EXPECT 728Bareword "ϞϞϞ::" refers to nonexistent package at bar line 25. 729######## 730# toke.c 731use warnings 'ambiguous' ; 732sub time {} 733my $a = time() ; 734no warnings 'ambiguous' ; 735my $b = time() ; 736EXPECT 737Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. 738######## 739# toke.c 740use warnings ; 741eval <<'EOE'; 742# line 30 "foo" 743warn "yelp"; 744{ 745 $_ = " \x{123} " ; 746} 747EOE 748EXPECT 749yelp at foo line 30. 750######## 751# toke.c 752my $a = rand + 4 ; 753$a = rand *^H ; 754$a = rand $^H ; 755EXPECT 756Warning: Use of "rand" without parentheses is ambiguous at - line 2. 757######## 758# toke.c 759$^W = 0 ; 760my $a = rand + 4 ; 761{ 762 no warnings 'ambiguous' ; 763 $a = rand + 4 ; 764 use warnings 'ambiguous' ; 765 $a = rand + 4 ; 766} 767$a = rand + 4 ; 768EXPECT 769Warning: Use of "rand" without parentheses is ambiguous at - line 3. 770Warning: Use of "rand" without parentheses is ambiguous at - line 8. 771Warning: Use of "rand" without parentheses is ambiguous at - line 10. 772######## 773# [perl #97110] 774sub myrand(;$) { } 775sub whatever($) { } 776my $a = myrand + 4 ; 777my $b = whatever + 4 ; 778EXPECT 779Warning: Use of "myrand" without parentheses is ambiguous at - line 4. 780######## 781# toke.c 782use warnings "ambiguous"; 783print for keys %+; # should not warn 784EXPECT 785######## 786# toke.c 787sub fred {}; 788-fred ; 789sub hank : lvalue {$_} 790--hank; # This should *not* warn [perl #77240] 791EXPECT 792Ambiguous use of -fred resolved as -&fred() at - line 3. 793######## 794# toke.c 795$^W = 0 ; 796sub fred {} ; 797-fred ; 798{ 799 no warnings 'ambiguous' ; 800 -fred ; 801 use warnings 'ambiguous' ; 802 -fred ; 803} 804-fred ; 805EXPECT 806Ambiguous use of -fred resolved as -&fred() at - line 4. 807Ambiguous use of -fred resolved as -&fred() at - line 9. 808Ambiguous use of -fred resolved as -&fred() at - line 11. 809######## 810# toke.c 811use utf8; 812use open qw( :utf8 :std ); 813sub frèd {}; 814-frèd ; 815EXPECT 816Ambiguous use of -frèd resolved as -&frèd() at - line 5. 817######## 818# toke.c 819$^W = 0 ; 820use utf8; 821use open qw( :utf8 :std ); 822sub frèd {} ; 823-frèd ; 824{ 825 no warnings 'ambiguous' ; 826 -frèd ; 827 use warnings 'ambiguous' ; 828 -frèd ; 829} 830-frèd ; 831EXPECT 832Ambiguous use of -frèd resolved as -&frèd() at - line 6. 833Ambiguous use of -frèd resolved as -&frèd() at - line 11. 834Ambiguous use of -frèd resolved as -&frèd() at - line 13. 835######## 836# toke.c 837use utf8; 838use open qw( :utf8 :std ); 839sub ᒍᒘᒊ {}; 840-ᒍᒘᒊ ; 841EXPECT 842Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 5. 843######## 844# toke.c 845$^W = 0 ; 846use utf8; 847use open qw( :utf8 :std ); 848sub ᒍᒘᒊ {} ; 849-ᒍᒘᒊ ; 850{ 851 no warnings 'ambiguous' ; 852 -ᒍᒘᒊ ; 853 use warnings 'ambiguous' ; 854 -ᒍᒘᒊ ; 855} 856-ᒍᒘᒊ ; 857EXPECT 858Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 6. 859Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 11. 860Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 13. 861######## 862# toke.c 863open FOO || time; 864open local *FOO; # should be ok 865EXPECT 866Precedence problem: open FOO should be open(FOO) at - line 2. 867######## 868# toke.c 869use utf8; 870use open qw( :utf8 :std ); 871open FÒÒ || time; 872EXPECT 873Precedence problem: open FÒÒ should be open(FÒÒ) at - line 4. 874######## 875# toke.c 876use utf8; 877use open qw( :utf8 :std ); 878open ᒍOO || time; 879EXPECT 880Precedence problem: open ᒍOO should be open(ᒍOO) at - line 4. 881######## 882# toke.c (and [perl #16184]) 883open FOO => "<&0"; close FOO; 884EXPECT 885######## 886# toke.c 887$^W = 0 ; 888open FOO || time; 889{ 890 no warnings 'precedence' ; 891 open FOO || time; 892 use warnings 'precedence' ; 893 open FOO || time; 894} 895open FOO || time; 896open Foo::BAR; # this should not warn 897EXPECT 898Precedence problem: open FOO should be open(FOO) at - line 3. 899Precedence problem: open FOO should be open(FOO) at - line 8. 900Precedence problem: open FOO should be open(FOO) at - line 10. 901######## 902# toke.c 903$^W = 0 ; 904use utf8; 905use open qw( :utf8 :std ); 906open FÒÒ || time; 907{ 908 no warnings 'precedence' ; 909 open FÒÒ || time; 910 use warnings 'precedence' ; 911 open FÒÒ || time; 912} 913open FÒÒ || time; 914EXPECT 915Precedence problem: open FÒÒ should be open(FÒÒ) at - line 5. 916Precedence problem: open FÒÒ should be open(FÒÒ) at - line 10. 917Precedence problem: open FÒÒ should be open(FÒÒ) at - line 12. 918######## 919# toke.c 920use utf8; 921use open qw( :utf8 :std ); 922$^W = 0 ; 923open ᒍÒÒ || time; 924{ 925 no warnings 'precedence' ; 926 open ᒍÒÒ || time; 927 use warnings 'precedence' ; 928 open ᒍÒÒ || time; 929} 930open ᒍÒÒ || time; 931EXPECT 932Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 5. 933Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 10. 934Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 12. 935######## 936# toke.c 937$^W = 0 ; 938*foo *foo ; 939{ 940 no warnings 'ambiguous' ; 941 *foo *foo ; 942 use warnings 'ambiguous' ; 943 *foo *foo ; 944} 945*foo *foo ; 946# These should not warn [perl #117535]: 947foo**foo ; 948no warnings 'deprecated'; 949sort $*foo ; 950sort $ *foo ; 951EXPECT 952Operator or semicolon missing before *foo at - line 3. 953Ambiguous use of * resolved as operator * at - line 3. 954Operator or semicolon missing before *foo at - line 8. 955Ambiguous use of * resolved as operator * at - line 8. 956Operator or semicolon missing before *foo at - line 10. 957Ambiguous use of * resolved as operator * at - line 10. 958######## 959# toke.c 960$^W = 0 ; 961%foo %foo ; 962{ 963 no warnings 'ambiguous' ; 964 %foo %foo ; 965 use warnings 'ambiguous' ; 966 %foo %foo ; 967} 968%foo %foo ; 969# This should not produce ambiguity warnings [perl #117535]: 970sort $%foo ; 971sort $ %foo ; 972EXPECT 973Operator or semicolon missing before %foo at - line 3. 974Ambiguous use of % resolved as operator % at - line 3. 975Operator or semicolon missing before %foo at - line 8. 976Ambiguous use of % resolved as operator % at - line 8. 977Operator or semicolon missing before %foo at - line 10. 978Ambiguous use of % resolved as operator % at - line 10. 979Bareword found where operator expected at - line 12, near "$%foo" 980 (Missing operator before foo?) 981Bareword found where operator expected at - line 13, near "$ %foo" 982 (Missing operator before foo?) 983Illegal modulus zero at - line 3. 984######## 985# toke.c 986$^W = 0 ; 987&foo &foo ; 988{ 989 no warnings 'ambiguous' ; 990 &foo &foo ; 991 use warnings 'ambiguous' ; 992 &foo &foo ; 993} 994&foo &foo ; 995# These should not warn produce ambiguity warnings [perl #76910]: 996foo&&foo ; 997sort $&foo ; 998sort $ &foo ; 999EXPECT 1000Operator or semicolon missing before &foo at - line 3. 1001Ambiguous use of & resolved as operator & at - line 3. 1002Operator or semicolon missing before &foo at - line 8. 1003Ambiguous use of & resolved as operator & at - line 8. 1004Operator or semicolon missing before &foo at - line 10. 1005Ambiguous use of & resolved as operator & at - line 10. 1006Bareword found where operator expected at - line 13, near "$&foo" 1007 (Missing operator before foo?) 1008Bareword found where operator expected at - line 14, near "$ &foo" 1009 (Missing operator before foo?) 1010Undefined subroutine &main::foo called at - line 3. 1011######## 1012# toke.c 1013use utf8; 1014use open qw( :utf8 :std ); 1015$^W = 0 ; 1016*foo *foo ; 1017{ 1018 no warnings 'ambiguous' ; 1019 *foo *foo ; 1020 use warnings 'ambiguous' ; 1021 *foo *foo ; 1022} 1023*foo *foo ; 1024EXPECT 1025Operator or semicolon missing before *foo at - line 5. 1026Ambiguous use of * resolved as operator * at - line 5. 1027Operator or semicolon missing before *foo at - line 10. 1028Ambiguous use of * resolved as operator * at - line 10. 1029Operator or semicolon missing before *foo at - line 12. 1030Ambiguous use of * resolved as operator * at - line 12. 1031######## 1032# toke.c 1033use warnings 'misc' ; 1034my $a = "\m" ; 1035no warnings 'misc' ; 1036$a = "\m" ; 1037EXPECT 1038Unrecognized escape \m passed through at - line 3. 1039######## 1040# toke.c 1041use warnings 'misc' ; 1042my $a = "abcd\E" ; 1043no warnings 'misc' ; 1044$a = "abcd\E" ; 1045EXPECT 1046Useless use of \E at - line 3. 1047######## 1048# toke.c 1049use feature 'postderef', 'postderef_qq'; 1050(\$_)->$*; 1051"$_->$*"; 1052no warnings 'experimental::postderef'; 1053(\$_)->$*; 1054"$_->$*"; 1055EXPECT 1056Postfix dereference is experimental at - line 3. 1057Postfix dereference is experimental at - line 4. 1058######## 1059# toke.c 1060use warnings 'portable' ; 1061my $a = 0b011111111111111111111111111111110 ; 1062 $a = 0b011111111111111111111111111111111 ; 1063 $a = 0b111111111111111111111111111111111 ; 1064 $a = 0x0fffffffe ; 1065 $a = 0x0ffffffff ; 1066 $a = 0x1ffffffff ; 1067 $a = 0037777777776 ; 1068 $a = 0037777777777 ; 1069 $a = 0047777777777 ; 1070no warnings 'portable' ; 1071 $a = 0b011111111111111111111111111111110 ; 1072 $a = 0b011111111111111111111111111111111 ; 1073 $a = 0b111111111111111111111111111111111 ; 1074 $a = 0x0fffffffe ; 1075 $a = 0x0ffffffff ; 1076 $a = 0x1ffffffff ; 1077 $a = 0037777777776 ; 1078 $a = 0037777777777 ; 1079 $a = 0047777777777 ; 1080EXPECT 1081Binary number > 0b11111111111111111111111111111111 non-portable at - line 5. 1082Hexadecimal number > 0xffffffff non-portable at - line 8. 1083Octal number > 037777777777 non-portable at - line 11. 1084######## 1085# toke.c 1086use warnings 'overflow' ; 1087my $a = 0b011111111111111111111111111111110 ; 1088 $a = 0b011111111111111111111111111111111 ; 1089 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; 1090 $a = 0x0fffffffe ; 1091 $a = 0x0ffffffff ; 1092 $a = 0x10000000000000000 ; 1093 $a = 0037777777776 ; 1094 $a = 0037777777777 ; 1095 $a = 002000000000000000000000; 1096no warnings 'overflow' ; 1097 $a = 0b011111111111111111111111111111110 ; 1098 $a = 0b011111111111111111111111111111111 ; 1099 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; 1100 $a = 0x0fffffffe ; 1101 $a = 0x0ffffffff ; 1102 $a = 0x10000000000000000 ; 1103 $a = 0037777777776 ; 1104 $a = 0037777777777 ; 1105 $a = 002000000000000000000000; 1106EXPECT 1107Integer overflow in binary number at - line 5. 1108Integer overflow in hexadecimal number at - line 8. 1109Integer overflow in octal number at - line 11. 1110######## 1111# toke.c 1112BEGIN { $^C = 1; } 1113use warnings 'misc'; 1114dump; 1115CORE::dump; 1116EXPECT 1117dump() better written as CORE::dump() at - line 4. 1118- syntax OK 1119######## 1120# toke.c 1121use warnings 'misc'; 1122use subs qw/dump/; 1123sub dump { print "no warning for overridden dump\n"; } 1124dump; 1125EXPECT 1126no warning for overridden dump 1127######## 1128# toke.c 1129use warnings 'ambiguous'; 1130"@mjd_previously_unused_array"; 1131no warnings 'ambiguous'; 1132"@mjd_previously_unused_array2"; 1133EXPECT 1134Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3. 1135######## 1136# toke.c 1137use utf8; 1138use open qw( :utf8 :std ); 1139use warnings 'ambiguous'; 1140"@mjd_previously_unused_àrray"; 1141no warnings 'ambiguous'; 1142"@mjd_previously_unused_àrray2"; 1143EXPECT 1144Possible unintended interpolation of @mjd_previously_unused_àrray in string at - line 5. 1145######## 1146# toke.c 1147use utf8; 1148use open qw( :utf8 :std ); 1149use warnings 'ambiguous'; 1150"@mjd_previously_unused_ぁrrぁy"; 1151no warnings 'ambiguous'; 1152"@mjd_previously_unused_ぁrrぁy2"; 1153EXPECT 1154Possible unintended interpolation of @mjd_previously_unused_ぁrrぁy in string at - line 5. 1155######## 1156# toke.c 1157# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com 1158use warnings 'regexp'; 1159"foo" =~ /foo/c; 1160"foo" =~ /foo/cg; 1161no warnings 'regexp'; 1162"foo" =~ /foo/c; 1163"foo" =~ /foo/cg; 1164EXPECT 1165Use of /c modifier is meaningless without /g at - line 4. 1166######## 1167# toke.c 1168# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com 1169use warnings 'regexp'; 1170$_ = "ab" ; 1171s/ab/ab/c; 1172s/ab/ab/cg; 1173no warnings 'regexp'; 1174s/ab/ab/c; 1175s/ab/ab/cg; 1176EXPECT 1177Use of /c modifier is meaningless in s/// at - line 5. 1178Use of /c modifier is meaningless in s/// at - line 6. 1179######## 1180-wa 1181# toke.c 1182# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings 1183print "@F\n"; 1184EXPECT 1185 1186######## 1187-w 1188# toke.c 1189# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings 1190print "@F\n"; 1191EXPECT 1192Possible unintended interpolation of @F in string at - line 4. 1193Name "main::F" used only once: possible typo at - line 4. 1194######## 1195-wa 1196# toke.c 1197# 20020414 mjd-perl-patch+@plover.com 1198EXPECT 1199 1200######## 1201# toke.c 1202# 20020414 mjd-perl-patch+@plover.com 1203# In 5.7.3, this emitted "Possible unintended interpolation" warnings 1204use warnings 'ambiguous'; 1205$s = "(@-)(@+)"; 1206EXPECT 1207 1208######## 1209# toke.c 1210# mandatory warning 1211eval q/if ($a) { } elseif ($b) { }/; 1212no warnings "syntax"; 1213eval q/if ($a) { } elseif ($b) { }/; 1214EXPECT 1215elseif should be elsif at (eval 1) line 1. 1216######## 1217# toke.c 1218# mandatory warning 1219eval q/5 6/; 1220no warnings "syntax"; 1221eval q/5 6/; 1222EXPECT 1223Number found where operator expected at (eval 1) line 1, near "5 6" 1224 (Missing operator before 6?) 1225######## 1226# toke.c 1227use warnings "syntax"; no warnings "deprecated"; 1228$_ = $a = 1; 1229$a !=~ /1/; 1230$a !=~ m#1#; 1231$a !=~/1/; 1232$a !=~ ?/?; 1233$a !=~ y/1//; 1234$a !=~ tr/1//; 1235$a !=~ s/1//; 1236$a != ~/1/; 1237no warnings "syntax"; 1238$a !=~ /1/; 1239$a !=~ m#1#; 1240$a !=~/1/; 1241$a !=~ ?/?; 1242$a !=~ y/1//; 1243$a !=~ tr/1//; 1244$a !=~ s/1//; 1245EXPECT 1246!=~ should be !~ at - line 4. 1247!=~ should be !~ at - line 5. 1248!=~ should be !~ at - line 6. 1249!=~ should be !~ at - line 7. 1250!=~ should be !~ at - line 8. 1251!=~ should be !~ at - line 9. 1252!=~ should be !~ at - line 10. 1253######## 1254# toke.c 1255our $foo :unique; 1256sub pam :locked; 1257sub glipp :locked { 1258} 1259sub whack_eth ($) : locked { 1260} 1261no warnings 'deprecated'; 1262our $bar :unique; 1263sub zapeth :locked; 1264sub ker_plop :locked { 1265} 1266sub swa_a_p ($) : locked { 1267} 1268EXPECT 1269Use of :unique is deprecated at - line 2. 1270Use of :locked is deprecated at - line 3. 1271Use of :locked is deprecated at - line 4. 1272Use of :locked is deprecated at - line 6. 1273######## 1274# toke.c 1275use warnings "syntax"; use feature 'lexical_subs'; 1276sub proto_after_array(@$); 1277sub proto_after_arref(\@$); 1278sub proto_after_arref2(\[@$]); 1279sub proto_after_arref3(\[@$]_); 1280sub proto_after_hash(%$); 1281sub proto_after_hashref(\%$); 1282sub proto_after_hashref2(\[%$]); 1283sub underscore_last_pos($_); 1284sub underscore2($_;$); 1285sub underscore_fail($_$); 1286sub underscore_after_at(@_); 1287our sub hour (@$); 1288my sub migh (@$); 1289use feature 'state'; 1290state sub estate (@$); 1291package other; 1292sub hour (@$); 1293sub migh (@$); 1294sub estate (@$); 1295no warnings "syntax"; 1296sub proto_after_array(@$); 1297sub proto_after_hash(%$); 1298sub underscore_fail($_$); 1299EXPECT 1300Prototype after '@' for main::proto_after_array : @$ at - line 3. 1301Prototype after '%' for main::proto_after_hash : %$ at - line 7. 1302Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. 1303Prototype after '@' for main::underscore_after_at : @_ at - line 13. 1304The lexical_subs feature is experimental at - line 14. 1305Prototype after '@' for hour : @$ at - line 14. 1306The lexical_subs feature is experimental at - line 15. 1307Prototype after '@' for migh : @$ at - line 15. 1308The lexical_subs feature is experimental at - line 17. 1309Prototype after '@' for estate : @$ at - line 17. 1310Prototype after '@' for hour : @$ at - line 19. 1311Prototype after '@' for migh : @$ at - line 20. 1312Prototype after '@' for estate : @$ at - line 21. 1313######## 1314# toke.c 1315use warnings "ambiguous"; 1316"foo\nn" =~ /^foo$\n/; 1317"foo\nn" =~ /^foo${\}n/; 1318my $foo = qr/^foo$\n/; 1319my $bar = qr/^foo${\}n/; 1320no warnings "ambiguous"; 1321"foo\nn" =~ /^foo$\n/; 1322"foo\nn" =~ /^foo${\}n/; 1323my $foo = qr/^foo$\n/; 1324my $bar = qr/^foo${\}n/; 1325EXPECT 1326Possible unintended interpolation of $\ in regex at - line 3. 1327Possible unintended interpolation of $\ in regex at - line 5. 1328######## 1329# toke.c 1330use warnings 'syntax' ; 1331my $a = "\o"; 1332my $a = "\o{"; 1333my $a = "\o{}"; 1334no warnings 'syntax' ; 1335my $a = "\o"; 1336my $a = "\o{"; 1337my $a = "\o{}"; 1338EXPECT 1339Missing braces on \o{} at - line 3, within string 1340Missing right brace on \o{ at - line 4, within string 1341Number with no digits at - line 5, within string 1342BEGIN not safe after errors--compilation aborted at - line 6. 1343######## 1344# toke.c 1345use warnings 'digit' ; 1346my $a = "\o{1238456}"; 1347no warnings 'digit' ; 1348my $a = "\o{1238456}"; 1349EXPECT 1350Non-octal character '8'. Resolved as "\o{123}" at - line 3. 1351######## 1352# toke.c 1353use warnings; 1354my $a = "foo"; 1355print $a =~ ?f? ? "yes\n" : "no\n" foreach 0..2; 1356EXPECT 1357Use of ?PATTERN? without explicit operator is deprecated at - line 4. 1358yes 1359no 1360no 1361######## 1362# toke.c 1363use warnings; 1364$a = "\c,"; 1365$a = "\c`"; 1366no warnings 'syntax'; 1367$a = "\c,"; 1368$a = "\c`"; 1369EXPECT 1370"\c," is more clearly written simply as "l" at - line 3. 1371"\c`" is more clearly written simply as "\ " at - line 4. 1372######## 1373# toke.c 1374use warnings; 1375my $a = "\c{ack}"; 1376EXPECT 1377OPTION fatal 1378Use ";" instead of "\c{" at - line 3. 1379######## 1380# toke.c 1381my $a = "\câ"; 1382EXPECT 1383OPTION fatal 1384Character following "\c" must be printable ASCII at - line 2. 1385######## 1386# toke.c 1387use warnings 'syntax' ; 1388my $a = qr/foo/du; 1389$a = qr/foo/lai; 1390$a = qr/foo/lil; 1391$a = qr/foo/aia; 1392$a = qr/foo/aaia; 1393no warnings 'syntax' ; 1394my $a = qr/foo/du; 1395EXPECT 1396Regexp modifiers "/d" and "/u" are mutually exclusive at - line 3, near "= " 1397Regexp modifiers "/l" and "/a" are mutually exclusive at - line 4, near "= " 1398Regexp modifier "/l" may not appear twice at - line 5, near "= " 1399Regexp modifier "/a" may appear a maximum of twice at - line 7, near "= " 1400BEGIN not safe after errors--compilation aborted at - line 8. 1401######## 1402# toke.c 1403# [perl #4362] 1404eval "print q\xabfoo"; 1405print "ok\n" if 1406 $@ =~ /Can't find string terminator "\xab" anywhere before EOF/; 1407EXPECT 1408ok 1409######## 1410# toke.c 1411use utf8; 1412use open qw( :utf8 :std ); 1413use warnings 'ambiguous' ; 1414sub frèd {} 1415$a = ${frèd} ; 1416no warnings 'ambiguous' ; 1417$a = ${frèd} ; 1418EXPECT 1419Ambiguous use of ${frèd} resolved to $frèd at - line 6. 1420######## 1421# toke.c 1422use utf8; 1423use open qw( :utf8 :std ); 1424use warnings 'ambiguous' ; 1425sub f렏 {} 1426$a = ${f렏} ; 1427no warnings 'ambiguous' ; 1428$a = ${f렏} ; 1429EXPECT 1430Ambiguous use of ${f렏} resolved to $f렏 at - line 6. 1431######## 1432# toke.c 1433use utf8; 1434use open qw( :utf8 :std ); 1435use warnings; 1436CORE::렏; 1437EXPECT 1438CORE::렏 is not a keyword at - line 5. 1439######## 1440# toke.c 1441# [perl #16249] 1442print ''; 1443eval this_method_is_fake (); 1444EXPECT 1445Undefined subroutine &main::this_method_is_fake called at - line 4. 1446######## 1447# toke.c 1448# [perl #107002] Erroneous ambiguity warnings 1449sub { # do not actually call require 1450 require a::b . 1; # These used to produce erroneous 1451 require a::b + 1; # ambiguity warnings. 1452} 1453EXPECT 1454######## 1455# toke.c 1456# [perl #113094], [perl #119101] 1457print "aa" =~ m{^a\{1,2\}$}, "\n"; 1458print "aa" =~ m{^a\x\{61\}$}, "\n"; 1459print "a\\x{6F}" =~ m{^a\\x\{6F\}$}, "\n"; 1460print "a\\o" =~ m{^a\\\x\{6F\}$}, "\n"; 1461print "a\\\\x{6F}" =~ m{^a\\\\x\{6F\}$}, "\n"; 1462print "a\\\\o" =~ m{^a\\\\\x\{6F\}$}, "\n"; 1463print "aa" =~ m{^a{1,2}$}, "\n"; 1464print "aq" =~ m[^a\[a-z\]$], "\n"; 1465print "aq" =~ m(^a\(q\)$), "\n"; 1466no warnings 'deprecated'; 1467print "aa" =~ m{^a\{1,2\}$}, "\n"; 1468print "aa" =~ m{^a\x\{61\}$}, "\n"; 1469print "a\\x{6F}" =~ m{^a\\x\{6F\}$}, "\n"; 1470print "a\\o" =~ m{^a\\\x\{6f\}$}, "\n"; 1471print "aq" =~ m[^a\[a-z\]$], "\n"; 1472print "aq" =~ m(^a\(q\)$), "\n"; 1473EXPECT 1474Useless use of '\'; doesn't escape metacharacter '{' at - line 3. 1475Useless use of '\'; doesn't escape metacharacter '{' at - line 4. 1476Useless use of '\'; doesn't escape metacharacter '{' at - line 6. 1477Useless use of '\'; doesn't escape metacharacter '{' at - line 8. 1478Useless use of '\'; doesn't escape metacharacter '[' at - line 10. 1479Useless use of '\'; doesn't escape metacharacter '(' at - line 11. 14801 14811 14821 14831 14841 14851 14861 14871 1488q 14891 14901 14911 14921 14931 1494q 1495######## 1496# toke.c 1497#[perl #119123] disallow literal control character variables 1498eval "\$\cQ = 25"; 1499eval "\${ \cX } = 24"; 1500*{ 1501 Foo 1502}; # shouldn't warn on {\n, even though \n is a control character 1503EXPECT 1504Use of literal control characters in variable names is deprecated at (eval 1) line 1. 1505Use of literal control characters in variable names is deprecated at (eval 2) line 1. 1506######## 1507# toke.c 1508# [perl #120288] -X at start of line gave spurious warning, where X is not 1509# a filetest operator 1510-a; 1511;-a; 1512EXPECT 1513######## 1514# toke.c 1515# [perl #124113] Compile-time warning with UTF8 variable in array index 1516use warnings; 1517use utf8; 1518my $ = 0; 1519my @array = (0); 1520my $v = $array[ 0 + $ ]; 1521 $v = $array[ $ + 0 ]; 1522EXPECT 1523######## 1524# toke.c 1525# Allow Unicode here doc boundaries 1526use warnings; 1527use utf8; 1528my $v = <<EnFraçais; 1529Comme ca! 1530EnFraçais 1531print $v; 1532EXPECT 1533Comme ca! 1534######## 1535# toke.c 1536# Fix 'Use of "..." without parentheses is ambiguous' warning for 1537# Unicode function names 1538use utf8; 1539use warnings; 1540sub (;$) { return 0; } 1541my $v = - 5; 1542EXPECT 1543Warning: Use of "" without parentheses is ambiguous at - line 7. 1544