{ local $/ = undef; open(FILE, "<file.txt") or die "open failed on file.txt: $!"; $wholetext = <FILE>; close(FILE); } if ( $wholetext =~ /CONNAME\((\d+?\.\d+?\.\d+?\.\d+?)\)\s+CURRENT/ ) { print $1; } __DATA__ CONNAME(163.231.99.129) CURRENT CHLTYPE(SVRCONN) STATUS(RUNNING) LSTMSGTI(03.45.47) LSTMSGDA(2003-11-21) __OUTPUT__ 163.231.99.129
In reply to Re: newline in unix
by ercparker
in thread newline in unix
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |