Help for this page

Select Code to Download


  1. or download this
    open (my $fh, '<text.txt');
    
    ...
      /^([^ ]+) ([^ ]+)/;
      print "$1 $2" . "\n" if $1 && $2;
    }
    
  2. or download this
    hello one two three
    kjsf
    kjsd
    kjd
    
  3. or download this
    hello one
    hello one
    hello one
    hello one
    
  4. or download this
    while (my $line = <$fh>) {
      $line =~ /^([^ ]+) ([^ ]+)/;
      print "$1 $2" . "\n" if $1 && $2;
    }
    
  5. or download this
    hello one