I use the tool that was published in the Science article, but it causes me a lot of problems because I am not familiar with Perl.
The code contains:
return $equa if /\@BOUNDARY/;
I believe that code should return $equaif it contains text @BOUNDARY, but it does not. Does the provided code have an error?
I am going to change it to:
if ($equa =~ /\@BOUNDARY/) {
return $equa;
}
Does this perform the same function?
For reference, the entire function in the source code:
sub correctBoundaryReac {
my $equa = shift;
print $equa;
return $equa if /\@BOUNDARY/;
my( $left, $arrow, $right ) = ( '', '', '' );
if( $equa =~ /^(<--|<==>|-->) (.+)/ ){
$arrow = $1;
$right = $2;
$left = $right;
$left =~ s/\@\S+/\@BOUNDARY/g;
}
elsif( $equa =~ /(.+) (<--|<==>|-->)$/ ){
$left = $1;
$arrow = $2;
$right = $left;
$right =~ s/\@\S+/\@BOUNDARY/g;
}
else{
die "Don't know how to fix bounadry reaction: $equa\n";
}
return "$left $arrow $right";
}
source
share