1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

open $file, '>', \"..." によるエラー

Posted at

open で書き込み先が読み取り専用の scalar の reference だった時の動作が 5.20 で変わったようです。

$ perl -e 'printf "%vd\n", $^V; open $file, ">", \""; print "No exception\n"'
5.14.2
No exception
$ perl -e 'printf "%vd\n", $^V; open $file, ">", \""; print "No exception\n"'
5.18.2
No exception
$ perl -e 'printf "%vd\n", $^V; open $file, ">", \""; print "No exception\n"'
5.20.0
Modification of a read-only value attempted at -e line 1.

今までエラーにならなかったのがバグだったようですね。敢えて書き込めない値を指定する意味はありませんが、巡り巡って実はというのはありそう。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?