in reply to Re^4: splitting a sequence using unpack
in thread splitting a sequence using unpack

If all I wanted to do was printing them out, I'd do:
print $s;
Or, considering what I want to print was stored in a file, I'd skip the perl part, and do:
cat file
I mean, if I were to optimize this snippets for some limited functionality, I might as well do the optimization right.

Replies are listed 'Best First'.
Re^6: splitting a sequence using unpack
by BrowserUk (Patriarch) on Mar 01, 2005 at 13:21 UTC

    True, but I habitually have $\ set to \n, the snippet I posted prints 3 chars per line, not a single long line as both your's would do.

    I didn't think of it being an optimisation either. Just when I want to print a substring of a string, I tend to think of substr.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.