Carton...:Update(3pm)

πŸ’– Carton::Doc::Update β€” Update the dependencies πŸ’–

ok bestie, you found it β€” the Carton...:Update(3pm) page, straight outta the User Contributed Perl Documentation section. this is the one about updating your deps, and it's lowkey iconic. let's go 🫢


✨ SYNOPSIS ✨

carton update [module]

that's it. that's the whole vibe. one command, optional module, boom πŸ’…


🌸 DESCRIPTION 🌸

so like, what does it even do? it updates the dependencies version for your application. simple as that, no cap.

now here's the part that makes Carton kind of a queen πŸ‘‘: Carton is designed to update your dependency in a conservative way. meaning β€” and this is the important bit β€” it doesn't update modules that aren't explicitly required to be updated. she's not out here changing your whole life for no reason. she minds her business. periodt.

carton update is the command you reach for when you do wanna explicitly update one or all of the modules in your cpanfile to the latest available version that satisfies the requirements in the cpanfile. latest available + satisfies the requirements β€” both of those have to be true, okay? no shortcuts.


πŸŽ€ EXAMPLE πŸŽ€

ok so picture this. you've got a cpanfile that looks like:

requires 'DBI', '1.600';
requires 'Plack', '== 1.0011';

and then you run carton install and you get DBI 1.610 (which was the latest at that time, slay) and Plack 1.0011 (exactly what the requirement said, because that requirement is strict).

a few weeks go by. DBI and Plack have been updated a couple of times since. you run carton install again and… nothing changes. πŸ™ˆ why? because the installed versions already satisfy the requirements in cpanfile. she said "we're good here."

now run carton update and it's a different story:

  • DBI gets updated to the latest version, say 1.611 β€” because that version still satisfies the requirement. ✨ ate that.
  • Plack does NOT get updated. and that's correct, bestie. whatever the latest version on CPAN is, it won't satisfy Plack's requirement == 1.0011, because that requirement wants an exact version. exact means exact. no wiggle room. πŸ’€

so yeah β€” carton update knows the difference between "sure, upgrade me" and "girl, absolutely not." that's the whole point. iykyk. πŸ¦‹


fr fr the takeaway: carton update is your bestie who respects your constraints. she'll pull the newest thing that still fits, and she will never break your == pins. πŸ’œ

and that's a wrap, babes 🌈 this page came to you from perl v5.34.0, dated 2022-05-12, filed under Carton...:Update(3pm) β€” go forth and update responsibly βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from