Last active
December 14, 2015 17:49
-
-
Save tempire/5125010 to your computer and use it in GitHub Desktop.
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
Current side-effects | |
perl -MMojo::Parameters -E 'my $params = Mojo::Parameters->new; $params->append(foo => -bar); say $params->to_string' | |
# foo=-bar | |
perl -MMojo::Parameters -E 'my $params = Mojo::Parameters->new; $params->append(foo => -bar); say $params->append(foo => -bar)->to_string' | |
# foo=-bar&foo=-bar | |
Without side-effects | |
perl -MMojo::Parameters -E 'my $params = Mojo::Parameters->new; $params->append(foo => -bar); say $params->to_string' | |
# (first append useless - it returns object that is not assigned to anything) | |
perl -MMojo::Parameters -E 'my $params = Mojo::Parameters->new; say $params->append(foo => -bar)->to_string' | |
# foo=-bar | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment