Navigation Menu

Skip to content

Commit

Permalink
do not use each anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 3, 2014
1 parent fca2055 commit 878b84e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,5 +1,7 @@

4.92 2014-04-03
- Removed deprecated use of hash references for optgroup generation with
select_field helper.

4.91 2014-03-29
- Added daemonize method to Mojo::Server.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Headers.pm
Expand Up @@ -48,7 +48,8 @@ sub from_hash {
delete $self->{headers} if keys %{$hash} == 0;

# Merge
while (my ($header, $value) = each %$hash) {
for my $header (keys %$hash) {
my $value = $hash->{$header};
$self->add($header => ref $value eq 'ARRAY' ? @$value : $value);
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Message/Request.pm
Expand Up @@ -196,7 +196,8 @@ sub _parse_env {
my $headers = $self->headers;
my $url = $self->url;
my $base = $url->base;
while (my ($name, $value) = each %$env) {
for my $name (keys %$env) {
my $value = $env->{$name};
next unless $name =~ s/^HTTP_//i;
$name =~ y/_/-/;
$headers->header($name => $value);
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -309,8 +309,8 @@ Since everything is just Perl normal control structures just work.
<%= $framework %> was written by <%= $author %>.
% }

% while (my ($app, $description) = each %$examples) {
<%= $app %> is a <%= $description %>.
% if (my $description = $examples->{tweetylicious}) {
Tweetylicious is a <%= $description %>.
% }

=head2 Content negotiation
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Plugin/HeaderCondition.pm
Expand Up @@ -24,9 +24,8 @@ sub _headers {

# All headers need to match
my $headers = $c->req->headers;
while (my ($name, $pattern) = each %$patterns) {
return undef unless _check(scalar $headers->header($name), $pattern);
}
_check(scalar $headers->header($_), $patterns->{$_}) || return undef
for keys %$patterns;
return 1;
}

Expand Down
9 changes: 1 addition & 8 deletions lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -2,7 +2,7 @@ package Mojolicious::Plugin::TagHelpers;
use Mojo::Base 'Mojolicious::Plugin';

use Mojo::ByteStream;
use Mojo::Util qw(deprecated xml_escape);
use Mojo::Util 'xml_escape';
use Scalar::Util 'blessed';

sub register {
Expand Down Expand Up @@ -157,13 +157,6 @@ sub _select_field {
my $groups = '';
for my $group (@$options) {

# DEPRECATED in Top Hat!
if (ref $group eq 'HASH') {
deprecated
'hash references are DEPRECATED in favor of Mojo::Collection objects';
$group = Mojo::Collection->new(each %$group);
}

# "optgroup" tag
if (blessed $group && $group->isa('Mojo::Collection')) {
my ($label, $values, %attrs) = @$group;
Expand Down

0 comments on commit 878b84e

Please sign in to comment.