Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

pattern matching

by hnd (Scribe)
on Jun 14, 2009 at 11:08 UTC ( [id://771386]=perlquestion: print w/replies, xml ) Need Help??

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?????? Q3.how 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://771386]
Approved by linuxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found