Skip to content

Commit

Permalink
Be specific that $_ is set locally.
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Sep 16, 2014
1 parent 94698ce commit 07a3cb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
@@ -1,6 +1,7 @@
language: perl
perl:
- "5.19"
- "5.21"
- "5.20"
- "5.18"
- "5.16"
- "5.14"
Expand Down
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -8,6 +8,8 @@ Revision history for Perl extension DBIx::Connector.
- Improved handling of connection failures when RaiseError (or
HandleError) is not set. Thanks to Andreas Huber for the report and
fix.
- Document that `$_` is set locally, not globally, in the methods that
set it. Suggested by William Lindley.

0.53 2013-03-20T06:04:34Z
- Fixed some documentation typos, thanks to Mike O'Regan (Issue #22).
Expand Down
11 changes: 6 additions & 5 deletions lib/DBIx/Connector.pm
Expand Up @@ -689,9 +689,10 @@ blocks.
$conn->run(ping => sub { $_->do($query) });
Simply executes the block, setting C<$_> to and passing in the database
handle. Returns the value returned by the block in scalar or array context as
appropriate (and the block can use C<wantarray> to decide what to do).
Simply executes the block, locally setting C<$_> to and passing in the
database handle. Returns the value returned by the block in scalar or array
context as appropriate (and the block can use C<wantarray> to decide what to
do).
An optional first argument sets the connection mode, overriding that set in
the C<mode()> accessor, and may be one of C<ping>, C<fixup>, or C<no_ping>
Expand Down Expand Up @@ -732,8 +733,8 @@ when called from inside a C<run()>, C<txn()> or C<svp()> block.
my $sth = $conn->txn(fixup => sub { $_->do($query) });
Starts a transaction, executes the block, setting C<$_> to and passing in the
database handle, and commits the transaction. If the block throws an
Starts a transaction, executes the block, locally setting C<$_> to and passing
in the database handle, and commits the transaction. If the block throws an
exception, the transaction will be rolled back and the exception re-thrown.
Returns the value returned by the block in scalar or array context as
appropriate (and the block can use C<wantarray> to decide what to do).
Expand Down

0 comments on commit 07a3cb5

Please sign in to comment.