Changeset 9679


Ignore:
Timestamp:
12/14/09 01:18:51 (2 years ago)
Author:
azawawi
Message:

Updated perlopref.pod to latest version

Location:
trunk/Padre/share/doc/perlopref
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/share/doc/perlopref/README

    r9082 r9679  
    1111precedence group there is no sorting). 
    1212 
    13 INSTALLATION ============ 
     13INSTALLATION 
     14============ 
    1415 
    1516Copy the perlopref.pod file into a place when Perl can find it (i.e. someplace 
  • trunk/Padre/share/doc/perlopref/perlopref.pod

    r9080 r9679  
    6969=head3 See also 
    7070 
    71 L</qq(X)>, L<perlvar/$">, L<perlop/Quote and Quote‐like Operators> 
     71L</qq(X)>, L</'X'>, L</q(X)>, L<perlvar/$">,  
     72and L<perlop/Quote and Quote‐like Operators> 
    7273 
    7374=head2 qq(X) 
     
    124125=head3 See also 
    125126 
    126 L</"X">, L<perlvar/$">, L<perlop/Quote and Quote‐like Operators> 
     127L</q(X)>, L</'X'> L</"X">, L<perlvar/$">,  
     128and L<perlop/Quote and Quote‐like Operators> 
     129 
     130=head2 'X' 
     131 
     132=head3 Class 
     133 
     134This belongs to L<perlop/Terms and List Operators (Leftward)> and  
     135L<perlop/Quote and Quote‐like Operators>. 
     136 
     137=head3 Description 
     138 
     139This is the single quote operator (aka the non-interpolating string operator). 
     140It creates a string literal out of X. 
     141 
     142To place a C<'> inside the string, you must escape it with C<\>: 
     143 
     144    my $quote = 'He said \'I like quotes.\''; 
     145 
     146Unlike double quoted strings, that is the only escape sequence. 
     147 
     148For a full discussion of how strings work, see  
     149L<perlop/Quote and Quote-like Operators>.  
     150 
     151=head3 Example 
     152 
     153    my $name   = 'World'; 
     154    my $string = 'Hello, $name!\n'; #$string is now "Hello \$name!\n"; 
     155 
     156=head3 See also 
     157 
     158L</">, L</qq(X)>, L</q(X)>, L<perlvar/$">,  
     159and L<perlop/Quote and Quote‐like Operators> 
     160 
     161=head2 q(X) 
     162 
     163=head3 Class 
     164 
     165This belongs to L<perlop/Terms and List Operators (Leftward)> and  
     166L<perlop/Quote and Quote‐like Operators>. 
     167 
     168=head3 Description 
     169 
     170This is the generalized single quote operator (aka the generalized 
     171non-interpolating string operator).  It creates a string literal out of X. 
     172 
     173The delimiters C<()> are chosen by the user and may consist of either 
     174bracketing characters (C<< q<> >>, C<q()>, C<q{}>, and C<q[]>) or matching 
     175characters (C<q##>, C<qaa>, etc.).  It is generally used to allow the user 
     176to avoid having to escape characters: 
     177 
     178     my $quote = q/He said 'I like quotes.'/; 
     179 
     180If the delimiter is not a bracketing pair, or if the brackets are 
     181unbalanced, you will need to escape the delimiter with C<\> if you wish to 
     182have that character in the string: 
     183 
     184    my $quote = q{I have too many \} characters}; 
     185 
     186But it is often better to just choose a delimiter that does not conflict 
     187with the string: 
     188 
     189    my $better = q/I have too many } characters/; 
     190 
     191Unlike double quoted strings, the escaping of the delimiter is the only 
     192escape. 
     193 
     194For a full discussion of how strings work, see  
     195L<perlop/Quote and Quote-like Operators>.  
     196 
     197=head3 Example 
     198 
     199    my $name   = "World"; 
     200    my $string = q/Hello, $name!\n/; #$string is now "Hello \$name!\n"; 
     201 
     202=head3 See also 
     203 
     204L</"X">, L</'X'>, L</q(X)>, L<perlvar/$">,  
     205and L<perlop/Quote and Quote‐like Operators> 
     206 
     207=head2 qw(X) 
     208 
     209=head3 Description 
     210 
     211This is the quote word operator.  It creates a list of strings.  The 
     212individual strings are whitespace separated.  It does not interpolate. 
     213 
     214The delimiters C<()> are chosen by the user and may consist of either 
     215bracketing characters (C<< qw<> >>, C<qw()>, C<qw{}>, and C<qw[]>) or 
     216matching characters (C<qw##>, C<qwaa>, etc.).  It is generally used to allow 
     217the user to avoid having to escape characters: 
     218 
     219     my @list = qw/'a' 'b' 'c'/; #@list is now ("'a'", "'b'", "'c'") 
     220 
     221If the delimiter is not a bracketing pair, or if the brackets are 
     222unbalanced, you will need to escape the delimiter with C<\> if you wish to 
     223have that character in the string: 
     224 
     225    my @broken   = qw{I have too many } characters};        #broken 
     226    my @works    = qw{I have too many \} characters};       #works 
     227    my @balanced = qw{this works {} because it is balanced} #works 
     228 
     229But it is often better to just choose a delimiter that does not conflict 
     230with the string: 
     231 
     232    my $better = qw/I have too many } characters/; 
     233 
     234Unlike double quoted strings, the escaping of the delimiter is the only 
     235escape. 
     236 
     237=head3 Example 
     238 
     239    my @a = qw/ a b c /;     #@a is now ("a", "b", "c", "d") 
     240    my @b = qw/ $foo $bar /; #@b is now ('$foo', '$bar') 
     241 
     242=head3 See Also 
     243 
     244L</'X'>, L</q(X)>, and L<perlop/Quote and Quote‐like Operators> 
    127245 
    128246=head2 X[Y] 
Note: See TracChangeset for help on using the changeset viewer.