use v6;
my $routes = qq:to/END/;
GET /V1/carts/search
POST /V1/customers/:customerId/carts
GET /V1/carts/:cartId
POST /V1/carts/
PUT /V1/carts/:cartId
POST /V1/carts/mine
GET /V1/carts/mine
PUT /V1/carts/mine
PUT /V1/carts/mine/order
GET /V1/guest-carts/:cartId
POST /V1/guest-carts
PUT /V1/guest-carts/:cartId
PUT /V1/guest-carts/:cartId/order
GET /V1/carts/:cartId/shipping-methods
POST /V1/carts/:cartId/estimate-shipping-methods
POST /V1/carts/:cartId/estimate-shipping-methods-by-address-id
GET /V1/carts/mine/shipping-methods
POST /V1/carts/mine/estimate-shipping-methods
POST /V1/carts/mine/estimate-shipping-methods-by-address-id
GET /V1/guest-carts/:cartId/shipping-methods
POST /V1/guest-carts/:cartId/estimate-shipping-methods
GET /V1/carts/:cartId/items
POST /V1/carts/:quoteId/items
PUT /V1/carts/:cartId/items/:itemId
DELETE /V1/carts/:cartId/items/:itemId
GET /V1/guest-carts/:cartId/items
POST /V1/guest-carts/:cartId/items
PUT /V1/guest-carts/:cartId/items/:itemId
DELETE /V1/guest-carts/:cartId/items/:itemId
GET /V1/carts/mine/items
POST /V1/carts/mine/items
PUT /V1/carts/mine/items/:itemId
DELETE /V1/carts/mine/items/:itemId
GET /V1/carts/:cartId/selected-payment-method
PUT /V1/carts/:cartId/selected-payment-method
GET /V1/carts/:cartId/payment-methods
GET /V1/guest-carts/:cartId/selected-payment-method
PUT /V1/guest-carts/:cartId/selected-payment-method
GET /V1/guest-carts/:cartId/payment-methods
GET /V1/carts/mine/selected-payment-method
PUT /V1/carts/mine/selected-payment-method
GET /V1/carts/mine/payment-methods
GET /V1/carts/:cartId/billing-address
POST /V1/carts/:cartId/billing-address
GET /V1/guest-carts/:cartId/billing-address
POST /V1/guest-carts/:cartId/billing-address
GET /V1/carts/mine/billing-address
POST /V1/carts/mine/billing-address
GET /V1/carts/:cartId/coupons
PUT /V1/carts/:cartId/coupons/:couponCode
DELETE /V1/carts/:cartId/coupons
GET /V1/guest-carts/:cartId/coupons
PUT /V1/guest-carts/:cartId/coupons/:couponCode
DELETE /V1/guest-carts/:cartId/coupons
GET /V1/carts/mine/coupons
PUT /V1/carts/mine/coupons/:couponCode
DELETE /V1/carts/mine/coupons
PUT /V1/carts/:cartId/order
GET /V1/carts/:cartId/totals
PUT /V1/guest-carts/:cartId/collect-totals
GET /V1/guest-carts/:cartId/totals
GET /V1/carts/mine/totals
PUT /V1/carts/mine/collect-totals
END
sub tokenize($str) {
(m/ [\S* \s* '/V1/'] <(\S*)> / given $str)
==> split('/')
==> grep({$_ !~~ /^':'/ })
==> join('')
}
for sort({ tokenize($^a) gt tokenize($^b)}, lines $routes) -> $line {
say $line;
}