Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

String matching and Regular Expressions

by root (Scribe)
on Nov 10, 1999 at 03:50 UTC ( #962=perltutorial: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while(<>){
       if(/the/){    #does $_ contain the
          print "Your line of text contains the word 'the'\n";
       }
    }
    
  2. or download this
    @machines_os=("OpenBSD","Windows","Linux", "Windows");
    foreach(@machines_os){
       s/Windows/Linux/;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://962]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-12-03 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (60 votes). Check out past polls.