home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!sybus.sybus.com!myrddin!tct!chip
- From: chip@tct.com (Chip Salzenberg)
- Subject: Re: Feature request for perl V
- Message-ID: <2B3101AC.34FE@tct.com>
- Date: Thu, 17 Dec 1992 22:39:40 GMT
- References: <62887@mimsy.umd.edu> <MERLYN.92Dec16172442@romulus.reed.edu>
- Organization: TC Telemanagement, Clearwater, FL
- Lines: 19
-
- According to merlyn@ora.com (Randal L. Schwartz):
- >@line_numbers = grep($lines[$_] =~ /IN A/, $[ .. $#lines);
-
- Wow.
-
- Or if creation of the $[..$#lines array is a problem, perhaps:
-
- @line_numbers = ();
- $i = $[;
- for (@lines) {
- push(@line_numbers, $i) if /IN A/;
- ++$i;
- }
-
- --
- Chip Salzenberg at Teltronics/TCT <chip@tct.com>, <73717.366@compuserve.com>
- "you make me want to break the laws of time and space / you make me
- want to eat pork / you make me want to staple bagles to my face /
- and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
-