Re: More loops



On 6/28/07, Jenda Krynicky <Jenda@xxxxxxxxxxx> wrote:
From: "Amichai Teumim" <amichai@xxxxxxxxxx>
snip
> foreach $elem (@array){
> print "$elem\n";
> }

This can be simplified to

print join("\n", @array), "\n";
snip

or (since this is Perl and TIMTOWTDI)

print map { "$_\n" } @array;
.



Relevant Pages

  • Re: Weird regexp problem
    ... What's in @array here? ... I'm still not clear what makes you think this is a regexp problem. ... MySQL executes the exact query as it receives from Perl. ...
    (comp.lang.perl.misc)
  • Re: Requesting advice how to clean up C code for validating string represents integer
    ... [Java to Lisp] ... [Perl to Lisp] ...
    (comp.lang.c)
  • Re: "Linked Lists" in Perl
    ... > Linked lists are normally implemented in Perl as hasrefs, ... It appears that it does since arrays are built in to perl. ... [snip for further study ... > an array'. ...
    (perl.beginners)
  • Re: How to use GUI: Win32::GUI If You Need Accessibility
    ... I will press a key to convert, and it should give me the converted rtf8/unicode text in another text box <snip> ... coming from a win32 api/C/C++ background. ... the exact font metrics that can be used to write resolution, font and DPI independent code in Windows apps. ... Perl will crash consistantly with a highly cryptic error message if you try to use the two at once. ...
    (comp.lang.perl.misc)
  • Re: How to use GUI: Win32::GUI If You Need Accessibility
    ... I will press a key to convert, and it should give me the converted rtf8/unicode text in another text box <snip> ... coming from a win32 api/C/C++ background. ... the exact font metrics that can be used to write resolution, font and DPI independent code in Windows apps. ... Perl will crash consistantly with a highly cryptic error message if you try to use the two at once. ...
    (comp.lang.perl.misc)