cadencep45
MIS
I want to use a scalar, ie a string contents as an operator, but am unsure how to define it. Best explained by example.
$examplecomparison = "> 0.5";
$comparision = 0.3
what I want to say is;
if ( $comparision > 0.5 )
{ print "exception created \n"; };
but I have a large number of operators and thresholds, so I want to store these in an array, that I can simply reference the comparision, something like;
if ( $comparision $examplecomparision )
{ print "exception created \n"; };
now this does not work, as I want the actual string contents to be used here.
Any idea on how to implement ?
Ta.
$examplecomparison = "> 0.5";
$comparision = 0.3
what I want to say is;
if ( $comparision > 0.5 )
{ print "exception created \n"; };
but I have a large number of operators and thresholds, so I want to store these in an array, that I can simply reference the comparision, something like;
if ( $comparision $examplecomparision )
{ print "exception created \n"; };
now this does not work, as I want the actual string contents to be used here.
Any idea on how to implement ?
Ta.