perl script print the lines between two pattern

i have a file as below

sample.pl

parameter1
argument1
argument2
parameter2

I want out as below

argument1
argument2

that is , i want to print all the lines between parameter1 & parameter 2.

i tried with the following

if($mystring =~ m/parameter1(.*?)parameter2/)

I want the output should be written in another file.

Hi,

use $1 to print the lines in between two patterns.

print $1;

Cheers,
Ranga:)

Could this help you ?

perl -ne 'if(/parameter1/../parameter2/){print if !/parameter/}' filename