File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -562,15 +562,16 @@ my $y = ‘foo bar’;
562
562
563
563
my %h = $x => 42, $y => 99;
564
564
say %h«$x»; # ← WRONG; assumption that $x has no whitespace
565
- say %h«$y»; # ← WRONG; this time you can clearly see how wrong it is
565
+ say %h«$y»; # ← WRONG; splits ‘foo bar’ by whitespace
566
566
say %h«"$y"»; # ← KINDA OK; it works but there is no good reason to do that
567
567
say %h{$y}; # ← RIGHT; this is what should be used
568
568
569
569
run «touch $x»; # ← WRONG; assumption that only one file will be created
570
- run «touch $y»; # ← WRONG; this time you can clearly see how wrong it is
571
- run «touch "$y"»; # ← WRONG; still an error if $y starts with -
570
+ run «touch $y»; # ← WRONG; will touch file ‘foo’ and ‘bar’
571
+ run «touch "$y"»; # ← WRONG; better, but has a different issue if $y starts with -
572
572
run «touch -- "$y"»; # ← KINDA OK; it works but there is no good enough reason to do that
573
573
run ‘touch’, ‘--’, $y; # ← RIGHT; explicit and *always* correct
574
+ run <touch -->, $y; # ← RIGHT; < > are OK, this is short and correct
574
575
= end code
575
576
576
577
Basically, C < «» > quoting is only safe to use if you remember to
You can’t perform that action at this time.
0 commit comments