in reply to Re^2: Multi-line regex help needed
in thread Multi-line regex help needed

now I tried changing $/ to "domain.com" and it's a little closer. Actually _almost_ there:

#!/usr/bin/perl $file = shift; open(LOG, $file) or die "Couldn't open $file: $!\n"; local $/ = "cisco.com\n"; while (<LOG>) { print "================BLAH================\n$_\n"; } close(LOG);

Resulting output:

abc1-wl-wlc1.domain.com ================BLAH================ Successful downloads: 0 Failed downloads: 1 Warnings: 0 Detailed Log Info General Expect Errors: 1 Text Dump Failure: 1 Binary Transfer Successful: 1 Attempts to get Text Dump: 1 Attempts to use TFTP: 1 Attempted binary transfers: 1 Textual log of the file transfer: Processing abc1-wl-wlc1.domain.com Performing [/usr/bin/ssh -2 -a -o " +StrictHostKeyChecking no" abc1-wl-wlc1.domain.com] Exception: 3:Child + PID 20854 exited with status 256 at /usr/SD/perl-5.6.1/lib/site_perl /EMAN/Config/DeviceConfig/WLC.pm line 288, line 62. ExpectLog: Sorry, +telnet is not allowed on this port!Connection to abc1-wl-wlc1.domain. +com closed. Performing TFTP using SNMP: DestHost [x.x.x.x] Com munity [private] agentTransferUploadServerIP [x.x.x.x] agentTransferUp +loadFilename [x.x.x.x.UCFM.18433] Exception: 3:Child PID 20854 exited + with status 256 at /usr/SD/perl-5.6.1/lib/site_perl/ EMAN/Config/DeviceConfig/WLC.pm line 288, line 62. Updating CVS abc1-wl-wlc2.domain.com ================BLAH================ Successful downloads: 0 Failed downloads: 1 Warnings: 0 Detailed Log Info General Expect Errors: 1 Text Dump Failure: 1 Binary Transfer Successful: 1 Attempts to get Text Dump: 1 Attempts to use TFTP: 1 Attempted binary transfers: 1 Textual log of the file transfer: Processing abc1-wl-wlc2.cisco.com Performing [/usr/bin/ssh -2 -a -o "S +trictHostKeyChecking no" abc1-wl-wlc2.domain.com] Exception: 3:Child +PID 20855 exited with status 256 at /usr/SD/perl-5.6.1/lib/site_perl /EMAN/Config/DeviceConfig/WLC.pm line 288, line 58. ExpectLog: Sorry, +telnet is not allowed on this port!Connection to abc1-wl-wlc2.domain. +com closed. Performing TFTP using SNMP: DestHost [x.x.x.x] Com munity [tasMANia] agentTransferUploadServerIP [x.x.x.x] agentTransferU +ploadFilename [x.x.x.x.UCFM.18441] Exception: 3:Child PID 20855 exite +d with status 256 at /usr/SD/perl-5.6.1/lib/site_perl/ EMAN/Config/DeviceConfig/WLC.pm line 288, line 58. Updating CVS
The correct hostname needs to be in between the blah's - right now BLAH comes right after the correct hostname for the section :/