Created
February 19, 2011 15:30
-
-
Save adamtaylor/835123 to your computer and use it in GitHub Desktop.
Evil localisation of $_ ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _format_key { | |
my $class = shift; | |
my ( $key ) = @_; | |
# Localise $_ so we can use functions that operate on $_ for berevity | |
local $_ = $key; | |
# Convert to the correct format/case | |
s/publishDate/publish_date/ if /publishDate/; | |
s/lastModifiedDate/last_modified_date/ if /lastModifiedDate/; | |
return $_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment