Evaluate an operator given as a string

2008-07-30 Thread Amit Koren
Hi all. I'm trying to pass the operators ">=" or "<=" to a subroutine, and then use it inside an "if" statement. What changes should i apply to the code below to make it work ? my_evaluate ( ">="); sub my_evaluate { my ($sign) = @_; my $x = 10; my $y = 20; if ($x $sign $y) { # want

Arithmetic operation inside substitution

2008-07-20 Thread Amit Koren
d with the same result. Any suggestions ? Thanks, Amit Koren.

Re: A newbie question - line number inside the script

2008-07-17 Thread Amit Koren
AIL PROTECTED]> wrote: > > > On Wed, Jul 16, 2008 at 3:52 PM, Amit Koren <[EMAIL PROTECTED]> > wrote: > >> Hi list. >> >> I'm a newbie to Perl, (and to this mailing list) :) >> There's a task i was given, in which it is necessary to get the

A newbie question - line number inside the script

2008-07-16 Thread Amit Koren
Hi list. I'm a newbie to Perl, (and to this mailing list) :) There's a task i was given, in which it is necessary to get the number of the current executing line/command - inside the script itself. Can someone assist please ? Thanks in advance, Amit.