Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

A few tiny things on top @Brythan @Brythan's excellent review.


my $subls = '[a-z0-9\. ]+';

You don't need to escape \. within [ ... ] inside a regex. So this is the same and simpler:

my $subls = '[a-z0-9. ]+';

Instead of this:

 $value = q{} if not defined $value;

This is shorter and easier to type:

 $value = '' if not defined $value; 

 else { die "invalid key: $key\n"; }

If you omit the newline \n, then die will append the line number and a newline to the message, which is useful for debugging. (Maybe you already knew this and put the newline there on purpose to hide the line number, but maybe not, so I thought this is worth mentioning.)


The parentheses are unnecessary here:

 return (join ', ', keys %emails);

A few tiny things on top @Brythan's excellent review.


my $subls = '[a-z0-9\. ]+';

You don't need to escape \. within [ ... ] inside a regex. So this is the same and simpler:

my $subls = '[a-z0-9. ]+';

Instead of this:

 $value = q{} if not defined $value;

This is shorter and easier to type:

 $value = '' if not defined $value; 

 else { die "invalid key: $key\n"; }

If you omit the newline \n, then die will append the line number and a newline to the message, which is useful for debugging. (Maybe you already knew this and put the newline there on purpose to hide the line number, but maybe not, so I thought this is worth mentioning.)


The parentheses are unnecessary here:

 return (join ', ', keys %emails);

A few tiny things on top @Brythan's excellent review.


my $subls = '[a-z0-9\. ]+';

You don't need to escape \. within [ ... ] inside a regex. So this is the same and simpler:

my $subls = '[a-z0-9. ]+';

Instead of this:

 $value = q{} if not defined $value;

This is shorter and easier to type:

 $value = '' if not defined $value; 

 else { die "invalid key: $key\n"; }

If you omit the newline \n, then die will append the line number and a newline to the message, which is useful for debugging. (Maybe you already knew this and put the newline there on purpose to hide the line number, but maybe not, so I thought this is worth mentioning.)


The parentheses are unnecessary here:

 return (join ', ', keys %emails);
Source Link
janos
  • 113k
  • 15
  • 154
  • 396

A few tiny things on top @Brythan's excellent review.


my $subls = '[a-z0-9\. ]+';

You don't need to escape \. within [ ... ] inside a regex. So this is the same and simpler:

my $subls = '[a-z0-9. ]+';

Instead of this:

 $value = q{} if not defined $value;

This is shorter and easier to type:

 $value = '' if not defined $value; 

 else { die "invalid key: $key\n"; }

If you omit the newline \n, then die will append the line number and a newline to the message, which is useful for debugging. (Maybe you already knew this and put the newline there on purpose to hide the line number, but maybe not, so I thought this is worth mentioning.)


The parentheses are unnecessary here:

 return (join ', ', keys %emails);
lang-perl

AltStyle によって変換されたページ (->オリジナル) /