#!/usr/bin/perl -w use strict; my $chars = {}; for (my $i=33; $i<=127; $i++) { my $oct = sprintf("\\%o", $i); $chars->{chr($i)} = $oct; } foreach my $word (@ARGV) { my(@str) = split(//,$word); foreach my $letter (@str) { print $chars->{$letter}; } print " "; } # ./obus.pl just another Perl hacker, # returns # \152\165\163\164 \141\156\157\164\150\145\162 \120\145\162\154 \150\141\143\153\145\162\54 # \40 gives character 32, the space.