Hidden features of Perl? -


what useful esoteric language features in perl you've been able employ useful work?

guidelines:

  • try limit answers perl core , not cpan
  • please give example , short description

hidden features found in other languages' hidden features:

(these corion's answer)

  • c
    • duff's device
    • portability , standardness
  • c#
    • quotes whitespace delimited lists , strings
    • aliasable namespaces
  • java
    • static initalizers
  • javascript
    • functions first class citizens
    • block scope , closure
    • calling methods , accessors indirectly through variable
  • ruby
    • defining methods through code
  • php
    • pervasive online documentation
    • magic methods
    • symbolic references
  • python
    • one line value swapping
    • ability replace core functions own functionality

other hidden features:

operators:

quoting constructs:

syntax , names:

modules, pragmas, , command-line options:

variables:

loops , flow control:

regular expressions:

other features:

other tricks, , meta-answers:


see also:

the flip-flop operator useful skipping first iteration when looping through records (usually lines) returned file handle, without using flag variable:

while(<$fh>) {   next if 1..1; # skip first record   ... } 

run perldoc perlop , search "flip-flop" more information , examples.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -