Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
open (FILE,"file"); @file=<FILE>; close(FILE); for ($i=0; $i<=$#file; $i++) { # Here I'm trying to catch the comments and ignore them if ($file[$i]=~/\/\*/) { # If comment is found ... while ($file[$i]!~/\*\//) { $i++; } # Check lines till finding end o +f comment next; } ... processing data ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching C-Style comments
by mirod (Canon) on Jun 19, 2001 at 19:46 UTC | |
|
Re: Matching C-Style comments
by Brovnik (Hermit) on Jun 19, 2001 at 19:39 UTC | |
|
(tye)Re: Matching C-Style comments
by tye (Sage) on Jun 20, 2001 at 02:21 UTC | |
|
Re: Matching C-Style comments
by stefan k (Curate) on Jun 19, 2001 at 19:42 UTC | |
by Abigail (Deacon) on Jun 20, 2001 at 02:44 UTC | |
|
Re: Matching C-Style comments
by scain (Curate) on Jun 19, 2001 at 19:42 UTC |