- or download this
my $string = "Here is our test string.";
my $word;
( $word, $string ) = split /^(\w+)\b/, $string, 2;
- or download this
$string = $word . $string;
- or download this
my $string = "This is the test string.";
my $word;
( $word, $string ) = $string =~ m/^(\w+)\b(.*)/;
- or download this
my $string = "Here is our test string.";
my $word = $string =~ s/^(\w+)\b(.*)/$2/;
- or download this
$string = $word . $string;