Help for this page

Select Code to Download


  1. or download this
    chomp(my $hostname = `/bin/hostname`);
    # Note that the chomp is necessary to remove the trailing newline
    
  2. or download this
    my $cmd = '/bin/hostname';
    open (IN, "$cmd|");
    chomp(my $hostname = <IN>);