Help for this page

Select Code to Download


  1. or download this
    use IO::Compress::Gzip qw(gzip $GzipError) 
    # other code...
    IO::Compress::Gzip::gzip(\$content, \$newContent) or die "gzip failed:
    + $GzipError\n"
    
  2. or download this
        my @transferFileContents = <FILE_TO_TRANSFER>;
        foreach(@transferFileContents)
        {
          $content .= $_;
        }
    
  3. or download this
    $content = do { local $/; my $rv = <FILE_TO_TRANSFER>; $rv };
    
  4. or download this
    $content = do { # minimize scope
        local $/; # make input separator undef 'till the end of this scope
        my $rv = <FILE_TO_TRANSFER>; # get all contents
        $rv # return it
    };