1FFI::Platypus::Record::UTsieerArCroanyt(r3i)buted Perl DFoFcIu:m:ePnltaattyipouns::Record::TieArray(3)
2
3
4
6 FFI::Platypus::Record::TieArray - Tied array interface for record array
7 members
8
10 version 1.56
11
13 package Foo;
14
15 use FFI::Platypus::Record;
16 use FFI::Platypus::Record::TieArray;
17
18 record_layout(qw(
19 int[20] _bar
20 ));
21
22 sub bar
23 {
24 my($self, $arg) = @_;
25 $self->_bar($arg) if ref($arg) eq ' ARRAY';
26 tie my @list, 'FFI::Platypus::Record::TieArray',
27 $self, '_bar', 20;
28 }
29
30 package main;
31
32 my $foo = Foo->new;
33
34 my $bar5 = $foo->bar->[5]; # get the 5th element of the bar array
35 $foo->bar->[5] = 10; # set the 5th element of the bar array
36 @{ $foo->bar } = (); # set all elements in bar to 0
37 @{ $foo->bar } = (1..5); # set the first five elements of the bar array
38
40 WARNING: This module is considered EXPERIMENTAL. It may go away or be
41 changed in incompatible ways, possibly without notice, but not without
42 a good reason.
43
44 This class provides a tie interface for record array members.
45
46 In the future a short cut for using this with FFI::Platypus::Record
47 directly may be provided.
48
50 FFI::Platypus
51 The main Platypus documentation.
52
53 FFI::Platypus::Record
54 Documentation on Platypus records.
55
57 Author: Graham Ollis <plicease@cpan.org>
58
59 Contributors:
60
61 Bakkiaraj Murugesan (bakkiaraj)
62
63 Dylan Cali (calid)
64
65 pipcet
66
67 Zaki Mughal (zmughal)
68
69 Fitz Elliott (felliott)
70
71 Vickenty Fesunov (vyf)
72
73 Gregor Herrmann (gregoa)
74
75 Shlomi Fish (shlomif)
76
77 Damyan Ivanov
78
79 Ilya Pavlov (Ilya33)
80
81 Petr Písař (ppisar)
82
83 Mohammad S Anwar (MANWAR)
84
85 Håkon Hægland (hakonhagland, HAKONH)
86
87 Meredith (merrilymeredith, MHOWARD)
88
89 Diab Jerius (DJERIUS)
90
91 Eric Brine (IKEGAMI)
92
93 szTheory
94
95 José Joaquín Atria (JJATRIA)
96
97 Pete Houston (openstrike, HOUSTON)
98
100 This software is copyright (c) 2015,2016,2017,2018,2019,2020 by Graham
101 Ollis.
102
103 This is free software; you can redistribute it and/or modify it under
104 the same terms as the Perl 5 programming language system itself.
105
106
107
108perl v5.34.0 2021-10-29FFI::Platypus::Record::TieArray(3)