I'm having a trouble getting a table to print out correctly. Only the first line looks right, $hostname. After that, it just prints exactly as shown without interpolating the variables and actually prints the single quotes and commas I put around the words before it. Why is it only printing the first line? I've tried different combinations but nothing seems to work.
Thanks,
Chris
Code:
#!/usr/bin/perl -w
$hostname = 'tux.foo.org';
$os = 'RHEL30';
$date = '7/27/04';
$ip = '192.168.0.2';
$mask = '255.255.255.0';
$gw = '192.168.0.1';
$dns = '192.168.0.10, 192.168.0.20';
$mac = '00:0D:56:C7:59:71';
$cpu = 'Intel(R) Celeron(R) CPU 2.20GHz';
$ram_mb = '256Mb';
format STDOUT_TOP =
$hostname info
------------------------------------------------------------------
.
format STDOUT =
@<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<
'Hostname:', $hostname
'OS Version:', $os
'Date:', $date
'IP Address:', $ip
'Subnet Mask:', $mask
'Gateway:', $gw
'DNS Servers:', $dns
'MAC_Address:', $mac
'CPU:', $cpu
'Memory:', $ram_mb
.
write;
Chris