Changeset 12637 for docs/Perl6/Perl5

Show
Ignore:
Timestamp:
08/24/06 02:37:04 (2 years ago)
Author:
markstos
Message:

Document in Differences.pod that eval {} in Perl5 is try{} in Perl6.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Perl5/Differences.pod

    r12634 r12637  
    147147    Now:    loop ($i=0; $i<10; $i++) { ... } 
    148148 
    149 =head2 Global Variables have a twigil. 
     149=head2 Global Variables have a twigil 
    150150 
    151151Yes, a twigil. It's the second character in the variable name. For globals, 
     
    156156 
    157157For details, see L<S02/"Names and Variables">. 
     158 
     159=head2 eval {} is now  try {} 
     160 
     161Using C<eval> on a block is now replaced with C<try>. 
     162 
     163    Was:  eval {  
     164            # ...  
     165          };  
     166          if ($@) {  
     167            warn "oops: $@"; 
     168          }  
     169    Now:  try  { 
     170             # ... 
     171             CATCH { warn "oops: $!" } 
     172          }  
     173 
     174CATCH provides more flexiblity in handling errors.  
     175See L<S04/"Exception_handlers"> for details. 
    158176 
    159177=head1 SEE ALSO