theroninwins has asked for the wisdom of the Perl Monks concerning the following question:
open(OUT, "serlist.txt"); open(OUT2, "desclist.txt"); open(OUT3, "namefile.txt"); my @outlist; while (<OUT>) { my %hash; my @temp = split(/;/,$_); $hash{'file1'} = $temp[0]; $hash{'file2'} = <OUT2>; $hash{'file3'} = <OUT3>; #delete Return foreach (values %hash) { $_ =~ s/\n//gi; } push(@outlist,\%hash); print @outlist; } close(OUT);
148.192.59.254;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.59.254;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst + c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfa +ce Converter) slots} 148.192.166.249;STP-K91-CW-2-5-5.bc.de.bic;FOC0701Z22M;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports} 148.192.59.254;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.59.254;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.166.249;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst + c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfa +ce Converter) slots} 148.192.166.249;STP-K91-CW-2-5-5.bc.de.bic;FOC0701Z22M;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports} 148.192.88.253;lwl-h81-cw-u-1-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.88.253;stp-k41-cw-e-2-1.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interface + Converter) slots} 148.192.88.253;stp-h104-cw-2-1-2.bc.de.bic;FOC0749Z2ZW;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports and 2 GBIC (Gigabit Interfac +e Converter) slots} 148.192.88.253;STP-K91-CW-2-5-5.bc.de.bic;FOC0701Z22M;Cisco Catalyst c +2950 switch with 24 10/100 BaseTX ports} 148.192.88.253;stp-g101-cw-1-1-1.bc.de.bic;FOC0643W0DP;Cisco Catalyst +c2950 switch with 24 10/100 BaseTX ports}
Edit by castaway, readmore tags added.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash is appending old and new data
by rupesh (Hermit) on Sep 03, 2004 at 09:36 UTC | |
|
Re: Hash is appending old and new data
by Eimi Metamorphoumai (Deacon) on Sep 03, 2004 at 13:27 UTC |