Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Perl regular expr tsp

895 views

Published on

  • Be the first to comment

  • Be the first to like this

Perl regular expr tsp

  1. 1. Perl<br />
  2. 2. Perl Regular Expressions<br />
  3. 3. Perl Regular Expressions<br />
  4. 4. Perl Regular Expressions<br />
  5. 5. Perl Regular Expressions<br />
  6. 6. Perl Regular Expressions<br />
  7. 7. Perl Regular Expressions<br />
  8. 8. Perl Regular Expressions<br />Pattern Matching Modifiers<br />/g – match all occurrences<br />/i– Do case-insensitive pattern matching<br />/m – Treat string as multiple lines.<br />/o – compile pattern only once<br />/s - Treat string as single line<br />Let . Match a new line<br />/x –Use extended regular expressions<br />Ignore most white space and permits comments in pattern<br />Mostly used in the above is /g and /i only<br />
  9. 9. Perl Files<br />Open a file <br /> Open (DATA, “<numbers.dat”); <br />Close a file<br /> Close DATA<br />Print to a file <br /> Print DATA “Hello Welcome”;<br />Here DATA is the file handle, <br />< - indicates File Read<br />> - indicates File Write and >> indicates file Append<br />

×