Lines Matching +full:x +full:- +full:whatever

3 perldata - Perl data types
8 X<variable, name> X<variable name> X<data type> X<type>
10 Perl has three built-in data types: scalars, arrays of scalars, and
27 (see L<perlmod/Packages> for details). For a more in-depth discussion
32 X<identifier>
34 Perl also has its own built-in variables whose names don't follow
42 X<variable, built-in>
48 X<scalar>
58 X<array>
65 X<hash>
72 but you don't really care about that yet (if ever :-).
75 non-variable identifiers. This means that you can, without fear
77 a hash--or, for that matter, for a filehandle, a directory handle, a
82 X<namespace>
91 from conflict with future reserved words. Case I<is> significant--"FOO",
94 X<identifier, case sensitivity>
95 X<case>
109 X<identifiers>
113 work on previous versions of Perl, while the opposite -- edge cases
114 that work in previous versions, but aren't defined here -- probably
124 (?[ ( \p{Word} & \p{XID_Continue} ) ]) * /x
134 / (?aa) (?!\d) \w+ /x
147 Additionally, if the identifier is preceded by a sigil --
148 that is, if the identifier is part of a variable name -- it
183 /x
188 fully-qualified. They come in six forms (but don't use forms 5 and 6):
205 C<[][A-Z^_?\]>, like C<$^V> or C<$^]>.
211 the characters C<[][A-Z^_?\]>, followed by ASCII word characters. An
216 A sigil, followed by any single character in the range C<[\xA1-\xAC\xAE-\xFF]>
219 non-graphic characters (the C1 controls, the NO-BREAK SPACE, and the
226 legal under C<S<"use utf8">>, and vice-versa, for example the identifier
237 C<[\x80-\xFF]> followed by ASCII word characters up to the trailing
240 The same caveats as the previous form apply: The non-graphic
246 Prior to Perl v5.24, non-graphical ASCII control characters were also
250 X<context> X<scalar context> X<list context>
277 sort those lines and return them as a list to whatever the context
282 scalar evaluates the right-hand side in scalar context, while
285 anyway) also evaluates the right-hand side in list context.
287 When you use the C<use warnings> pragma or Perl's B<-w> command-line
295 User-defined subroutines may choose to care whether they are being
303 X<scalar> X<number> X<string> X<reference>
321 references are strongly-typed, uncastable pointers with builtin
322 reference-counting and destructor invocation.
324 X<truth> X<falsehood> X<true> X<false> X<!> X<not> X<negation> X<0>
325 X<boolean> X<bool>
349 X<defined> X<undefined> X<undef> X<null> X<string, null>
351 To find out whether a given string is a valid non-zero number, it's
367 warn "not a natural number" unless /^\d+$/; # rejects -3
368 warn "not an integer" unless /^-?\d+$/; # rejects +3
369 warn "not an integer" unless /^[+-]?\d+$/;
370 warn "not a decimal number" unless /^-?\d+\.?\d*$/; # rejects .2
371 warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
373 unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;
383 X<$#> X<array, length>
385 You can also gain some minuscule measure of efficiency by pre-extending
391 @whatever = ();
392 $#whatever = -1;
396 the last value, like the C comma operator, nor of built-in functions,
397 which return whatever they feel like returning.) The following is
399 X<array, length>
401 scalar(@whatever) == $#whatever + 1;
406 $element_count = scalar(@whatever);
427 X<hash, scalar context> X<hash, bucket> X<bucket>
435 X<scalar, literal> X<scalar, constant>
442 .23E-10 # a very small number
450 0x1.999ap-4 # hexadecimal floating point (the 'p' is required)
456 digits by threes (as for a Unix-style mode argument such as 0b110_100_100)
458 X<number, literal>
462 double-quoted string literals are subject to backslash and variable
463 substitution; single-quoted strings are not (except for C<\'> and
464 C<\\>). The usual C-style backslash rules apply for making
466 forms. See L<perlop/"Quote and Quote-like Operators"> for a list.
467 X<string, literal>
480 platforms use the 64-bit IEEE 754 floating point, not all do. Another
481 potential source of (low-order) differences are the floating point
494 X<interpolation>
513 double-colon or an apostrophe since these would be otherwise treated as
515 X<interpolation>
523 $0 and the $s variables in the (presumably) non-existent package
616 =head3 Special floating point: infinity (Inf) and not-a-number (NaN)
619 for infinity and not-a-number. The infinity can be also negative.
622 the floating point range, like 9**9**9. The not-a-number is the
625 "out-of-range" operations like dividing by zero, or square root of
628 The infinity and not-a-number have their own special arithmetic rules.
631 is when you combine infinities and not-a-numbers: C<Inf> minus C<Inf>
643 in many forms. Case is ignored, and the Win32-specific forms like
648 X<version string> X<vstring> X<v-string>
652 v-strings, provides an alternative, more readable way to construct
654 C<"\x{1}\x{14}\x{12c}\x{fa0}">. This is useful for representing
659 print v9786; # prints SMILEY, "\x{263a}"
664 doing a version check. Note that using the v-strings for IPv4
668 Note that since Perl 5.8.1 the single-number v-strings (like C<v65>)
669 are not v-strings before the C<< => >> operator (which is usually used
671 as literal strings ('v65'). They were v-strings from Perl 5.6.0 to
673 Multi-number v-strings like C<v65.66> and C<65.66.67> continue to
674 be v-strings always.
677 X<special literal> X<__END__> X<__DATA__> X<END> X<DATA>
678 X<end> X<data> X<^D> X<^Z>
690 X<__FILE__> X<__LINE__> X<__PACKAGE__> X<__SUB__>
691 X<line> X<file> X<package>
714 The C<DATA> file handle by default has whatever PerlIO layers were
717 Latin-1, but there are two major ways for it to be otherwise. Firstly,
719 pragma then the C<DATA> handle will be in UTF-8 mode. And secondly,
722 be in UTF-8 mode because of the C<PERL_UNICODE> environment variable or
723 perl's command-line switches.
732 X<bareword>
738 words, and if you use the C<use warnings> pragma or the B<-w> switch,
749 produces a compile-time error instead. The restriction lasts to the
754 X<array, interpolation> X<interpolation, array> X<$">
756 Arrays and slices are interpolated into double-quoted strings
766 Within search patterns (which also undergo double-quotish substitution)
776 If you're looking for the information on how to use here-documents,
778 L<perlop/Quote and Quote-like Operators>.
781 X<list>
792 @foo = ('cc', '-E', $bar);
796 $foo = ('cc', '-E', $bar);
802 @foo = ('cc', '-E', $bar);
814 To use a here-document to assign an array, one line per element,
829 identity in a LIST--the list
862 $hexdigit = ('a','b','c','d','e','f')[$digit-10];
870 ($x, $y, $z) = (1, 2, 3);
881 (You can also do C<($x) x 2>, which is less useful, because it assigns to
886 the number of elements in the right-hand list -- the list from which
888 accommodate each element in the right-hand list.
891 my (@xyz, $x, $y, $z);
903 results differ according to whether the left-hand list -- the list being
904 assigned to -- has the same, more or fewer elements than the right-hand list.
906 ($x, $y, $z) = (1, 2, 3);
907 print "$x $y $z\n"; # 1 2 3
909 ($x, $y, $z) = ('al', 'be', 'ga', 'de');
910 print "$x $y $z\n"; # al be ga
912 ($x, $y, $z) = (101, 102);
913 print "$x $y $z\n"; # 101 102
917 If the number of scalars in the left-hand list is less than that in the
918 right-hand list, the "extra" scalars in the right-hand list will simply not be
921 If the number of scalars in the left-hand list is greater than that in the
922 left-hand list, the "missing" scalars will become undefined.
924 ($x, $y, $z) = (101, 102);
925 for my $el ($x, $y, $z) {
934 $x = (($foo,$bar) = (3,2,1)); # set $x to 3, not 2
935 $x = (($foo,$bar) = f()); # set $x to f()'s return count
963 ($x, $y, @rest) = split;
964 my($x, $y, %rest) = @_;
985 synonym for a comma, but it also arranges for its left-hand operand to be
1004 or for using call-by-named-parameter to complicated functions:
1006 $field = $query->radio_group(
1052 value from the end. In our example, C<$myarray[-1]> would have been
1053 5000, and C<$myarray[-2]> would have been 500.
1072 =head2 Multi-dimensional array emulation
1078 $foo{$x,$y,$z}
1082 $foo{join($;, $x, $y, $z)}
1087 X<slice> X<array, slice> X<hash, slice>
1094 ($him, $her) = @folks[0,-1]; # array slice
1105 @folks[0, -1] = @folks[-1, 0];
1112 ($folks[0], $folks[-1]) = ($folks[-1], $folks[0]);
1115 slicing, a C<foreach> construct will alter some--or even all--of the
1132 @c = (sub{}->())[0,1]; # @c has no elements
1141 printf "%-8s %s\n", $user, $home;
1145 is the number of elements on the right-hand side of the assignment.
1197 X<typeglob> X<filehandle> X<*>
1289 See L<perlvar> for a description of Perl's built-in variables and