Jose Malacara wrote:
> 
> Hello. I have a python script that I would like to convert to perl. In it
> I am parsing a data file looking for occurences of three consecutive lines:
> 
> series1 = """
>     slot-1         UP    UP     t3-card
>     slot-2         UP    UP     madd2-card
>     slot-3         UP    UP     madd2-card"""
> 
> or
> 
> series2 = """
>     slot-1         UP    UP     t3-card
>     slot-2         UP    UP     madd-card
>     slot-3         UP    UP     madd2-card"""
> 
> or
> 
> series3 = """
>     slot-1         UP    UP     t3-card
>     slot-2         UP    UP     madd2-card
>     slot-3         UP    UP     madd-card"""
> 
> If an occurce is found, then a counter is incremented for that specific
> series. My question is does Perl have some way to match against mutliple
> lines, or a block of text, like this or will I have to create a loop and
> match each line individually?

Yes, perl can match mutliple lines or blocks of text.  In what context
is the block of text found in the data?  What does the python code that
you are trying to replace look like?



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to