Illegal declaration of anonymous subroutine at ./utf-2.pl line 8 (#1) (F) When using the sub keyword to construct an anonymous subroutine, you must always specify a block of code. See perlsub.