perllib package

Module contents

perllib.Array(init=None)[source]

Array with autovivification

perllib.ArrayHash(init=None, isHash=None)[source]

Acts like an array or hash with autovivification

exception perllib.Die(*args, suppress_traceback=None)[source]

Bases: Exception

perllib.Dumper(*args)[source]

Implementation of Data::Dumper

perllib.FB_CROAK()[source]
perllib.FB_DEFAULT()[source]
perllib.FB_QUIET()[source]
perllib.FB_WARN()[source]
class perllib.File_stat(_dev: int, _ino: int, _mode: int, _nlink: int, _uid: int, _gid: int, _rdev: int, _size: int, _atime: int, _mtime: int, _ctime: int, _blksize: int, _blocks: int)[source]

Bases: Sequence

atime()[source]
blksize()[source]
blocks()[source]
cando(mode, eff)[source]
ctime()[source]
dev()[source]
get(index, default=None)[source]
gid()[source]
ino()[source]
mode()[source]
mtime()[source]
rdev()[source]
size()[source]
uid()[source]
perllib.Hash(init=None)[source]

Hash with autovivification

perllib.IOFile(path=None, mode=None, perms=None)[source]

Implementation of IO::File->new()

perllib.IOFile_from_fd(fd, mode)[source]

Implementation of IO::File::new_from_fd()

perllib.IOFile_open(fh, filename, mode=None, perms=None)[source]

Implementation of perl $fh->open method

perllib.IOFile_tmpfile()[source]

Implementation of IO::File->new_tmpfile

perllib.LEAVE_SRC()[source]
perllib.abspath(*args)[source]

Implementation of perl Cwd::abs_path function

perllib.add_element(base, index, value)[source]

Implementation of += on an array element

perllib.add_path(path_list)[source]

Add a path_list to the system path list

perllib.add_tie_call(func, package)[source]

Add a call to _tie_call for functions defined in a tie package

perllib.add_tie_methods(obj)[source]

Create a subclass for the object and add the methods to it to implement ‘tie’, like __getitem__ etc. The call to this functions is generated on any ‘return’ statement (or implicit return) in TIEHASH or TIEARRAY

perllib.and_element(base, index, value)[source]
perllib.assign_global(packname, varname, value)[source]

Assigns a value to a package global variable and returns the value

perllib.assign_hash(h, keys, values)[source]

Assign a hash with a list of hash keys and a list of values

perllib.assign_meta(packname, varname, value)[source]

Assigns a value in the metaclass of a package global variable and returns the value. Creates the metaclass if need be. This is use for tie $scalar

perllib.assign_sparse(lst, indexes, values)[source]

Assign a list with a sparse list of indexes and a list of values

perllib.autoflush(self, arg=1)[source]

Method added to FH to support OO perl

perllib.basename(path, *suffixes)[source]

Implementation of perl basename function

perllib.binmode(fh, mode='b', encoding=None, errors=None, newline=None)[source]

Handle binmode

perllib.binmode_dynamic(fh, mode)[source]

Handle binmode where the mode/layers are dynamic

perllib.bless(obj, classname, isa=())[source]

Create an object for obj in classname

perllib.blessed(r)[source]

blessed function in perl

perllib.caller(expr=None)[source]

Implementation of caller function in perl

perllib.caller_s(expr=None)[source]

Implementation of caller function in scalar context

perllib.can(self, methodname)[source]

Implementation of CLASS::can and $obj->can

perllib.carp(*args, skip=1)[source]

Warn with no backtrace

perllib.cgtime(secs=None)[source]

Replacement for perl built-in gmtime function in scalar context

perllib.chdir(d)[source]

Implementation of perl chdir

perllib.chmod(mode, *argv)[source]

Implementation of perl chmod function

perllib.chomp_element(base, index, value)[source]

Implementation of perl = and chomp on an array element

perllib.chomp_global(packname, varname, value)[source]

Assigns a value to a package global variable, does a chomp and returns the number of chars chopped

perllib.chomp_with_result(var)[source]

Implementation of chomp where the count of chars removed is needed. Returns a tuple of (result, count).

perllib.chop_element(base, index, value)[source]

Implementation of perl = and chop on an array element

perllib.chop_global(packname, varname, value)[source]

Assigns a value to a package global variable, does a chop and returns the value chopped

perllib.chop_with_result(var)[source]

Implementation of chop where the last char removed is needed. Returns a tuple of (result, last_c).

perllib.chop_without_result(var)[source]

Implementation of chop where the last char removed is not needed. Returns a tuple of (result, ‘’).

perllib.clone_encoding(encoding)[source]

Implementation of Encoding::clone_encoding

perllib.close_(fh)[source]

Implementation of perl close

perllib.closedir(DIR)[source]

Implementation of perl closedir

perllib.cluck(*args, skip=1)[source]

Warn with stack backtrace

perllib.cmp(a, b)[source]

3-way comparison like the cmp operator in perl

perllib.concat_element(base, index, value)[source]

Implementation of perl .= on an array element

perllib.confess(*args, skip=1)[source]

Error with stack backtrace

perllib.croak(*args, skip=1)[source]

Error with no backtrace

perllib.curdir()[source]

Implementation of File::Spec->curdir

perllib.decode(encoding, octets, check=None)[source]

Implementation of Encode::decode

perllib.decode_utf8(octets, check=None)[source]

Implementation of Encode::decode_utf8

perllib.define_alias(alias, name)[source]

Implementation of Encode::define_alias

perllib.define_encoding(obj, name, aliases)[source]

Implementation of Encode::define_encoding

perllib.die(*args, skip=None)[source]

Handle die in perl

perllib.dirname(fullname)[source]

Emulation of File::Basename qw(dirname) for unix

perllib.divide_element(base, index, value)[source]
perllib.dup(file, mode, checked=True, equals=False, encoding=None, errors=None)[source]

Replacement for perl built-in open function when the mode contains ‘&’. Keyword arg ‘checked’ means the result will be checked. Keyword arg ‘equals’ means that ‘&=’ was specified, so skip the os.dup operation.

perllib.each(h_a)[source]

See https://perldoc.perl.org/functions/each

perllib.encode(encoding, string, check=None)[source]

Implementation of Encode::encode

perllib.encode_utf8(string)[source]

Implementation of Encode::encode_utf8

perllib.encodings(get=None)[source]

Implementation of Encode::encodings

perllib.eof(fh)[source]
perllib.exc(e)[source]

Exception information like perl, e.g. message at issue_42.pl line 21.

perllib.exec_(lst)[source]

Implementation of perl exec with a list

perllib.execp(program, lst)[source]

Implementation of perl exec with a program and a list

perllib.exponentiate_element(base, index, value)[source]
perllib.extract_bracketed(text, delimiters='{}()[]<>', prefix_pattern='^\\s*')[source]

Implementation of Text::Bracketed::extract_bracketed in list context. Returns a list with (extracted_substring, updated_text, skipped_prefix)

perllib.extract_bracketed_s(text, delimiters='{}()[]<>', prefix_pattern='^\\s*')[source]

Implementation of Text::Bracketed::extract_bracketed in scalar context. Returns a tuple with (updated_text, extracted_substring)

perllib.fcntl(fh, func, scalar)[source]
perllib.fdopen(fh, fd, mode)[source]

Implementation of $fh->fdopen(fd, mode)

perllib.fetch_out_parameter(arg)[source]

Fetch the value of a sub out parameter from the location where _store_out_parameter saved it. This is called after the sub returns. arg is the argument index, starting at 0. Returns the value we saved.

perllib.fetch_out_parameters(var, start=0)[source]

Fetch the values of all sub out parameters from the location where _store_out_parameter saved them. This is called after the sub returns. var is the array or hash to store them in. start is the argument starting index, defaulting to 0. Returns the array or hash we saved.

perllib.fetch_perl_global(perlname)[source]

Fetch the value of a package global variable specified by it’s perl name

perllib.file_exists(path)[source]
perllib.file_size(path)[source]
perllib.fileinput_next(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None)[source]

Implementation of fileinput.input() where it can be called multiple times for the same <> operator

perllib.fileno(fh)[source]
perllib.fileparse(*args)[source]

Split a path into basename, dirpath, and (optional) suffixes. Translated from perl File::Basename for unix, plus annotations

perllib.filter_map(f, i)[source]

Given a function f that returns a tuple of (new_val, include) and an iterable i, return an iterable of new_vals where include is True

perllib.find_encoding(encoding)[source]

Implementation of Encode::find_encoding

perllib.find_mime_encoding(encoding)[source]

Implementation of Encode::find_mime_encoding

perllib.finditer_next(pattern, string, flags=0)[source]

Implementation of re.finditer() where it can be called multiple times for the same pattern and string

perllib.flatten(lst)[source]

Flatten a list down to 1 level

perllib.flock(fd, operation)[source]

Replacement for perl Fcntl flock function

perllib.flt(expr)[source]

Convert expr to a float number Ref: https://squareperl.com/en/how-perl-convert-string-to-number

perllib.format_(fmt, args=None)[source]

Like % formatter in python, but auto-converts the args to the proper types

perllib.format_write(fh)[source]

Implementation of perl format_write

perllib.from_to(octets, from_enc, to_enc, check=None)[source]

Implementation of Encode::from_to

perllib.get_access_age_days(path)[source]

Implementation of perl -A

perllib.get_creation_age_days(path)[source]

Implementation of perl -C

perllib.get_element(base, index)[source]

Safe element getter from a list, tuple, or Array - returns None if the element doesn’t exist

perllib.get_layers(fh)[source]

Implementation of PerlIO::get_layers

perllib.get_mod_age_days(path)[source]

Implementation of perl -M

perllib.get_subref(ref)[source]

Convert a sub reference to a callable sub. ‘ref’ may already be callable or it could be the name of the sub. Returns None if the sub isn’t callable

perllib.getc(fh)[source]

Implementation of perl getc

perllib.getpos(fh)[source]

Implementation of perl $fh->getpos

perllib.getsignal(signum)[source]

Handle references to %SIG not on the LHS of expression

perllib.gmtime(secs=None)[source]

Replacement for perl built-in gmtime function

perllib.handle_open_pragma(mode, encoding, errors, newline='\n')[source]

Handle any “use open” pragma that may be in effect

perllib.has_setgid(path)[source]
perllib.has_setuid(path)[source]
perllib.has_sticky(path)[source]
perllib.hires_alarm(floating_seconds, interval_floating_seconds=0)[source]

Implementation of Time::HiRes::alarm

perllib.hires_clock()[source]

Implementation of Time::HiRes::clock

perllib.hires_clock_getres(which)[source]

Implementation of Time::HiRes::clock_getres

perllib.hires_clock_gettime(which)[source]

Implementation of Time::HiRes::clock_gettime

perllib.hires_clock_nanosleep(which, nanoseconds, flags=0)[source]
perllib.hires_getitimer_s(which)[source]

Implementation of Time::HiRes::getitimer in scalar context

perllib.hires_gettimeofday()[source]

Implementation of Time::HiRes::gettimeofday in list context

perllib.hires_lstat(path)[source]

Implementation of Time::HiRes::lstat

perllib.hires_nanosleep(nanoseconds)[source]

Implementation of Time::HiRes::nanosleep

perllib.hires_setitimer_s(which, floating_seconds, interval_floating_seconds=0)[source]

Implementation of Time::HiRes::setitimer in scalar context

perllib.hires_stat(path)[source]

Implementation of Time::HiRes::stat

perllib.hires_tv_interval(t0, t1=None)[source]

Implementation of Time::HiRes::tv_interval

perllib.hires_ualarm(useconds, interval_useconds=0)[source]

Implementation of Time::HiRes::ualarm

perllib.hires_usleep(useconds)[source]

Implementation of Time::HiRes::usleep

perllib.hires_utime(atime, mtime, *args)[source]

Implementation of Time::HiRes::utime function

perllib.import_(globals, path, module=None, fromlist=None, version=None, is_do=False)[source]

Handle use/require statement from perl. ‘path’ is the relative or absolute path to the .py file of the module (the extension is ignored if specified). If ‘module’ is specified, then that is effectively added to the path, ‘fromlist’ is the list of desired functions to import. ‘version’ will perform a version check. ‘is_do’ handles a ‘do EXPR;’ statement.

perllib.init_global(packname, varname, value)[source]

Return the proper value to initialize a package global variable only once

perllib.init_out_parameters(arglist, *_args)[source]

Initialize sub’s out parameters. Pass the arglist of the sub and a list of the sub’s out parameters, counting from 0. If no list is passed, then all args are assumed to be out parameters

perllib.init_package(name, is_class=False, isa=(), autovivification=True)[source]

Initialize a package by creating a namespace for it

perllib.input_line_number(fh, value=None)[source]

Implementation of perl input_line_number

perllib.int_(expr)[source]

Convert expr to an integer

perllib.ioctl(fh, func, scalar)[source]
perllib.is_block_special(path)[source]
perllib.is_char_special(path)[source]
perllib.is_dir(path)[source]
perllib.is_empty_file(path)[source]
perllib.is_executable(path)[source]
perllib.is_file(path)[source]
perllib.is_owned(path)[source]
perllib.is_pipe(path)[source]
perllib.is_readable(path)[source]
perllib.is_real_executable(path)[source]
perllib.is_real_owned(path)[source]
perllib.is_real_readable(path)[source]
perllib.is_real_writable(path)[source]
perllib.is_socket(path)[source]
perllib.is_tty(path)[source]
perllib.is_utf8(s, check=False)[source]

Implementation of Encode::is_utf8

perllib.is_writable(path)[source]
perllib.isa(self, classname)[source]

Implementation of UNIVERSAL::isa and $obj->isa and $cls->isa

perllib.isa_op(self, classname)[source]

Implementation of isa operator

perllib.kill(sig, *args)[source]

Implementation of perl kill function

perllib.lcfirst(string)[source]

Implementation of lcfirst and l in interpolated strings: lowercase the first char of the given string

perllib.list_of_at_least_n(lst, n)[source]

For assignment to (list, …, *last) - make this list at least the right size.

perllib.list_of_n(lst, n)[source]

For assignment to (list, …) - make this list the right size

perllib.list_to_hash(lst)[source]

Convert a flat list of key value pairs to a hash

perllib.localtime(secs=None)[source]

Replacement for perl built-in localtime function

perllib.logical_xor(a, b)[source]

Implementation of perl’s xor operator

perllib.longmess(*args, skip=0)[source]

Message with stack backtrace

perllib.looks_like_binary(path)[source]

Implementation of perl -B

perllib.looks_like_text(path)[source]

Implementation of perl -T

perllib.lstat(path)[source]

Handle lstat call with or without “use File::stat;”

perllib.make_list(*args)[source]

For push/unshift @arr, expr; We use extend/[0:0] so make sure expr is iterable

perllib.maketrans_c(arg1, arg2, delete=False)[source]

Make a complement tr table for the ‘c’ flag. If the ‘d’ flag is passed, then delete=True. Ranges are expanded in arg1 and arg2 but arg2 is not otherwise normalized

perllib.map_int(*args)[source]

Convert each element to an int

perllib.map_num(*args)[source]

Convert each element to a num

perllib.map_str(*args)[source]

Convert each element to a str

perllib.method_call(cls_or_obj, methodname, *args, **kwargs)[source]

Call a method by name in a class that can also be specified by name

perllib.mkdir(path, mode=511)[source]
perllib.mkdtemp(template)[source]

Implementation of File::Temp::mkdtemp()

perllib.mkstemp(template)[source]

Implementation of File::Temp::mkstemp()

perllib.mkstemps(template, suffix)[source]

Implementation of File::Temp::mkstemps()

perllib.mktemp(template)[source]

Implementation of File::Temp::mktemp()

perllib.mod_element(base, index, value)[source]
perllib.multiply_element(base, index, value)[source]
perllib.need_sh(cmd)[source]

Does this command need a shell to run it?

perllib.nr()[source]

Get the current INPUT_LINE_NUMBER

perllib.num(expr)[source]

Convert expr to a number Ref: https://squareperl.com/en/how-perl-convert-string-to-number

perllib.open_(file, mode, encoding=None, errors=None, checked=True, newline='\n')[source]

Replacement for perl built-in open function when the mode is known.

perllib.open_dynamic(file, mode=None, encoding=None, errors=None, checked=True)[source]

Replacement for perl built-in open function when the mode is unknown.

perllib.opendir(DIR)[source]

Implementation of perl opendir

perllib.openhandle(fh)[source]

Return the file handle if this is an opened file handle, else return None

perllib.or_element(base, index, value)[source]
perllib.os_name()[source]

Implementation of $OSNAME / $^O

perllib.overload_Method(obj, op)[source]

Given an object and an operation string, return a reference to the code if it’s overloaded, else return None

perllib.overload_Overloaded(obj)[source]

Given an object, return 1 if it has any overloads defined, else return ‘’

perllib.overload_StrVal(obj)[source]

Implementation of overload::StrVal($obj)

perllib.pack(template, *args)[source]

pack items into a str via a given format template

perllib.package_call(package, function, *args, **kwargs)[source]

Call a function in a different package

perllib.perl_print(*args, **kwargs)[source]

Replacement for perl built-in print/say/warn functions. Note that by default this acts like ‘say’ in that it appends a newline. To prevent the newline, pass the end=’’ keyword argument. To write to a different file, pass the file=… keyword argument. To flush the output after writing, pass flush=True. To replace the OUTPUT_FIELD_SEPARATOR, pass sep=’…’. It returns 1 if successful

perllib.perlio_ok(encoding)[source]

Implementation of Encoding::perl_io_ok - returns 1

perllib.postprocess_arguments(parser, parser_rem)[source]

After argument parsing, see if we have any leftover arguments and flag those as errors

perllib.preprocess_arguments()[source]

Pre-process the command line arguments, changing -option to –option

perllib.print_(fh, *args)[source]

Implementation of perl $fh->print method

perllib.printf(fh, fmt, *args)[source]

Implementation of perl $fh->printf method

perllib.quotemeta(string)[source]

Implementation of perl quotemeta - all chars not matching /[A-Za-z_0-9]/ will be preceded by a backslash

perllib.raise_(exception)[source]

To raise an exception in a lambda function or expression

perllib.rand(expr=0)[source]

Implementation of perl rand function

perllib.range_(var, pat1, flags1, pat2, flags2, key)[source]

The line-range operator. See https://perldoc.perl.org/perlop#Range-Operators

perllib.read(fh, var, length, offset=0, need_len=False)[source]

Read length bytes from the fh, and return the result to store in var if need_len is False, else return a tuple with the result and the length read

perllib.readdir(DIR)[source]

Implementation of perl readdir in scalar context

perllib.readdirs(DIR)[source]

Implementation of perl readdir in list context

perllib.readline(fh)[source]

Reads a line from a file. (instead use _readline_full if you need support for perl $/ or $.)

perllib.readline_full(fh, fhname='')[source]

Reads a line from a file, handles perl $/ and sets $.

Returns the value of a symbolic link. If there is a system error, returns the undefined value and sets OS_ERROR (errno).

perllib.ref(r)[source]

ref function in perl - called when NOT followed by a backslash

perllib.ref_scalar(r)[source]

ref function in perl - called when being passed a scalar without a backslash

perllib.refs(r)[source]

ref function in perl - called when followed by a backslash

perllib.reset_each(h_a)[source]

Reset the ‘each’ iterator on keys/values calls

perllib.resolve_alias(encoding)[source]

Implementation of Encode::resolve_alias

perllib.reverse_scalar(expr)[source]

reverse function implementation in scalar context

perllib.rewinddir(DIR)[source]
perllib.rmdir(d)[source]

Implementation of perl rmdir

perllib.run(*args)[source]

Execute a command and return the stdout in list context

perllib.run_s(*args)[source]

Execute a command and return the stdout in scalar context

perllib.say(fh, *args)[source]

Implementation of perl $fh->say method

perllib.seek(fh, pos, whence)[source]

Implementation of perl seek

perllib.seekdir(DIR, pos)[source]
perllib.select(fh)[source]

Implementation of perl select function

perllib.set_breakpoint()[source]

Sets a debugger breakpoint, but only if pdb is active, mimicking $DB::single

perllib.set_element(base, index, value)[source]

Implementation of perl = on an array element or hash key

perllib.set_last_ndx(arr, ndx)[source]

Implementation of assignment to perl array last index $#array

perllib.set_signal(sig, handler)[source]

Set a signal handler to either a code reference or a string containing a perl code name or IGNORE or DEFAULT

perllib.setpos(fh, off)[source]

Implementation of perl $fh->setpos method

perllib.shift_left_element(base, index, value)[source]
perllib.shift_right_element(base, index, value)[source]
perllib.shortmess(*args, skip=0)[source]

Message with no backtrace

perllib.smartmatch(left, right)[source]

Implement the perl smartmatch (~~) operator

perllib.spaceship(a, b)[source]

3-way comparison like the <=> operator in perl

perllib.splice(array, *args)[source]

Implementation of splice function

perllib.splice_s(array, *args)[source]

Implementation of splice function in scalar context

perllib.split(pattern, string, maxsplit=0, flags=0)[source]

Split function in perl is similar to re.split but not quite the same - this function makes it the same

perllib.split_s(pattern, string, maxsplit=0, flags=0)[source]

Split function in perl is similar to re.split but not quite the same - this is the version used in scalar context

perllib.splitdir(*_args)[source]

Implementation of File::Spec->splitdir

perllib.splitpath(*_args)[source]

Implementation of File::Spec->splitpath

perllib.stat(path)[source]

Handle stat call with or without “use File::stat;”

perllib.stat_cando(self, mode, eff)[source]

Implementation of File::Stat::stat_cando. This takes an arrayref containing the return values of stat or lstat as its first argument, and interprets it for you

perllib.store_out_parameter(arglist, arg, value, shifts=0)[source]

Store the value of a sub out parameter both in the arglist and in a location where _fetch_out_parameter can retrieve it after the sub returns. arg is the argument index, starting at 0, and value is the value to be stored. shifts specifies the number of shift operations that have been performed on the arglist. Returns the value.

perllib.store_perl_global(perlname, value, infer_suffix=False, method_type=False)[source]

Assigns a value to a package global variable specified by it’s perl name and returns the value. Optional keyword argument infer_suffix will map the variable’s suffix based on the type of the value, e.g. it will add _h for a hash. Optional keyword argument method_type will set this to a MethodType if True, or will check if the name is ‘new’ or ‘make’ and set this to a MethodType if None

perllib.store_perl_meta(perlname, value, infer_suffix=False)[source]

Assigns a value to a package meta variable specified by it’s perl name and returns the value. Optional keyword argument infer_suffix will map the variable’s suffix based on the type of the value, e.g. it will add _h for a hash. This is used for tie ${“${pkg}::$scalarname”}

perllib.strftime(fmt, sec, min=None, hour=None, mday=None, mon=None, year=None, wday=0, yday=0, isdst=0)[source]

Implementation of perl strftime

perllib.sub()[source]

Implementation of __SUB__ in perl

perllib.subname(code)[source]

Implementation of Sub::Util::subname

perllib.substitute_and_count(this, that, var, replace=True, count=0)[source]

Perform a re substitute, but also count the # of matches

perllib.substitute_element(base, index, this, that, count=0, replace=True)[source]

Perform a re substitution on an array element or hash value, and also count the # of matches

perllib.substitute_global(packname, varname, this, that, replace=True, count=0)[source]

Perform a re substitute on a global, and also count the # of matches

perllib.substr(this, start, length, replacement)[source]

Handle substr with replacement - returns a tuple with (new_this, chars_removed)

perllib.subtract_element(base, index, value)[source]

Implementation of -= on an array element

perllib.switch(s_val)[source]

Implementation of switch/given statement in perl. This returns a function that is called for each case.

perllib.sysread(fh, var, length, offset=0, need_len=False)[source]

Read length bytes from the fh, and return the result to store in var if need_len is False, else return a tuple with the result and the length read. For compatability with perl, the result is returned as a str, not bytes.

perllib.sysseek(fh, pos, how=0)[source]

Implementation of perl sysseek

perllib.system(*args)[source]

Execute a command and return the return code

perllib.syswrite(fh, scalar, length=None, offset=0)[source]

Implementation of perl syswrite

perllib.tell(fh)[source]

Implementation of perl tell

perllib.telldir(DIR)[source]
perllib.tempdir(*args)[source]

Implementation of File::Temp::tempdir()

perllib.tempfile_(*args)[source]

Implementation of File::Temp::tempfile() in list context

perllib.tempfile_s(*args)[source]

Implementation of File::Temp::tempfile() in scalar context

perllib.tempnam(template, suffix)[source]

Implementation of File::Temp::tempnam()

perllib.tie_call(func, _args, _kwargs=None)[source]

Call a function in a package that uses TIEARRAY or TIEHASH. This is an internal routine whose call is automatically generated.

perllib.time()[source]

Replacement for perl built-in time function

perllib.timegm(sec, min, hour, mday, mon, year, wday=0, yday=0, isdst=0)[source]

Replacement for perl built-in timegm function

perllib.timelocal(sec, min, hour, mday, mon, year, wday=0, yday=0, isdst=0)[source]

Replacement for perl built-in timelocal function

perllib.tmpfile()[source]

Implementation of File::Temp tmpfile()

perllib.tmpnam()[source]

Implementation of POSIX tmpnam() in list context

perllib.tmpnam_s()[source]

Implementation of POSIX tmpnam() in scalar context

perllib.translate(table, var, replace=True, complement=False, delete=False, squash=False)[source]

Perform a tr translate operation

perllib.translate_and_count(table, var, replace=True, complement=False, delete=False, squash=False)[source]

Perform a tr translate, but also count the # of matches

perllib.translate_element(base, index, table, replace=True, complement=False, delete=False, squash=False)[source]

Perform a tr translate on an array element, and also count the # of matches

perllib.translate_global(packname, varname, table, replace=True, complement=False, delete=False, squash=False)[source]

Perform a tr translate on a global, and also count the # of matches

perllib.truncate(fh, length)[source]

Implementation of perl $fh->truncate method

perllib.ucfirst(string)[source]

Implementation of ucfirst and u in interpolated strings: uppercase the first char of the given string

perllib.unassign_meta(packname, varname)[source]

Unassigns a variable in the metaclass of a package global variable. This is use for untie $scalar

perllib.ungetc(fh, ordinal)[source]

Implementation of perl $fh->ungetc method

Implementation of perl unlink

perllib.unpack(template, bytestr)[source]

Unpack bytestr using the template and return a list of values

perllib.updir()[source]

Implementation of File::Spec->updir

perllib.utf8_decode(s)[source]

Implementation of utf8::decode

perllib.utf8_downgrade(s, fail_ok=False)[source]

Implementation of utf8::downgrade. Returns a tuple of string and success

perllib.utf8_encode(s)[source]

Implementation of utf8::encode

perllib.utf8_is_utf8(s)[source]

Implementation of utf8::is_utf8

perllib.utf8_native_to_unicode(c)[source]

Implementation of utf8::native_to_unicode. Returns it’s argument

perllib.utf8_unicode_to_native(c)[source]

Implementation of utf8::unicode_to_native. Returns it’s argument

perllib.utf8_upgrade(s)[source]

Implementation of utf8::upgrade. Returns a tuple with the result and the length

perllib.utf8_valid(s)[source]

Implementation of utf8::valid. Returns 1

perllib.utime(atime, mtime, *args)[source]

Implementation of perl utime function

perllib.wait()[source]

Replacement for perl wait() call

perllib.waitpid(pid, flags)[source]

Replacement for perl waitpid() call

perllib.warn(*args, skip=None)[source]

Handle warn in perl

perllib.write_(fh, scalar, length=None, offset=0)[source]

Implementation of perl $fh->write

perllib.xor_element(base, index, value)[source]