4 ms·
Perl's "magic" variables like "$?" were not named to optimize keystrokes. Most of Perl 5's syntax comes from well established (for perhaps a decade) UNIX cultu
by rlucas 12y ago
Perl's "magic" variables like "$?" were not named to optimize keystrokes.
Most of Perl 5's syntax comes from well established (for perhaps a decade) UNIX culture, from shell, awk, sed, and C syntax conventions. Vanishingly little is actually novel to Perl.
Rails, which is obviously not a peer to Perl, but which you bring up as "going the same way," does similarly have a huge emphasis on convention. But most of its conventions are de novo, made up within the Rails/Ruby community.
You can hate Perl (5) all you like; no accounting for taste and all. But if you find parts of it unfamiliar, it's probably because you are ignoring (or ignorant of) where it came from.
- raiph 12y agoStandard Perl 6 has just these non-English variables: * $_ means "it" * @_ means "args" * $! means "current exception/error" * $/ means "last match" * $0 means $/[0], the first captured value of the last match All other system variables have understandable English names, eg: * $IN means the STDIN object/handle $OUT means the STDOUT object/handle %ENV means a hash (dict) of system environment variables $PID means the system process id $*KERNEL means the operating system kernel running under Etc.
- raiph 12y agoRepeat post with better formatting: Standard Perl 6 has just these non-English variables: - $_ means "it" - @_ means "args" - $! means "current exception/error" - $/ means "last match" - $0 means $/[0], the first captured value of the last match All other system variables have understandable English names, eg: - $IN means the STDIN object/handle - $OUT means the STDOUT object/handle - %ENV means a hash (dict, associative array) of system environment variables - $PID means the system process id - $*KERNEL means the operating system kernel running under Etc.