Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Devel mailing list

Subject: [MTT devel] use of &perl()
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-07-06 10:25:51


I was just trying to use &perl() in an ini file and ran across an
annoying restriction: I had to make the whole thing be one long line:

max_test_num = <<EOF
&perl('open(IN, "./mpi_test_suite -l|") || die("cant open"); while
(<IN>) { if (m/Num Tests : (\d+)/) { close(IN); return $1; } }
close(IN); return "0"; ')
EOF

Without that, the MTT parser would complain that it couldn't find the
closing ' quote (i.e., "&perl(' ... ')"). I tracked it down and
it's because if I did this:

max_test_num = <<EOF
&perl('
open(IN, "./mpi_test_suite -l|") || die("cant open");
while (<IN>) {
     if (m/Num Tests : (\d+)/) { close(IN); return $1; }
}
close(IN);
return "0";
')
EOF

then the parser stops looking for the closing quote on the "&perl('"
line -- it doesn't go beyond the \n. Yuck.

Any suggestions?

-- 
Jeff Squyres
Cisco Systems