in reply to readline and multi-word commands
The problem I am having is that 'foo bar' is has a space in it so I can't split the scalar returned from readline() by spaces.So don't. Learn about the m// operator, read `perldoc perlop' and `perldoc perlre'.
if( $line =~ /^ ( \w+ ) # word \s+ ( .+? ) \s+ ( \w+ ) $/ ) { my( $command, $something, $lastword ) = ( $1, $2 , $3 ); }
|
|---|