sudhindra k s wrote:
> Hi
>
> Can someone please tell me what the following code is trying to do
>
>
> if ( /CR List/ .. /\(2\)/ ) {
> if ( /CR List/ ) { print " $'\n"; }
> elsif ( /\(2\)/ ) {print " $` \n" ;}
> else { print " $_\n";}
> }
>
> I know that it is trying to print whatever is there between CR List
> and (2). But i am not able guess more than that.
The $' and $` are builtin Perl variables. They are documented in
perldoc perlvar
$' is the text following the last successful match (i.e. the stuff on the
line to the right of "CR List"). $` is the text preceeding the last
successful match (the stuff on the line to the left of "(2)")
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>