Tie::CharArray 1.00
Sponsored Links
Tie::CharArray 1.00 Ranking & Summary
File size:
0.005 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
871
Date added:
2007-06-14
Publisher:
Ilmari Karonen
Tie::CharArray 1.00 description
Tie::CharArray module can access Perl scalars as arrays of characters.
SYNOPSIS
use Tie::CharArray;
my $foobar = a string;
tie my @foo, Tie::CharArray, $foobar;
$foo[0] = A; # $foobar = A string
push @foo, !; # $foobar = A string!
print "@foon"; # prints: A s t r i n g !
tie my @bar, Tie::CharArray::Ord, $foobar;
$bar[0]--; # $foobar = @ string!
pop @bar; # $foobar = @ string
print "@barn"; # prints: 64 32 115 116 114 105 110 103
Alternative interface functions
use Tie::CharArray qw( chars codes );
my $foobar = another string;
my $chars = chars $foobar; # arrayref in scalar context
push @$chars, ?; # $foobar = another string?
$_ += 2 for codes $foobar; # tied array in list context
# $foobar = cpqvjgt"uvtkpiA
my @array = chars $foobar; # WARNING: @array isnt tied!
In low-level programming languages such as C, and to some extent Java, strings are not primitive data types but arrays of characters, which in turn are treated as integers. This closely matches the internal representation of strings in the memory.
Perl, on the other hand, abstracts such internal details away behind the concept of scalars, which can be treated as either strings or numbers, and appear as primitive types to the programmer. This often better matches the way people think about the data, which facilitates programming by making common high-level manipulation tasks trivial.
Sometimes, though, the low-level view is better suited for the task at hand. Perl does offer functions such as ord()/chr(), pack()/unpack() and substr() that can be used to solve such tasks with reasonable efficiency. For someone used to the direct access to the internal representation offered by other languages, however, these functions may feel awkward. While this is often only a symptom of thinking in un-Perlish terms, sometimes being able to manipulate strings as character arrays really does simplify the code, making the intent more obvious by eliminating syntactic clutter.
This module provides a way to manipulate Perl strings through tied arrays. The operations are implemented in terms of the aforementioned string manipulation functions, but the programmer normally need not be aware of this. As Perl has no primitive character type, two alternative representations are provided:
SYNOPSIS
use Tie::CharArray;
my $foobar = a string;
tie my @foo, Tie::CharArray, $foobar;
$foo[0] = A; # $foobar = A string
push @foo, !; # $foobar = A string!
print "@foon"; # prints: A s t r i n g !
tie my @bar, Tie::CharArray::Ord, $foobar;
$bar[0]--; # $foobar = @ string!
pop @bar; # $foobar = @ string
print "@barn"; # prints: 64 32 115 116 114 105 110 103
Alternative interface functions
use Tie::CharArray qw( chars codes );
my $foobar = another string;
my $chars = chars $foobar; # arrayref in scalar context
push @$chars, ?; # $foobar = another string?
$_ += 2 for codes $foobar; # tied array in list context
# $foobar = cpqvjgt"uvtkpiA
my @array = chars $foobar; # WARNING: @array isnt tied!
In low-level programming languages such as C, and to some extent Java, strings are not primitive data types but arrays of characters, which in turn are treated as integers. This closely matches the internal representation of strings in the memory.
Perl, on the other hand, abstracts such internal details away behind the concept of scalars, which can be treated as either strings or numbers, and appear as primitive types to the programmer. This often better matches the way people think about the data, which facilitates programming by making common high-level manipulation tasks trivial.
Sometimes, though, the low-level view is better suited for the task at hand. Perl does offer functions such as ord()/chr(), pack()/unpack() and substr() that can be used to solve such tasks with reasonable efficiency. For someone used to the direct access to the internal representation offered by other languages, however, these functions may feel awkward. While this is often only a symptom of thinking in un-Perlish terms, sometimes being able to manipulate strings as character arrays really does simplify the code, making the intent more obvious by eliminating syntactic clutter.
This module provides a way to manipulate Perl strings through tied arrays. The operations are implemented in terms of the aforementioned string manipulation functions, but the programmer normally need not be aware of this. As Perl has no primitive character type, two alternative representations are provided:
Tie::CharArray 1.00 Screenshot
Tie::CharArray 1.00 Keywords
CharArray
CharArray 1.00
foobar
Perl
string
arrays
scalars
module
Tie::CharArray
TieCharArray
Tie::CharArray 1.00
Libraries
Programming
Bookmark Tie::CharArray 1.00
Tie::CharArray 1.00 Copyright
WareSeeker periodically updates pricing and software information of Tie::CharArray 1.00 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Tie::CharArray 1.00 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Tie::OffsetArray can tie one array to another, with index offset. Free Download
Tie::FlatFile::Array is a Perl extension which treats a flatfile database as an array of arrays. Free Download
Tie::Scalar::Sticky is a Perl module with block assignments to scalars. Free Download
Tie::Array::PackedC is a Tie a Perl array to a C-style array (packed; elements of a single, simple data type). Free Download
Tie::HashHistory can track history of all changes to a tied hash. Free Download
Apache::Storage is Perl module containing simple functions to store and retrieve information from within the Apache process. Free Download
Tie::FormA is a Perl module that can access a machine readable database file that minics a hardcopy form. Free Download
Tie::Eudora is a Perl module that can encode/decode emails, read/write emails in Eudora mailbox files. Free Download
Latest Software
Popular Software
Favourite Software