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