Help for this page

Select Code to Download


  1. or download this
    my $buf; my $nread;
    open(my $filehandle, '<', 'f.tmp') or die "error open: $!";
    while ($nread = sysread($filehandle, $buf, 1024)) {
        print "nread=$nread buf='$buf'\n";
    }
    
  2. or download this
    use strict;
    my $buf; my $nread;
    ...
        print $fhout $buf;
    }
    close($filehandle); close($fhout);
    
  3. or download this
    sysread($filehandle, $buf, 1)
    
  4. or download this
    sysread($filehandle, $buf, 1024)