in reply to Reading from file

The result is different because you set $test[1] = qr/b/ in your code, which is not the same as $test[1] = 'qr/b/'.

qr/b/ creates a regular expression reference, which Dumper prints as qr/(?-xism:b)/, whereas 'qr/b/' is a plain string.

If you want to read a regular expression reference from a file, you have to either write it with Storable (which results in a binary file you cannot edit by hand) or Data::Dump it (so that you can eval it back, with the obvious security implications) or do something like gaal is suggesting above.