<?xml version="1.0" encoding="windows-1252"?>
<node id="797" title="perlman:perlfaq4" created="1999-10-12 23:09:41" updated="2005-08-12 17:54:21">
<type id="116">
perlman</type>
<author id="113">
root</author>
<data>
<field name="doctext">
The section of the FAQ answers question related to the manipulation of data as numbers, dates, strings, arrays, hashes, and miscellaneous data issues. &lt;BR&gt;&lt;BR&gt;
&lt;B&gt;Data: Numbers&lt;/B&gt;&lt;BR&gt;&lt;UL&gt;
[Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?]&lt;BR&gt;
[Why isn't my octal data interpreted correctly?]&lt;BR&gt;
[Does perl have a round function?  What about ceil() and floor()?  Trig functions?]&lt;BR&gt;
[How do I convert bits into ints?]&lt;BR&gt;
[How do I multiply matrices?]&lt;BR&gt;
[How do I perform an operation on a series of integers?]&lt;BR&gt;
[How can I output Roman numerals?]&lt;BR&gt;
[Why aren't my random numbers random?]&lt;BR&gt;
[Why aren't my random numbers random?]&lt;BR&gt;&lt;/UL&gt;
&lt;BR&gt;&lt;B&gt;Data: Dates&lt;/B&gt;&lt;UL&gt;
[How do I find the week-of-the-year/day-of-the-year?]&lt;BR&gt;
[How can I compare two dates and find the difference?]&lt;BR&gt;
[How can I take a string and turn it into epoch seconds?]&lt;BR&gt;
[How can I find the Julian Day?]&lt;BR&gt;
[Does Perl have a year 2000 problem?  Is Perl Y2K compliant?]&lt;BR&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;B&gt;Data: Strings&lt;/B&gt;&lt;BR&gt;&lt;UL&gt;
[How do I validate input?]&lt;BR&gt;
[How do I unescape a string?]&lt;BR&gt;
[How do I remove consecutive pairs of characters?]&lt;BR&gt;
[How do I expand function calls in a string?]&lt;BR&gt;
[How do I find matching/nesting anything?]&lt;BR&gt;
[How do I reverse a string?]&lt;BR&gt;
[How do I expand tabs in a string?]&lt;BR&gt;
[How do I reformat a paragraph?]&lt;BR&gt;
[How can I access/change the first N letters of a string?]&lt;BR&gt;
[How do I change the Nth occurrence of something?]&lt;BR&gt;
[How can I count the number of occurrences of a substring within a string?]&lt;BR&gt;
[How do I capitalize all the words on one line?]&lt;BR&gt;
[How do I strip blank space from the beginning/end of a string?]&lt;BR&gt;
[How do I extract selected columns from a string?]&lt;BR&gt;
[How do I find the soundex value of a string?]&lt;BR&gt;
[How can I expand variables in text strings?]&lt;BR&gt;
[What's wrong with always quoting "$vars"?]&lt;BR&gt;
[Why don't my &amp;lt;&amp;lt;HERE documents work?]&lt;BR&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;B&gt;Data: Arrays&lt;/B&gt;&lt;UL&gt;
[What is the difference between $array&amp;#091;1&amp;#093; and @array&amp;#091;1&amp;#093;?]&lt;BR&gt;
[How can I extract just the unique elements of an array?]&lt;BR&gt;
[How can I tell whether a list or array contains a certain element?]&lt;BR&gt;
[How do I compute the difference of two arrays? How do I compute the intersection of two arrays?]&lt;BR&gt;
[How do I find the first array element for which a condition is true?]&lt;BR&gt;
[How do I handle linked lists?]&lt;BR&gt;
[How do I handle circular lists?]&lt;BR&gt;
[How do I shuffle an array randomly?]&lt;BR&gt;
[How do I process/modify each element of an array?]&lt;BR&gt;
[How do I select a random element from an array?]&lt;BR&gt;
[How do I permute N elements of a list?]&lt;BR&gt;
[How do I sort an array by (anything)?]&lt;BR&gt;
[How do I manipulate arrays of bits?]&lt;BR&gt;
[Why does defined() return true on empty arrays and hashes?]&lt;BR&gt;
[How do I process an entire hash?]&lt;BR&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;B&gt;Data: Hashes(Associative Arrays)&lt;/B&gt;&lt;UL&gt;
[What happens if I add or remove keys from a hash while iterating over it?]&lt;BR&gt;
[How do I look up a hash element by value?]&lt;BR&gt;
[How can I know how many entries are in a hash?]&lt;BR&gt;
[How do I sort a hash (optionally by value instead of key)?]&lt;BR&gt;
[How can I always keep my hash sorted?]&lt;BR&gt;
[What's the difference between "delete" and "undef" with hashes?]&lt;BR&gt;
[Why don't my tied hashes make the defined/exists distinction?]&lt;BR&gt;
[How do I reset an each() operation part-way through?]&lt;BR&gt;
[How can I get the unique keys from two hashes?]&lt;BR&gt;
[How can I store a multidimensional array in a DBM file?]&lt;BR&gt;
[How can I make my hash remember the order I put elements into it?]&lt;BR&gt;
[Why does passing a subroutine an undefined element in a hash create it?]&lt;BR&gt;
[How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?]&lt;BR&gt;
[How can I use a reference as a hash key?]&lt;BR&gt;
[How can I use a reference as a hash key?]&lt;BR&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;B&gt;Data: Misc&lt;/B&gt;&lt;BR&gt;&lt;UL&gt;
[How do I handle binary data correctly?]&lt;BR&gt;
[How do I determine whether a scalar is a number/whole/integer/float?]&lt;BR&gt;
[How do I keep persistent data across program calls?]&lt;BR&gt;
[How do I print out or copy a recursive data structure?]&lt;BR&gt;
[How do I define methods for every class/object?]&lt;BR&gt;
[How do I verify a credit card checksum?]&lt;BR&gt;
&lt;/UL&gt;</field>
</data>
</node>
