Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-05-28 15:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?