in reply to Regex String

This seems to work:
use Modern::Perl; while (<DATA>) { chomp; do { say "Not a valid file, Check output!"; next } if /[^0-9A-F +]/; do { say "All zeroes or empty, Check output!"; next } if /^0*$/; say '==', join "\n==", /(..)/g; } __DATA__ 00000FFEDFF67FFB8FF96FFE200BBFF240020FFBAFF360132FF6500FCFED30079 000000000000000000000000000000000 THIS IS NOT A HEX DUMP
Output:
==00 ==00 ==0F ==FE ==DF ==F6 ...(snip)... ==0F ==CF ==ED ==30 ==07 All zeroes or empty, Check output! All zeroes or empty, Check output! Not a valid file, Check output!

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics