RE: bold print to a FH



<DBSMITH@xxxxxxxxxxxxxx> asked:
> the code
>
> print MU color 'bold', "BLAH BLAH BLAH \n";
>
> is not working with error:
>
>
> Uncaught exception from user code:
> Invalid attribute name media at
> disk_cache-tape_slot-usage.pl line
> 45
> Carp::croak('Invalid attribute name media') called at
> /usr/perl5/5.6.1/lib/Term/ANSIColor.pm line 119
> Term::ANSIColor::color('bold', 'Media Usage Key for all ASM
> clients:', ' ', '17:35 05/26/05^J') called at

OTTOH the problem is your "lazy" syntax - Term::ANSIColor::color
seems to pick up arguments that should go to print(). You can fix
this by bracketing the argument to color, i.e.:

print MU color('bold'), "BLAH BLAH BLAH \n";

HTH,
Thomas


.



Relevant Pages

  • trying to use IO::Handle
    ... why does below fail? ... Uncaught exception from user code: ... I discovered(from Dprof) that it was using up too much CPUand wanted to use a IO module to get down to lower level to gain some ...
    (perl.beginners)
  • Re: abs_path($0) gags
    ... > Uncaught exception from user code: ... I was able to successfully reproduce your problem, ... always be a file, so "-d $0" will always fail, making the dirname() ...
    (comp.lang.perl.misc)
  • Re: CSV-Files splitten
    ... Fehler: ... Uncaught exception from user code: ...
    (de.comp.lang.perl.misc)
  • Re: NAPCO 1008 odd behavior
    ... but i know my user code. ... I was checking to make sure the dealer ... Bob La Londe ... Prev by Date: ...
    (alt.security.alarms)
  • Re: Question about import user defined modules.
    ... $ perl home.cgi ... Uncaught exception from user code: ...
    (comp.lang.perl.misc)