Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Unpack unexpectedly trimming trailing spaces

by talexb (Chancellor)
on Nov 20, 2015 at 14:24 UTC ( [id://1148238]=note: print w/replies, xml ) Need Help??


in reply to Re: Unpack unexpectedly trimming trailing spaces
in thread Unpack unexpectedly trimming trailing spaces

Thanks -- I did look pretty carefully in the Camel, p. 800 and on, for this type of information, because it struck me as unusual that Perl would do this type of cleanup automatically. It's very handy, of course, but not what I expected. And, of course, the expected behavior is available with 'a' instead of 'A'.

Yet another thing I've learned .. and another tricky interview question to stash away for future use (I'm looking at you, RD. :) ).

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^3: Unpack unexpectedly trimming trailing spaces
by AnomalousMonk (Archbishop) on Nov 20, 2015 at 17:36 UTC
    ... I did look pretty carefully in the Camel ...

    As a general rule, I think it's best to look at the on-line pack documentation or, better yet, at your local perldoc -f pack (and see also perlpacktut).


    Give a man a fish:  <%-{-{-{-<

      Even though unpack states to look to pack for further info, would it be a sensible use of time if I updated unpack to reflect at least info that's directly relevant? Thoughts?

      My thinking is that it might not be overly clear if someone uses unpack without using pack first.

        ... info that's directly relevant ...

        Info that's directly relevant to unpack? The unpack docs already seem to have a lot (all?) of that. What did you have in mind? The first sentence in unpack already says "unpack does the reverse of pack ...". There is little discussion of the  TEMPLATE and its specifiers, but then in the fourth paragraph, this: 'The TEMPLATE has the same format as in the "pack" function.'

        It might be more newbie-frendly if, in each pack/unpack documentation entry, there were, very close to the beginning, a paragraph to the effect

        "pack and unpack are complementary functions; please consult (un)pack and perlpacktut for a full understanding of these functions."
        but I'm not sure this would necessarily be much more helpful than what is already there; at some point, one must just carefully RTFM.

        Update: Fixed mispeling: complemenetary vice complementary.


        Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148238]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-29 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found