Rand Stats

P5built-ins

zef:lizmat

Actions Status Actions Status Actions Status

NAME

Raku port of Perl's built-ins

SYNOPSIS

use P5built-ins;   # import all P5 built-in functions supported

use P5built-ins <tie untie>;  # only import specific ones

tie my @a, Foo;

DESCRIPTION

This module provides an easy way to import a growing number of built-in functions of Perl in Raku Currently supported at:

abs caller chdir chomp chop chr closedir cos crypt defined each endgrent
endnetent endprotoent endpwent endservent exp fc fileno getgrent getgrgid
getgrnam getlogin getnetbyaddr getnetbyname getnetent getpgrp getppid
getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam
getpwuid getservbyname getservbyport getservent gmtime hex index int lc
lcfirst length localtime log oct opendir ord pack pop print printf push
quotemeta rand readdir readlink ref reset reverse rewinddir rindex say
seek seekdir setgrent setnetent setpriority setprotoent setpwent setservent
shift sin sleep sqrt study substr telldir tie tied times uc ucfirst undef
unpack unshift untie

The following file test operators are also available:

-r -w -x -e -f -d -s -z -l

And the following terms:

__FILE__ __LINE__ __PACKAGE__ __SUB__ SEEK_CUR SEEK_END SEEK_SET
STDERR STDIN STDOUT

PORTING CAVEATS

Please look at the porting caveats of the underlying modules that actually provide the functionality:

modulebuilt-in functions
P5callercaller
P5chdirchdir
P5chompchomp chop
P5chrchr ord
P5defineddefined undef
P5eacheach
P5fcfc
P5filenofileno
P5getgrnamendgrent getgrent getgrgid getgrnam setgrent
P5getnetbynameendnetent getnetbyname getnetbyaddr getnetent setnetent
P5getprioritygetpriority setpriority getppid getpgrp
P5getprotobynameendprotoent getprotobyname getprotobynumber getprotoent setprotoent
P5getpwnamendpwent getlogin getpwent getpwnam getpwuid setpwent
P5getservbynameendservent getservbyname getservbyport getservent setservent
P5hexhex oct
P5lclc uc
P5lcfirstlcfirst ucfirst
P5lengthlength
P5localtimelocaltime gmtime
P5mathabs cos crypt exp int log rand sin sqrt
P5opendiropendir readdir telldir seekdir rewinddir closedir
P5packpack unpack
P5printprint printf say
P5pushpush pop
P5readlinkreadlink
P5refref
P5resetreset
P5reversereverse
P5studystudy
P5tietie, tied, untie
P5timestimes
P5-X-r -w -x -e -f -d -s -z -l

AUTHOR

Elizabeth Mattijsen liz@raku.rocks

Source can be located at: https://github.com/lizmat/P5built-ins . Comments and Pull Requests are welcome.

If you like this module, or what I'm doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2025 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.