# assume that input from readline is stored in $_ my ( $command, @topic ) = split; my $filename = pop @topic; my $topic = join ' ', @topic;