I spent too much time trying to remember "how to do atoi() in Perl" when you don't need to do that in Perl, it makes no distinction between numbers and strings, you can just do

my $N = shift @ARGV;
$N > 0 || die("Arg must be > 0");

@vaporeon_ man I remember really enjoying Perl when I took my "programming languages paradigms" in college, maybe I should learn it again

also what is die in Perl?

@vaporeon_ oh does it kill program execution and log the given message to console?

Follow

@wallhackio @vaporeon_ functions named die that work like that seem to be a general convention; i’ve seen it manually defined to work like that in several codebases

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.