#!/usr/bin/perl -w use strict; my $sentence = 'A sentence is just a bunch of words'; # Do the magic. my @words = split /\s/, $sentence; # That was it! Now show the results. foreach my $word (@words) { print "$word\n"; }