Hash Slices

Learn about hash slices and empty hashes in Perl.

Introduction to hash slices

A hash slice is a list of keys or values of a hash indexed in a single operation. Here’s how to initialize multiple elements of a hash at once:

Get hands-on with 1400+ tech skills courses.