Saturday, 10 April 2010

$+ , $; , $,

$+ :- The last bracket matched by the last search pattern. This is useful if you don't know which of a set of alternative patterns matched. This is a default local variable.
For example:
/Version: (.*)|Revision: (.*)/ && ($rev = $+);

$, :- The output field separator for the print operator.

$; :- The subscript separator for multi-dimensional array emulation. If you refer to an associative array element as: $foo{$a,$b,$c}

It really means: $foo{join($;, $a, $b, $c)}
but don't put @foo{$a,$b,$c}

which means ($foo{$a},$foo{$b},$foo{$c})

Below link describes variables very well:

No comments:

Post a Comment

Tweets by @sriramperumalla