I have a task to distinguish kanji and hiragana if a file has both content. This is the content of the file: The first line is hiragana and the second line is kanji, which I have to do nothing. But the last line contains both, I will just print it out. ひゅうが 通行 乗じて

Asides from the fact that this is not a *function*, do you have reason to believe, that your Perl version does not recognize \p, or merely that it doesn't recognize the named Block (i.e. InHiragana)? In that case, please let us know which Perl version you are using.

Did you try to use script names instead of block names (i.e. \p{Hiragana} instead of \p{InHiragana})? This seems to make more sense in your application anyway.