Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.94k stars 554 forks source link

[doc] Document sigil can optionally be followed by whitespace #19096

Open jidanni opened 3 years ago

jidanni commented 3 years ago
$ man perlglossary
       sigil
           A glyph used in magic. Or, for Perl, the symbol in front of a
           variable name, such as "$", "@", and "%".

OK, but do document somewhere that this can optionally be followed by whitespace.

$ perl -wle 'use strict; my $      m=4; print $ m;'
4

Not mentioned in perlsyn or perlvar or perlref.

Yes, also mention doing so, though legal, is bad practice. Then perlstyle

       •   No space before the semicolon.

need not also mention

       •   No space after the sigil.
Grinnz commented 3 years ago

Yeah I think this is at least underdocumented, few people even know about it.