#!/usr/bin/perl #get command portion of data use strict; my ($stripped,$cmd,$cmd_loc,$cmd_locend); $stripped = ".command parameter"; $cmd_loc=index($stripped,"."); $cmd_locend=index($stripped,chr(32)); $cmd=substr($stripped,$cmd_loc,$cmd_locend++); print $cmd."\n";