update:
Sorry I didn't understand your question carefully at first.
Any way, let me complete my reply with four-argument open (To be precise, four or more arguments, as Perl will flatten that LIST for us, but we are okay, as that's the last argument.):
open FILEHANDLE,MODE,EXPR,LIST
When LIST is specified, it contains a list of arguments that would be passed into "a command". Make it plain, this is only meaningful, when you open a pipe, and the list of argument will be passed to the child process.
The usage of LIST might be extended in the future, but (again) currently this syntax is only meaningful when used with pipe.
However, the bad news is that this feature is documented, but not implemented in 5.8. When you try to test, it tells you that open with list syntax is not implemented.
Don't mix this up with what blokhead talked about, in Perl 5.8, it is perfectly right to use |, -|, |- etc as MODE argument.
Original reply
(I misunderstood John's post at the beginning, and thought he wanted to know about the mode ;), any way, I just leave it here, as it might be useful to other monks)
Two examples:
- Open for reading:
open(AFILE, "<", "afile.txt");
This is the same as saying:
open(AFILE, "<afile.txt");
- Open with utf8 layer (if your file contains unicode):
open(AFILE, "<:utf8", "afile.txt");
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.