Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Discipulus's library third cell

by Discipulus (Canon)
on Oct 16, 2020 at 09:48 UTC ( #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? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2023-03-29 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (71 votes). Check out past polls.

    Notices?