$abc = 'i am going to split line1; and then line2; and then line3; and assign to variables'; my ($no1,$no2,$no3) = (split/\;/,$abc); print "$no1\n","$no2\n","$no3\n"; my ($d,$e) = (split /\;/,$abc)[0,2]; # or anything [1,2] print $d,"\n",$e;