while (<STDIN>) { s/\r|\n//gs; if ( /Host Name.*?:\s*(.*)$/ ) { $hostname = $1; print "$hostname\n"; } if ( /DNS Servers.*?:\s*(.*)$/ ) { $dnsservers = $1; print "$dnsservers\n"; } if ( /Node Type.*?:\s*(.*)$/ ) { $nodetype = $1; print "$nodetype\n"; } }
In reply to Re: Re: reading lines
by spill
in thread reading lines
by spill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |