Upgrade to Pro — share decks privately, control downloads, hide ads and more …

postfix dereference 徹底攻略 / effective postfix de...

mackee
March 30, 2018

postfix dereference 徹底攻略 / effective postfix dereference

Gotanda.pm #16

mackee

March 30, 2018
Tweet

More Decks by mackee

Other Decks in Programming

Transcript

  1. ୭ˠ • twitter: @mackee_w • GitHub: mackee • kuiperbelt/kuiperbelt :

    WebSocketศར܅ • ࠷ۙPerl Hackers Hubʹςετͱ͔ͷهࣄΛॻ ͍ͨ
  2. hash slicing my $hashref = { k1 => "v1", k2

    => "v2", k3 => "v3" }; # ී௨ͷσϦϑΝϨϯε͔ΒͷϋογϡεϥΠε my ($v1, $v3) = @{$hashref}{qw/k1 k3/}; # postderefͰϋογϡεϥΠε my ($v1, $v3) = $hashref->@{qw/k1 k3/};
  3. postderef_qq my $hashref = { k1 => “v1", k2 =>

    "v2", k3 => "v3" }; print "[$hashref->@{qw/k1 k3/}]\n"; # => [v1 v3]
  4. csvΈ͍ͨʹग़ͨ͠Γ my @columns = qw/c1 c2 c3/; my $data =

    [ { c1 => "aa", c2 => "bb", c3 => "cc" }, { c1 => "dd", c2 => "ee", c3 => "ff" }, { c1 => "gg", c2 => "hh", c3 => "ii" }, ]; $" = ","; print "@columns\n"; print "$_->@{@columns}\n" for @$data;