in reply to (MeowChow) Re4: Perlish way to do an ls *.sf
in thread Perlish way to do an ls *.sf

print join $/, <*.$ext>;

print map$_.$/,<*.$ext>;
Same length, but also adds newline to last item.

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
(MeowChow) Re6: Perlish way to do an ls *.sf
by MeowChow (Vicar) on Mar 30, 2002 at 00:41 UTC
    I wasn't really making a golf point, just trying to simplify. No need to mess with localized perlvars just for newline.

    For golf, you can take out the spaces:

    print join$/,<*.$ext>;
    If you want really that final newline, we can still cut out two chars from your last one:
    print$_.$/for<*.$ext>;
    and of course remove the trailing semicolons :)
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
Re: Re: (MeowChow) Re4: Perlish way to do an ls *.sf
by zengargoyle (Deacon) on Mar 30, 2002 at 00:43 UTC

    I'd rather:

    print join $/,<*$ext>,'';

    Avoiding concatenation and adding a newline to the last item.