Perl Language Variables

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • my # Lexical declaration
  • our # Global declaration
  • $foo # Scalar
  • @foo # Array
  • $#foo # Array Last-Index
  • %foo # Hash
  • ${$foo} # Scalar De-Reference
  • @{$foo} # Array De-Reference
  • $#{$foo} # Array-DeRef Last-Index
  • %{$foo} # Hash De-Reference
  • $foo[$index] # Array get indexed
  • ${$foo}[$index] # Array De-Reference and get indexed.
  • $foo->[$index] # Array De-Reference and get indexed ( Simplified )
  • $foo{$key} # Hash get value for key
  • ${$foo}{$key} # Hash Dereference and get value for key
  • $foo->{$key} # Hash Dereference and get value for key ( Simplified )
  • \$x # Reference to Scalar
  • \@x # Reference to Array
  • \%x # Reference to Hash
  • =[ ] # Reference to Anonymous Array (Inline)
  • ={ } # Reference to Anonymous Hash (Inline)


Got any Perl Language Question?