#!/usr/bin/perl use strict ; ######################################################## ######## START MAIN #################### my @STAGE=( '/stage/core/HPUX/PA-RISC-64/64bit/rdbms/10.2.0.1.0/dvd2/clusterware', '/stage/core/HPUX/PA-RISC-64/64bit/rdbms/patches/10.2.0.4.0/Disk1' ) ; my $i ; my $j ; for ($i=0; $i<=5; $i++){ my $o_vers ; $j = $i - int($i/2)*2 ; $o_vers = $1 if $STAGE[$j] =~ ?/rdbms/([\d.]+)/? ; $o_vers = $1 if $STAGE[$j] =~ ?/rdbms/patches/([\d.]+)/? ; print "Iteration# $i: Version is: $o_vers\n" ; }