We can create a dynamic reference of an array by surrounding it with [ and hash by surrounding it with. The arrays and hashes hold scalar values only and do not directly contain other arrays or complex data structures in Perl, but we can achieve this using this reference. Let's see an example to do this: