Edward Wijaya said:
Subject: Printing Array's content with carriage return (\n)
A "carriage return" is the ASCII CR character.
A "line feed" is the ASCII LF character.
A "newline" (\n) is a *logical* end-of-line, and it is different
on different operating systems:
LF - *nix
CR - mac
CR+LF - windows (and many of the common protocols)
So your Subject is only accurate on a Mac.
I think you meant this instead:
Subject: Printing Array's content with newline (\n)
currently if I use the print command directly like this:
print "@myarray\n";
[snip]
is there anyway I can tweak the print command?
I dunno, but there are several ways to get what you want without
tweaking the print function/operator (not a "command").
Namely, it print out in vertical forms.
# tweek how arrays are interpolated, rather than print() itself
{ local $" = "\n"; # see perlvar.pod
print "@myarray\n";
}
or
# _say_ that you want them joined with newlines
print join("\n", @myarray), "\n";
I'd prefer the second one, it is more self-documenting.