Help for this page

Select Code to Download


  1. or download this
    # Example 1
    #
    ...
          } else {                                                # or
          print "No match in our string for our pattern.\n";      # As you
    +'ll see...
      }                                                           # end
    
  2. or download this
    while (<>) {
        if (/brus/) {
            print $_;
        }
    }
    
  3. or download this
    # Example 2
    #
    ...
          } else {
          print "No match in our string for our pattern.\n";      # As you
    +'ll see...
      }                                                           # end
    
  4. or download this
    # Example 3
    #
    ...
      if (/brus/) {   # Our pattern of brus
       print "There, brus showed up.\n" ;   # if pattern is found, print i
    +t!
      }                                                                   
    +                    # end
    
  5. or download this
    # example 4
    #
    ...
    if (s/bru*s/brus/) {                                     # fixing it
     print $_ ;                                              # proving we 
    +fixed it.
     }
    
  6. or download this
    # example 5
    #
    ...
    if (/a/) {
     print $_ ;
     }
    
  7. or download this
    # example 6
    #
    print "Hello" . ' ' . "world"; #Same as 'Hello world'
    
  8. or download this
    # example 7
    #
    ...
     print $_ ;
     }
    #
    
  9. or download this
    # example 8
    #
    ...
    if (/[q-zQ-Z]/) {
     print $_ ;
     }