use strict; use warnings; my $string = 'hello world'; print substr($string,'0',5)."\n";