in reply to Reprinting Text With Changing Fields
#! /usr/bin/perl -w # Start using this, and warnings (above -w) :) use strict; my $node_number = [1,2,3,4,5]; # Your variable above is a reference to an array # Instead of while, use an iterator like foreach # Note: must dererence with @$ # Each time through the loop the current value is in $_ foreach (@$node_number) { print <<EOF; node = $_ ccu = 5 ccu2 = 9 tacaf = y enable = y sync = 8 EOF }
|
|---|