in reply to replace all numerics to words in a txt file

In addition to choroba's comments, I would say that this code line:
if(isdigit (\w)
has several syntax mistakes. First, there is no closing parenthesis for the if conditional. Then, there is no opening curly brace for the code to execute if the conditional returns a true value. And finally, the (\w) argument doesn't make much sense outside of a regex.

But you probably don't need this conditional anyway, since your substitution on the next line can be modified to match only numbers, with something like this (untested):

s/(\d+)/num2en($1)/ge;

Replies are listed 'Best First'.
Re^2: replace all numerics to words in a txt file
by anonymized user 468275 (Curate) on Sep 22, 2017 at 09:41 UTC
    Indeed! And at first sight I was surprised not to see the usual unmatched bracket message, though most likely it is giving up further checking before the match brackets check when finding \w to be a bareword.

    One world, one people