in reply to Re: Ascii Table
in thread Ascii Table

Hmm. I'm getting an invalid conversion on the %b...

Replies are listed 'Best First'.
Re: Re: Re: Ascii Table
by chipmunk (Parson) on Dec 06, 2000 at 01:02 UTC
    The %b conversion for printf wasn't added until perl5.6.0. For earlier versions, you can convert decimal to binary with pack and unpack:
    $binary = unpack 'B*', pack 'N', $decimal; $binary =~ s/^0+//;
Re: Re: Re: Ascii Table
by t0mas (Priest) on Dec 06, 2000 at 00:55 UTC
    Strange...
    Can you do any %b conversions at all?
    Like perl -e "printf('%b",20');" ?

    /brother t0mas