DATA is free lunch from Perl. It is a file handler, and can be handled just as any other handler.
However, I would still think it is a better practice to physically separate "data" from "process"/"logic". I would suggest to use __DATA__ only as fast food for testing your programs, but not keep in production code.