On Thu, 2003-11-13 at 18:15, Nandita Mullapudi wrote: > This has to be really easy- but I cant get it to work: > I want my script to carry out a loop only if the number stored in > $diff is positive, > so i say > if ($diff =~m/^[-\d+]/) {blah blah} > but it won't work. why? > TIA > -Nandita
Try this: if ( $diff == abs($diff) ) { print "positive"; } Kevin -- Kevin Old <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]