GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Data::Frame::Autobox(3) User Contributed Perl Documentation Data::Frame::Autobox(3)

Data::Frame::Autobox - Autobox arrays and hashes for Data::Frame

version 0.006004

    use Data::Frame::Autobox;
    [ 1 .. 5 ]->isempty;    # false
    { one => 1 }->names;    # [ 'one' ]
    { one => 1 }->isempty;  # false

This package provides a set of methods for autoboxed arrays and hashes.

    my $isempty = $array->isempty;

Returns a boolean value for if the array ref is empty.

    my $new_array = $array->grep($coderef);

    my $new_array = $array->map($coderef);

    my $value = $array->at($idx);

    my $uniq_array = $array->uniq;

    $array->set($idx, $value);

    my $length = $array->length;

This is same as "length".

    my @array = $array->flatten;

Explicitly returns an array.

    my $slice = $array->slice($indices);

Shallow copy.

    my $new_array = $array->repeat($n);

Repeat for $n times.

    my $new_array = $array->repeat_to_length($l);

Repeat to get the length of $l.

    my $new_array = $array->intersect($other)

    my $new_array = $array->union($other)

    my $new_array = $array->setdiff($other)

    my $isempty = $hash->isempty;

Returns a boolean value for if the hash ref is empty.

    $hash->delete($key);

    my $merged_hash = $hash->merge($other);

    my $sliced_hash = $hash->hslice($keys);

This is same as "hslice".

    my $value = $hash->at($key);

    $hash->set($key, $value);

    my $bool = $hash->exists($key);

    my $keys = $hash->keys;

This is same as "keys".

    my $values = $hash->values;

    my %hash = $hash->flatten;

Explicitly returns an array.

Shallow copy.

    rename($hashref_or_coderef)

It can take either,

  • A hashref of key mappings.

    If a keys does not exist in the mappings, it would not be renamed.

  • A coderef which transforms each key.

    my $new_href1 = $href->rename( { $from_key => $to_key, ... } );
    my $new_href2 = $href->rename( sub { $_[0] . 'foo' } );

autobox

  • Zakariyya Mughal <zmughal@cpan.org>
  • Stephan Loyd <sloyd@cpan.org>

This software is copyright (c) 2014, 2019-2022 by Zakariyya Mughal, Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2024-12-20 perl v5.40.2

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

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