Lines Matching refs:can

24 can use the printf or sprintf function.  See the
60 The inverse mapping from decimal to octal can be done with either the
71 644, rather than the intended octal literal 0644. The problem can
100 uses the Math::Complex module and some functions can break out from
104 Rounding in financial applications can have serious implications, and
311 To call a function on each integer in a (small) range, you B<can> use:
316 all integers in the range. This can take a lot of memory for large
333 =head2 How can I output Roman numerals?
371 want a random number between 0 and 5 that you can then add
397 The POSIX module can also format a date as the day of the year or
437 =head2 How can I compare two dates and find the difference?
443 dates, the Date::Manip, Date::Calc, or DateTime modules can help you.
446 =head2 How can I take a string and turn it into epoch seconds?
449 you can split it up and pass the parts to C<timelocal> in the standard
453 =head2 How can I find the Julian Day?
457 You can use the Time::JulianDay module available on CPAN. Ensure that
462 You can also try the DateTime module, which can convert a date/time
492 You can also use the C<Date::Calc> module using its Today_and_Now
515 you can. Is that the pencil's fault? Of course it isn't.
530 That doesn't mean that Perl can't be used to create non-Y2K compliant
531 programs. It can. But so can your pencil. It's the fault of the user,
544 perlfaq, you can also look at the modules with "Assert" and "Validate"
565 You can use the substitution operator to find pairs of characters (or
574 We can also use the transliteration operator, C<tr///>. In this
593 have a more than one return value, we can construct and dereference an
599 more work. We can really have any code we like inside the braces, so
601 that is up to you, and you can use code inside the braces.
614 The C<Interpolation> module can also do a lot of magic for you. You can
629 This isn't something that can be done in one regular expression, no
676 You can do it yourself:
680 Or you can just use the Text::Tabs module (part of the standard Perl
696 Or use the CPAN module Text::Autoformat. Formatting files can be easily
705 =head2 How can I access or change N characters of a string?
707 You can access the first characters of a string with substr().
715 To change part of a string, you can use the optional fourth
720 You can also use substr() as an lvalue.
738 In the more general case, you can use the C</g> modifier in a C<while>
750 That prints out: C<"The third fish is a red one."> You can also use a
755 =head2 How can I count the number of occurrences of a substring within a string?
758 count of a certain single character (X) within a string, you can use the
767 larger string, C<tr///> won't work. What you can do is wrap a while()
806 You can (and probably should) enable locale awareness of those
828 =head2 How can I split a [character] delimited string except when inside [character]?
830 Several modules can handle this sort of pasing---Text::Balanced,
834 comma-separated into its different fields. You can't use C<split(/,/)>
869 A substitution can do this for you. For a single line, you want to
871 can do that with a pair of substitutions.
876 You can also write that as a single substitution, although it turns
886 newline matches the C<\s+>, and the C<$> anchor can match to the
898 For a multi-line string, you can apply the regular expression
907 since the first part of the alternation can match the entire string
918 and C<$pad_char> contains the padding character. You can use a single
920 know what it is in advance. And in the same way you can use an integer in
923 The simplest method uses the C<sprintf> function. It can pad on the left
925 truncate the result. The C<pack> function can only pad strings on the
944 If you need to pad with a character other than blank or zero you can use
963 you can use this kind of thing:
985 You can use the Text::Soundex module. If you want to do fuzzy or close
989 =head2 How can I expand variables in text strings?
996 You can use a substitution with a double evaluation. The
1045 You can also get into subtle problems on those few operations in Perl
1066 =item You can't (easily) have any space in front of the tag.
1071 can do this:
1128 And I must follow, if I can,
1141 you can push or pop, while a list is a set of values. Some people make
1178 =head2 How can I remove duplicate elements from a list or array?
1196 You can also go through each element and skip the ones you've seen
1215 You can write this more briefly using a grep, which does the
1221 =head2 How can I tell whether a certain element is contained in a list or array?
1238 Now you can check whether $is_blue{$some_color}. It might have been a
1251 If the values in question are integers instead of strings, you can save
1356 To find the first array element which satisfies a condition, you can
1364 If you cannot use List::Util, you can make your own loop to do the
1373 If you want the array index, you can iterate through the indices
1391 regular arrays, you can push and pop or shift and unshift at either end,
1392 or you can use splice to add and/or remove arbitrary number of elements at
1448 Scalar-List-Utils 1.03 or later installed, you can say:
1454 If not, you can use a Fisher-Yates shuffle.
1506 which can also be done with map() which is made to transform
1512 hash, you can use the C<values> function. As of Perl 5.6
1592 out first, because the sort BLOCK can be called many times for the
1618 This can be conveniently combined with precalculation of keys as given
1636 Here's how, given a vector in $vec, you can
1671 You can make the while loop a lot shorter with this suggestion
1756 If you iterate through the hash with each(), you can delete the key
1778 worry you, you can always reverse the hash into a hash of arrays instead:
1784 =head2 How can I know how many entries are in a hash?
1802 in ASCIIbetical order. Once we have the keys, we can go through them to
1813 comparing the keys, we can compute a value with them and use that
1833 From there we can get more complex. If the hash values are the same,
1834 we can provide a secondary sort on the hash key.
1842 =head2 How can I always keep my hash sorted?
1844 You can look into using the DB_File module and tie() using the
1852 although the value can be any kind of scalar: string,
1855 for a given key can be C<undef>, in which case
1944 =head2 How can I get the unique keys from two hashes?
1970 =head2 How can I store a multidimensional array in a DBM file?
1976 =head2 How can I make my hash remember the order I put elements into it?
2005 =head2 How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arr…
2023 =head2 How can I use a reference as a hash key?
2027 Hash keys are strings, so you can't really use a reference as the key.
2029 form (for instance, C<HASH(0xDEADBEEF)>). From there you can't get back
2032 two different variables can store the same reference (and those variables
2033 can change later).
2112 For some specific applications, you can use one of the DBM modules.
2135 Where $r1 can be a reference to any kind of data structure you'd like.
2161 This documentation is free; you can redistribute it and/or modify it