Help for this page

Select Code to Download


  1. or download this
      if (/^\S+/) {
        print "$&\n";
      }
    
  2. or download this
      if (/^(\S+)\s+/) {
        print "$1\n";
      }
    
  3. or download this
    xcommand | perl -nae 'print $F[0],"\n"'
    
  4. or download this
      my $command="xcommand";
      open(CMD, "$command |") or die "Error: $!\n";
    ...
        print (split(" "))[0]."\n"; # or whatever else
      }
      close(CMD);