SPUG:for help

Liu, Zhu Liu.Zhu at mayo.edu
Wed Jan 29 22:19:57 CST 2003

Hi, everybody, I experienced a very stupid simple problem for three hours. I just want to extract three substrings from one string. In the beginning of the string there are two spaces  like

My part code is
if( $line =~ /^\s+\d+.*\d$/)
	($part, $part2, $part3) = /\s+(\d+)\s(.*)\s+(\d+)/;

it always tells me "Use of uninitialized value in pattern match (m//)", so if I use the following codes
if( $line =~ /^\s+\d+.*\d$/)
	($emptypart, $start, $part, $end) = split /\s+/, $line, 4;

This time I can get the items. 

So my question is why parentheses can't catch the substrings?

zhu liu

More information about the spug-list mailing list