Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How has your coding style changed over the years?

by choroba (Cardinal)
on Aug 07, 2022 at 21:45 UTC ( [id://11146008]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      print int rand $x;
    
  2. or download this
      return if substr($x, 0, 2) eq substr($y, 0, 2); # Second pair not ne
    +eded.
    
  3. or download this
      my $first = first { $x > 0 } @array;  # List::Util
    
  4. or download this
      is_deeply $response->{content}, bag(1 .. 10);  # Test::Deep
    
  5. or download this
      $object->frobnicate;
    
  6. or download this
      use Exporter qw{ import };  # sub name
      my $from_roman = {qw{ I 1 II 2 III 3 IV 4 V 5 }};
      my $primes = [qw[ 2 3 5 7 11 13 17 19 ]];
    
  7. or download this
      while (my $item = $iter->next) {
    
  8. or download this
      chomp( my @lines = <> );
    
  9. or download this
      my $first  = $array[0];
      my $middle = $array[ $#array / 2 ];
    
  10. or download this
      my $arr = [1, 2, 3];
      my @directions = qw( left right );
      my @items = @{ $ref{items} };
    
  11. or download this
      if ($x > 0) {
          say 'Positive';
      } elsif ($x < 0) {
    ...
      } else {
          say 'Zero';
      }
    
  12. or download this
      my @planets = qw( Mercury Venus Earth Mars
                        Jupiter Saturn Uranus Neptune );
    
  13. or download this
      while ($x = $iter->next) {
          next if $x > $threshold;
    
          $x -= $correction;
      }
    
  14. or download this
      return    if $x > $threshold;
      return    if $err || ! $success;
      return [] if $not_found;
    
      my $result = count($x);
    
  15. or download this
      my @normalised = map lc, @words;
    
  16. or download this
      my %pairs = map { $_ => value($_) } @labels;
    
  17. or download this
      sub new {
          my ($class, $name) = @_;
          return bless { name => $name }, $class
      }
    
  18. or download this
      __PACKAGE__
    
  19. or download this
      sub second { $_[0][1] }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11146008]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found