hnd has asked for the wisdom of the Perl Monks concerning the following question:

am new (not so new) to perl and am bit confused in m// operator Q1.if we use ? as the delimiter then what does that signify? Q2.we use the . operator with /s to match new lines, can you give me an example?????? can we manupilate the tcp packets i.e. how can we change the values of various falgs in the tcp packet

Replies are listed 'Best First'.
Re: pattern matching
by moritz (Cardinal) on Jun 14, 2009 at 11:27 UTC
    The answer to your first question can be found in perlop in the section Regexp Quote-Like Operators

    If you use the /s modifier, then . matches any character, including newlines. So for example:

    "a\nb" =~ m/a.*b/; # no match "a\nb" =~ m/a.*b/s; # matches

    For handling TCP packets I'd rather use an existing module from CPAN.

Re: pattern matching
by irah (Pilgrim) on Jun 15, 2009 at 04:55 UTC

    For handling TCP packets, you can look on, NetPacket::TCP module. Also look on Net::Packet::TCP module.