in reply to "require" bug?
When I run your above example, Perl tells me various things that are wrong with it:
> perl -w 1.pl Unquoted string "colored" may clash with future reserved word at tmp.p +l line 2. Name "main::colored" used only once: possible typo at tmp.pl line 2. print() on unopened filehandle colored at tmp.pl line 2.
The use Term::ANSIColor; statement happens too late for colored to be interpreted as a function. If you use (for example) parentheses, your intention is clear to Perl:
print colored(['red'], "test");
|
|---|