in reply to Re: Multi-line regex help needed
in thread Multi-line regex help needed
Thanks, tried that by doing the following:
#!/usr/bin/perl $file = shift; open(LOG, $file) or die "Couldn't open $file: $!\n"; local $/ = ""; while (<LOG>) { print "================BLAH================\n$_\n"; } close(LOG);
it didn't quite do what's expected though. $_ doesn't have exactly one section in it. here's what's in it:
================BLAH================ abc1-wl-wlc1.domain.com ================BLAH================ Successful downloads: 0 Failed downloads: 1 Warnings: 0 ================BLAH================ Detailed Log Info ================BLAH================ 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 ================BLAH================ 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 ================BLAH================ abc1-wl-wlc2.domain.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Multi-line regex help needed
by Limbic~Region (Chancellor) on Jun 18, 2009 at 16:15 UTC | |
by vxp (Pilgrim) on Jun 18, 2009 at 17:10 UTC | |
by Limbic~Region (Chancellor) on Jun 18, 2009 at 17:21 UTC | |
by vxp (Pilgrim) on Jun 18, 2009 at 17:32 UTC | |
by Limbic~Region (Chancellor) on Jun 18, 2009 at 17:36 UTC | |
| |
|
Re^3: Multi-line regex help needed
by vxp (Pilgrim) on Jun 18, 2009 at 15:53 UTC |