Help for this page

Select Code to Download


  1. or download this
    $file = <FILE>;
    
  2. or download this
    local $/ = undef;  
    $file = <FILE>;
    
  3. or download this
    $file = join("", <FILE>);
    
  4. or download this
    foreach $this_paragraph (@paras) { 
      ....
    }
    
  5. or download this
    foreach my $this_paragraph (@paras) {
      my @split_para = split(/:/, $this_paragraph);
    ...
        print $this_paragraph;
      }
    }
    
  6. or download this
    foreach my $this_paragraph (@paras) {
      if( $this_paragraph =~ /^$KWD:/s ) { 
    ...
        # This works if the paragraph looks like 'KEYWORD: ...'
      }
    }
    
  7. or download this
    foreach my $this_paragraph (@paras) {
      if( $this_paragraph =~ /:$KWD\b/s ) { 
    ...
        # This works if the paragraph looks like '.... :KEYWORD ...'
      }
    }