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 :/

In reply to Re^3: Multi-line regex help needed by vxp
in thread Multi-line regex help needed by vxp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.