talexb has asked for the wisdom of the Perl Monks concerning the following question:
I've been working on some ETL stuff, and was getting an unexpected result similar to Trimming unpack'ed strings.
Specifically, why does Perl trim trailing spaces when doing an unpack operation? A simple example follows:
I'm expecting this to set @foo to the following:@foo = unpack ( 'A6A4', 'Hello Joe ' )
because the spaces help retain the length of the string. However, instead I'm getting('Hello ','Joe ')
Why?('Hello','Joe')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unpack unexpectedly trimming trailing spaces
by stevieb (Canon) on Nov 19, 2015 at 22:29 UTC | |
by talexb (Chancellor) on Nov 20, 2015 at 14:24 UTC | |
by AnomalousMonk (Archbishop) on Nov 20, 2015 at 17:36 UTC | |
by stevieb (Canon) on Nov 20, 2015 at 22:14 UTC | |
by AnomalousMonk (Archbishop) on Nov 21, 2015 at 17:09 UTC |