in reply to perl 5 suggestions?

Perl already supports #1 if you declare the packages ahead of time:
use strict; use warnings; package Str; package main; my Str $name = 'David'; print "Hello, my name is $name\n";
I was really surprised to find that this worked. It's actually documented, somewhat, in the explanation of my. Note that my solution was inspired by Ingy's "the" module.

Replies are listed 'Best First'.
Re^2: perl 5 suggestions?
by LanX (Saint) on Aug 18, 2016 at 12:54 UTC