×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

Perl example - How do I read an entire file as a string?


Perl - How do I read an entire file as a string?

my $data;
 $file = "myfile.dat";
 {
    local $/;
    open SLURP, $file or die "can't open $file: $!";
    $data = <SLURP>;
    close SLURP or die "cannot close $file: $!";
 }

Category: Perl

 
<< Go back