The first line has syntax error,
print need's
a comma or a period between } and "\n". I think you meant
this:
my $columns = [ qw (one two three) ]; # sample data is GOOD
print join "\t",@{$columns}. "\n";
print join ("\t",@{$columns}). "\n";
I dropped OUT
, because it doesn't matter if we are using
STDOUT or another handle. So, the first line prints out "3"
while the second line prints out the elements of $columns
joined by tabs.
What happened to the first line? Precendance my friend, the
dot causes @{$columns} to be evaluated in scalar context,
leaving join only one element to well, join: "3\n".
That's why i like to use a comma instead:
print join "\t",@{$columns}, "\n";
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
F--F--F--F--F--F--F--F--
(the triplet paradiddle)
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.