$ perl5.10.0 -w sub when { use POSIX "strftime"; strftime("[%Y-%m-%d %H:%M:%S] ", gmtime) } warn when, "some warning"; __END__ [2007-12-23 20:51:11] some warning at - line 2. $ perl5.10.0 -w use feature ":5.10"; sub when { use POSIX "strftime"; strftime("[%Y-%m-%d %H:%M:%S] ", gmtime) } warn when, "some warning"; __END__ syntax error at - line 3, near "warn when" Execution of - aborted due to compilation errors.