[JOB] Perl Software Developer and Database programmer

David Cantrell david at cantrell.org.uk
Thu Feb 23 17:32:21 GMT 2006


On Wed, Feb 22, 2006 at 12:36:33PM +0000, Lusercop wrote:

> {
>    my $newdollarslash = "whatIwant";
>    my $savdollarslash = $/;
>    $/ = $newdollarslash;
>    dostuffwithappropriatecalls();
>    $/ = $savdollarslash;
> }
> 
> this is the equivalent of:
> 
> {
>    local $/;
>    my $newdollarslash = "whatIwant";
>    $/ = $newdollarslash;
>    dostuffwithappropriatecalls();
> }
> 
> Why? because it's clear that you're saving the value and restoring it.

Using a comment, however, is even clearer ...

{
    local $/ = 'foo';  # temporarily change $/ until we hit end of block
    dostuff()
}

-- 
David Cantrell | http://www.cantrell.org.uk/david

EIN KIRCHE! EIN KREDO! EIN PAPST!


More information about the london.pm mailing list