Why not just use the numeric value in the string:
$ perl -demo DB<1> $A = "123" DB<2> if ( $A < 0 ) { print 'negative' }else {print 'non-negative'} non-negative DB<3> $A = "-123" DB<4> if ( $A < 0 ) { print 'negative' }else {print 'non-negative'} negative
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re^2: Why do i get an extra (duplicate) array element?-
by TomDLux
in thread Why do i get an extra (duplicate) array element?-
by rickman1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |