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

Of course the $ isn't there - I said in the very first post that this is cat -vue's output :)

cat -vue shows you all characters, including special characters (like the end of line $) - I thought it might be useful to see for regex crafting

Replies are listed 'Best First'.
Re^7: Multi-line regex help needed
by Limbic~Region (Chancellor) on Jun 18, 2009 at 17:36 UTC
    vxp,
    Of course the $ isn't there - I said in the very first post that this is cat -vue's output

    Well, I have two things to say to that. First, you get what you ask for if you make assumptions about the knowledge of the people helping you. Second, the first time I mentioned $ not really being there should have been an indication to you that I didn't know what I was talking about. In any event, here is a working proof of concept since you have had to suffer through my ignorance.

    #!/usr/bin/perl use strict; use warnings; my $file = $ARGV[0] || 'foo.txt'; open(my $fh, '<', $file) or die "Unable to open '$file' for reading: $ +!"; my $buffer = ''; while (<$fh>) { if (/^\S+domain\.com$/) { process_buffer($buffer); $buffer = $_; next; } $buffer .= $_; } sub process_buffer { my ($section) = @_; print "================BLAH================\n$section\n"; }

    Cheers - L~R

      I highly appreciate the help, thanks a lot! I apologize for making assumptions, I'll be clearer (is that a word?) next time :)