Friday, January 8, 2010

Perl ternary operator

I was trying to use an if else stmt in perl inside a join. And it was throwing compilation errors. In this case you can use a ternary operator to serve as if else :

ex :

($Bond{$_}{CFAC} ==-1 ?”N/A” : $Bond{$_}{CFAC})

No comments: