Corion, as usual, makes the case splendidly well. However, you could make your code a little more elegant, thro' the use of
autodie or possibly the, now deprecated,
Fatal module - both of which have the capability to devolve the error checking to perl itself - thus removing the explicit requirement for you to explicitly do the tests.
A user level that continues to overstate my experience :-))