Howdy, Always use strict; Then your variables won't get messy, see the perldoc strict for more details.
> foreach $site (@dataFile) { # loop for each line/site in dataFile > chomp $site; You might make your life easier to by not declaring a variable at all here: for(@datafile) { chomp; ... Then you just use $_ where you would have used $site and you're all set. (Except with functions that are expecting $_ if nothing else is specified, like chomp for instance.) But yes to declare a variable with use strcit you need to do my before and that will elt you use it within the block you declared it in. HTH DMuey > > > ($siteLink,$siteNoOfPVCs,$siteAllPVCs)=split(/:/,$site,3); > #split up main / pvc info > > ($siteIP,$siteString,$SiteName,$siteGroup,$siteCCTReff,$siteAC > Rate)=split(/,/,$siteLink,6); > #split up main info > (@sitePVCs)=split(/;/,$siteAllPVCs,$siteNoOfPVCs); > > my $siteARFfile = "$siteIP.arf"; > open(ARFfile, ">$siteARFfile") or die("can not open > '$siteARFfile': $!"); > > print ARFfile > ("############################################################ > ########## > \n# \n# Discover Rule for: > $siteIP \n# > \n############################################################ > ########## > \n\n"); # print header > > print ARFfile ("@standardRules\n"); #print standard bits > > print ARFfile ("name matches \".*-Cpu-.*\": {\n \tsetName > (\"$SiteName-RH-Cpu\") ;\n \tsetGroup (\"$siteGroup\") > ;\n \tsetAlias (\"RH-Cpu\") ;\n} \n\n" ); # print -Cpu- rule > > print ARFfile ("name matches \".*-RH\": { \n \tsetName > (\"$SiteName-RH\") ;\n \tsetGroup (\"$siteGroup\") ; \n \t > setAlias (\"RH\") ;\n} \n\n" ); # print -RH rule > > print ARFfile ("name matches \".*RH-Serial.*\": {\n \tsetName > (\"$SiteName-RH-WAN\$2\") ;\n \tsetGroup (\"$siteGr > oup\") ;\n \tsetAlias (\"$siteCCTReff\") ;\n \tsetSpeedIn > (\"$siteACRate\") ;\n \tsetSpeedOut (\"$siteACRate\") ;\n > \tsetD eviceSpeedIn (\"$siteACRate\") ;\n \tsetDeviceSpeedOut > (\"$siteACRate\") ;\n} \n\n"); # print RH-Serial rule > > > print ARFfile ("name matches \".*-Serial.*\": {\n \tsetName > (\"$SiteName-WAN\$2\") ;\n \tsetGroup (\"$siteGroup\" > ) ;\n \tsetAlias (\"$siteCCTReff\") ;\n \tsetSpeedIn > (\"$siteACRate\") ;\n \tsetSpeedOut (\"$siteACRate\") ;\n > \tsetDevice SpeedIn (\"$siteACRate\") ;\n \tsetDeviceSpeedOut > (\"$siteACRate\") ;\n} \n\n"); # print -Serial rule > > for ($i = 0; $i < $siteNoOfPVCs ; $i++ ) { # loop for each PVC > > > ($PVCdlci,$PVCname,$PCVreff,$PVCcir)=split(/,/,"$sitePVCs[$i]",4); > # split out pvc info > > print ARFfile ("name matches > \".*-dlci-$PVCdlci\": {\n \tsetName (\"$SiteName-$PVCname\") > ;\n \tsetGroup > (\"$siteGroup\") ;\n \tsetAlias (\"$PCVreff\") ;\n \tsetSpeedIn > (\"$PVCcir\") ;\n \tsetSpeedOut (\"$PVCcir\") ;\n \tsetDev > iceSpeedIn (\"$PVCcir\") ;\n \tsetDeviceSpeedOut > (\"$PVCcir\") ;\n} \n\n"); # print PVC rules > > > } > > close(ARFfile) or die("can not close '$siteARFfile': $!"); } > > > > --- > fnord > yes im a Concord Engineer, no it never flown! > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]