use strict; my $PLATFORM = 'solaris'; foreach($PLATFORM) { (/solaris/ || /tru64/ || /linux/ || /aix/) and do { my $i=1; print "\$PLATFORM is '$PLATFORM'\n"; open (PSTEST, $0); while (){ print "Line # ".$i."\n".$_; print "Platform now is '$PLATFORM'\n"; $i++; }; print "All done!\n"; close PSTEST; print "Platform now is '$PLATFORM'\n"; }; }; #### use strict; my $PLATFORM = 'solaris'; #foreach($PLATFORM) { $_ = $PLATFORM; (/solaris/ || /tru64/ || /linux/ || /aix/) and do { my $i=1; print "\$PLATFORM is '$PLATFORM'\n"; open (PSTEST, $0); while (){ print "Line # ".$i."\n".$_; print "Platform now is '$PLATFORM'\n"; $i++; }; print "All done!\n"; close PSTEST; print "Platform now is '$PLATFORM'\n"; }; #};