pgmer6809 has asked for the wisdom of the Perl Monks concerning the following question:
The only format that seems to work in printf (for printing a character) is the %s one. what is wrong with this:
$ca = 'A'; print "$ca\n"; # outputs A printf "%s\n", $ca ; #outputs A printf "%c\n", $ca ; # outputs blank printf "%x\n", $ca ; #outputs 0 (zero) printf "%d\n", $ca ; #outputs 0 (zero)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: printf x format ?
by Fletch (Bishop) on Mar 02, 2022 at 05:51 UTC | |
Re: printf x format ?
by eyepopslikeamosquito (Archbishop) on Mar 02, 2022 at 11:47 UTC | |
by pgmer6809 (Sexton) on Mar 03, 2022 at 03:30 UTC | |
Re: printf x format ?
by ikegami (Patriarch) on Mar 03, 2022 at 07:19 UTC |
Back to
Seekers of Perl Wisdom