#!/usr/local/bin/perl -w #Example 2 $phrase = "Do not go gently into that dark night\nRage, Rage\nAgainst the dying of the light"; #@firsts = $phrase =~ /^(\w+)/g; @firsts = $phrase =~ /^(\w+)/gm; print "@firsts\n"; #@lasts = $phrase =~ /(\w+)$/g; @lasts = $phrase =~ /(\w+)$/gm; print "@lasts\n";