mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework
https://mojolicious.org
Artistic License 2.0
2.66k stars 576 forks source link

Mojo::URL->new as an alias in ojo #1514

Closed dex4er closed 3 years ago

dex4er commented 4 years ago

I love perl -Mojo and it is awesome for simple oneliners. Would be possible to add Mojo::URL->new() to ojo module? Ie. as l function maybe.

Sometimes I would like to parse URL addresses and then I would find perl -Mojo extremely helpful:

ie.

perl -Mojo -E 'say l("index.html")->to_abs(l("http://example.com"))

rather than

perl -Mojo -E 'say Mojo::URL->new("index.html")->to_abs(Mojo::URL->new("https://example.com"))'

kiwiroy commented 4 years ago

Would this make it?

dex4er commented 4 years ago

@kiwiroy looks great!

dex4er commented 4 years ago

@kiwiroy could you ping your PR? I provided maybe a little better example of usage. Maybe it will be accepted by Kraith