>>>>> "PN" == Palit, Nilanjan <[EMAIL PROTECTED]> writes:

  PN> That works too (& I have used it as well), but I guess what I'm
  PN> really asking (hoping?) for is a Perl special variable, kinda like
  PN> "$.", which Perl auto-magically initializes & increments ...

in my experience classic loop indexes are rarely needed in perl. my take
is that coders who want an index value haven't done a proper design. if
you explain the larger problem i bet we could show you ways to bypass
your perceived need for a loop index.

also in your example you are pushing to @newarray[$i] which is not good
perl as it is an array slice with a single index. this will trigger a
warning if you enable warnings. if all you wanted to do was push some
values onto an new array, then map is your answer as someone else
showed. but anyhow we would like to see more info about the problem so
we can help solve it at the proper level.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to