Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Reference found where even-sized list expected

by kcott (Archbishop)
on Sep 28, 2017 at 05:04 UTC ( [id://1200242]=note: print w/replies, xml ) Need Help??


in reply to Reference found where even-sized list expected

G'day sciguy,

I see you've been shown three different ways to deal with this: here's a fourth.

Change

my %info = get_mp3info($file); my %tags = get_mp3tag($file);

to

my %info = get_mp3info($file)->%*; my %tags = get_mp3tag($file)->%*;

and leave the remainder of your code as is.

That's called "Postfix Dereference Syntax". It became available in 5.20 with a feature declaration; as of 5.24, that declaration is not required. It's not experimental, so quite OK for production code. Follow that link for more complete details.

— Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1200242]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-23 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found