I am not really sure if I understand what you are trying to say (but it is very interesting) - so thanks for that.
For me I am trying to figure out why perl handles the cases differently.
My position is that what happens in the first case is the proper thing to do.
You want to open a file for reading and you supply undef as a file-name: Error. That's how I think it should be.
And I still cannot quite see why the cases supplied should be different.
And there is this:
perl -MDevel::Peek -e'Dump($ARGV[0])'
SV = NULL(0x0) at 0x55a8c4978560
REFCNT = 2147483639
FLAGS = (READONLY,PROTECT)
perl -MDevel::Peek -e'Dump(undef)'
SV = NULL(0x0) at 0x55923aa70560
REFCNT = 2147483639
FLAGS = (READONLY,PROTECT)
Both have the same high refcount, but the addresses seem to differ - why is that?
Is this a can of worms that one should not open?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.