#!/usr/bin/perl -w $string = "testing 1 2 3"; print "before chop \$string is ==>$string<==\n"; $character = chop $string; print "after chop \$string is ==>$string<==\n"; print "\$character is ==>$character<==\n"; $newstring = sprintf "%d--%d", 5, 8; print "after sprintf \$newstring is $newstring\n";