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 (Monk)
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
Domain Nodelet?
Node Status?
node history
Node Type: perltutorial [id://962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2023-11-28 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?