#!/usr/bin/perl -wl use strict; my $char = '~'; print ord $char; printf "%08b\n", ord $char; __END__ Prints: 126 01111110