From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Junio C Hamano <junkio@cox.net>
Cc: Eric Wong <normalperson@yhbt.net>, Adam Roben <aroben@apple.com>,
git@vger.kernel.org
Subject: Re: [PATCH] git-svn: Don't rely on $_ after making a function call
Date: Wed, 25 Apr 2007 19:11:48 -0700 [thread overview]
Message-ID: <864pn3hokb.fsf@blue.stonehenge.com> (raw)
In-Reply-To: <7v4pn4w41k.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Wed, 25 Apr 2007 14:13:43 -0700")
>>>>> "Junio" == Junio C Hamano <junkio@cox.net> writes:
Junio> I suspect Merlyn has better explanation, but...
Junio> for (list) {
Junio> ...
Junio> }
Junio> loop implicitly localizes $_ and does not share this problem,
Junio> which I really appreciate whenever I am writing Perl code, but
Junio> often enough I was bitten by scripts that use "while (<$fh>)",
Junio> which does not localizes $_, and made hard to spot bugs by
Junio> clobbering $_.
Junio> I find the patch a good safety measure for any future breakages.
I'm happy with the patch.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
prev parent reply other threads:[~2007-04-26 2:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 18:50 [PATCH] git-svn: Don't rely on $_ after making a function call Adam Roben
2007-04-25 20:59 ` Eric Wong
2007-04-25 21:03 ` Adam Roben
2007-04-25 21:13 ` Junio C Hamano
2007-04-26 2:11 ` Randal L. Schwartz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=864pn3hokb.fsf@blue.stonehenge.com \
--to=merlyn@stonehenge.com \
--cc=aroben@apple.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=normalperson@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).