Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Discipulus's library third cell

by Discipulus (Canon)
on Oct 16, 2020 at 09:48 UTC ( [id://11122900]=note: print w/replies, xml ) Need Help??


in reply to Discipulus's library second cell
in thread Discipulus

Tartaglia Pascal and Erathostenes

Perl is dead..

game

oneliners

perl idioms
  • stolen from busunsl's homenode
  • slurp a file:  my $contents = do { local (@ARGV, $/) = $filename; <> };
  • set even elements of @list to 'bla':  $_ % 2 or $list[$_] = 'bla' for 0..$#list;
  • getting indices sorted by value: my @indices = sort { $a[$a] <=> $a[$b] } 0..$#a;
  • initialize hash elements: @hash{@array} = (1) x @array
  • assign empty string defaults: $_ = '' for grep ! defined ( $foo, $bar, $baz );
  • blank padding: $str = pack('A40',$str);

some cool use of Perl

music and sounds

other useful homenodes

THIS IS THE LAST LINE

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-28 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found