LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
βœ–οΈŽ
about reveddit
βš™F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
101
SOLUTION MEGATHREAD-πŸŽ„- 2022 Day 2 Solutions -πŸŽ„-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 4 days, 4 hours after) by daggerdragon to /r/adventofcode (134.8k)
1501 commentsredditother-discussionssubreddit-indexmessage modsop-focus

NEW AND NOTEWORTHY

  • All of our rules, FAQs, resources, etc. are in our [community wiki](/r/adve...

... view full text

since 3 years, 1 month ago
3 of 3

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–]Smylers2 points3 years, 1 month ago

Thanks. It's great your on Perl v5.36, because that makes function parameters really easy.

First, for backwards-compatibility reasons, you need to tell Perl that you're using the latest syntax. Start your program with:

use v5.36;

However, v5.36 automatically enables strict and warnings for you, so in place of adding the v5.36 line you you can remove those two.†

Then just declare functions like:

sub getNumbers($filename) {

or:

sub sumOverNumbers($file, %scores) {

and Perl will handle the parameters for you.

† Starting your Perl programs with the minimum version number required also means it will check for that and give a sensible error message if somebody attempts to run it on an older version of perl β€” which is much better than it just failing weirdly on syntax is doesn't recognize. And in forums like this one, it provides documentation for humans, rather than them having to guess which version of perl they need to run.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–][deleted]2 points3 years, 1 month ago

oh yeah, I remember I tried using given() { when...} and I was wondering why Perl simply refused to parse my thing. what's the "default" version if I don't have that use there?

permalinkparentcontexthide replies (1)as-of
[–]Smylers1 point3 years, 1 month ago

I think the first syntax changes were brought in with v5.10, so the β€˜default’ semantics are probably something like v5.8.2 β€” ancient history, anyway!

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
βœ–οΈŽ

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com