in reply to substitution (s///)
I think what you want is probably stomething like:
if ($line =~ /^%(.{1,100})$/){ $name = $1; $name =~ s/\s//g; #this is the variable I think you want to r +emove spaces from. print "EEEEEEEEEEEEEEEEEEEEEEEEEEEE: $name\n"; } $outfile = "outfile['$name'].txt"; open (OUTFILE, "+>>$outfile");
On a side note unless the spaces will be in the center of the variable $name you might just want to anchor the search to the beginning (using ^)and the end (using $) as it is faster.
-enlil
|
|---|