Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^5: text matching

by Cristoforo (Curate)
on Jun 17, 2012 at 01:13 UTC ( #976612=note: print w/replies, xml ) Need Help??

in reply to Re^4: text matching
in thread text matching

Here is the program using a different approach with the range operator.
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { if ((my $first = /^\s*#if/) .. (my $last = /^\s*#endif/)) { #print if $first || $last; print unless /^\s*reports?/; } else { print; } }

Its a neat use of the range, ( .. ), operator.


Update: changed the first print line to more accurately perform what you needed.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976612]
[hippo]: :-D
[Eily]: you mean a dll where the SW was written in perl? That sounds unlikely
[muthusathish]: please help me regarding this
[hippo]: Easier just to go and look at the source, no?
[Eily]: mostly because perl isn't compiled in the usual sense of the meaning, you can't execute the opcodes directly, you need the perl engine
[muthusathish]: i dont have the environment too, but i need to get the logics so that i can re-wite
[Eily]: what makes you think your dll is "perl based" ?
[muthusathish]: i dont have source code too
[muthusathish]: it is used in VB 6 appln, while debugging is getting error
[hippo]: Somebody has. Ask the author.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2018-02-23 09:14 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (301 votes). Check out past polls.