Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2003-12-14 to 1 day

正規表現を使ったときの $n のスコープ

$1, $2, ... のスコープは現在のブロック内に限定されるようだ。 if (1) { "foobar" =~ /(foo)/; # $1 eq 'foo' } # $1 is undef