Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:
I've always sort of wondered if there was a way to simulate this in Perl due to sheer laziness and hating to type more than I have to.
In Pascal you can say:
with bbentry do begin name := "Olivia Paarts"; stdcode := "3214"; phnum := "30001234"; yrlevel := 9; end
and what I'd like to be able to do in Perl is something along the lines of:
with $anonhash do { $name = 'dave'; $city = 'San Francisco'; $phone = '555-1212'; $hobbies = qw( Perl Anime); }
I've been trying to figure out a way to do this but I'm coming up empty.
Has anyone ever implemented anything like this before?
|
|---|