$15000 for one line of Perl Code

$15000 for one line of Perl Code

去Perl 论坛浏览,看到这个,贴出来, 鼓舞一下Perl的爱好者。

Description:          I got this from a guru pal. Though once you see it, it seems simple; and I don't doubt TIMTOWTDI. It stores the 'stat's of each file in the BEGIN block and restores them in the END block. As a Perl success story: a very slightly tweaked version (with a more elaborate substitution) did a job at work that our Windows NT contractor quoted us $15,000 to do. Viva la Perl.

perl -pi -e 'BEGIN { %s = map { $_ => [stat $_] } @ARGV} s/foo/bar/g;  END { for $f (keys %s) { utime(@{ $s{$f} }[8,9], $f) } }' [files]
tricky 啊
都是漂过阿
得到这个机会你必须掌握更多的东西
来漂一下
很夸张的说,... 改改内容和时间能值这么多钱?