Skip to content

Instantly share code, notes, and snippets.

@SunKing2
Last active October 15, 2023 15:40
Show Gist options
  • Save SunKing2/5889c0f56dac03d1724f09e2f3c4b05d to your computer and use it in GitHub Desktop.
Save SunKing2/5889c0f56dac03d1724f09e2f3c4b05d to your computer and use it in GitHub Desktop.

asdf cheatsheet

Install Perl and set as current:

asdf plugin-add perl # gotta install for each language
asdf list-all perl  # show all available version #s
asdf install perl 5.38.0
asdf global perl 5.38.0 #(do this!!!, more info below)
asdf plugin list all | grep -i graal # see if there's a plugin for graalvm or graal or something like that

Check it:

asdf list # all installed versions
asdf current # (optional) shows what's currently used
perl --version

If it doesn't show 5.38.0, try this:

source ~/.bashrc

To uninstall asdf perly stuff:

Remove the perl line(s) from ~/.tool-versions file using an editor, then

asdf uninstall perl 5.38.0 # asdf unistall perl also works
asdf uninstall perl 5.36.1
asdf plugin-remove perl # asdf is done with perl!

More info on asdf global:

asdf global perl 5.38.0 will create ~/.tool-versions which looks like:

perl 5.38.0

Adding and working with another version of perl:

asdf install perl 5.36.1 # install 2nd perl
asdf global perl 5.36.1
perl --version # shows 5.36.1
asdf global perl 5.38.0
perl --version # now shows 5.38.0

Different development directories need different perl:

In different development directories you may want to use a different version of perl.

This will seem like magic, but you can make the right perl run whenever you are in that directory

Go to right that development directory example:

cd ~/my-dev-stuff/perl/myproj

Now type the following command:

asdf local perl 5.38.0 # makes visiting the current directory magically use this version! wow!

This will create a local .tool-versions

The end. Thanks for reading! (like me! 😃)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment