Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  LIST::GEN::LAZY::BUILTINS (3)

.ds Aq ’


List::Gen::Builtins - perl builtin functions with partial + lazy application



this module implements most of the perl functions with fn() from List::Gen::Lazy. you can import functions from this module as follows:


builtin’s with prototypes have the same prototype when exported from this module.

to export the builtins in ucfirst:

    use List::Gen::Builtins;  # ucfirst is default

    my $int = Int my $float;

    $float = 4.333;

    say $int; # 4

or to export prefixed with _ :

    use List::Gen::Builtins :_;

    my $int = _int my $float;

or to export prefixed with lazy_ :

    use List::Gen::Builtins :lazy;

    my $int = lazy_int my $float;

to export the builtins as like named userspace functions:

    use List::Gen::Builtins :userspace;

    my $int = &int(my $float);

note that as always, when a user function is called with & , prototypes are disabled, this means that you must call functions like &shift as:

    my $x = &shift(\@array);  # must use parens and manually take the reference

the implemented functions are:

    abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop
    chown chr chroot close closedir connect cos crypt dbmclose dbmopen default
    defined die do endgrent endhostent endnetent endprotoent endpwent
    endservent eof eval exec exit exp fcntl fileno flock fork formline getc
    getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin
    getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority
    getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid
    getservbyname getservbyport getservent getsockname getsockopt glob gmtime
    goto hex index int ioctl join keys kill lc lcfirst length link listen
    localtime lock log lstat mkdir msgctl msgget msgrcv msgsnd oct open opendir
    ord pack pipe pop pos print printf prototype push quotemeta rand read
    readdir readline readlink readpipe recv ref rename require reset reverse
    rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop
    send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent
    setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin
    sleep socket socketpair splice split sprintf sqrt srand stat study substr
    symlink syscall sysopen sysread sysseek system syswrite tell telldir tied
    time times truncate uc ucfirst umask undef unlink unpack unshift untie utime
    values vec wait waitpid wantarray warn when write

just because they have been implemented, that says nothing about their usefulness as a lazy function.


wrap CODE OPTIONS wrap is used to automatically wrap the builtin functions in a fn(...) function that calls the builtin with the arguments passed in.

    *lazy_open = wrap open,
        styles => {
            1   => [\@],
            2   => [\@, $,],
            3   => [\@, $, $],
            @ => [\@, $, $, @]
        proto => \@;$$@;
        arity => 1,
        returns => 1;

all of the options are optional, in fact, with a proper prototype, wrap will determine everything itself:

    *lazy_open = wrap open;  # same as with the options above

wrap does not install anything, it returns the lazy coderef.


Eric Strom, <asg at>


this module has barely been tested, ymmv

several functions are not available in 5.13+ and a warning will be generated. to silence this:

    BEGIN {$List::Gen::Lazy::Builtins::WARN = 0}  # before calling use
    use List::Gen::Lazy::Builtins;

report any bugs / feature requests to bug-list-gen at, or through the web interface at <>.

comments / feedback / patches are also welcome.


copyright 2009-2011 Eric Strom.

this program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

see for more information.

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 LIST::GEN::LAZY::BUILTINS (3) 2011-10-14

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.