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
Text::Diff3::ListMixin(3) User Contributed Perl Documentation Text::Diff3::ListMixin(3)

Text::Diff3::ListMixin - methods collection like as ruby-lang.

0.08

    package AnyList;
    use base qw(Text::Diff3::ListMixin Text::Diff3::Base);
    sub list { return $_[0]->buffer }
    
    package AnyListUser;
    use SomeFactory;
    my $list = SomeFactory->new->create_anylist;
    $list->push($x, $y);
    $x = $list->pop;
    $list->unshift($x, $y);
    $x = $list->shift;
    until ($list->is_empty) {
        $x = $list->shift;
        $x = $list->first->foo;
        $y = $list->last->bar;
    }
    $list->size == 3 or die "excepts \$list->size == 3".
    $list->each(sub{
        my($x) = @_;
        print $x, "\n";
    });

This is a mix-in class derived delegates to the list attributes.

"$list->at($x)"
Fetchs an element at index $x.
"$list->push($x)"
Pushs into the list.
"$list->pop"
Pops from the list.
"$list->unshift($x)"
Unshifts into the list.
"$list->shift"
Shifts from the list.
"$list->is_empty"
Returns true when the list is empty.
"$list->size"
Returns size of the list.
"$list->first"
Fetchs first element in the list.
"$list->last"
Fetchs last element in the list.
"$list->each(sub{})"
Iterates given code reference for each elements.

Use new function style interfaces introduced from version 0.08. This module remained for backward compatibility before version 0.07. This module is no longer maintenance after version 0.08.

MIZUTANI Tociyuki "<tociyuki@gmail.com>".

Copyright (C) 2010 MIZUTANI Tociyuki

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

2010-02-19 perl v5.32.1

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.