in reply to Re^2: Passing a bytestring from Perl to Inline::C as a 2d array
in thread Passing a bytestring from Perl to Inline::C as a 2d array
I am still troubled by the whole concept of the OP's approach. Instead of packing some things ("chars") into words for C to access on a byte per byte basis, run some regex or other Perl operation on those "things" and THEN run pack() if you need to! I see no need for 'C' here.
Perl has a very efficient char per char replacement operator called "tr". And also, 'a' + 1 REALLY does mean "b"! Just like in 'C'. I think that if we get to the real requirement, we will find that Perl will do it just fine. The sub() appears trivial enough that I see no need to go through the hassle of interfacing 2 languages.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Passing a bytestring from Perl to Inline::C as a 2d array
by BrowserUk (Patriarch) on Nov 14, 2009 at 15:56 UTC | |
by Marshall (Canon) on Nov 14, 2009 at 16:47 UTC | |
by BrowserUk (Patriarch) on Nov 14, 2009 at 18:01 UTC | |
by Marshall (Canon) on Nov 14, 2009 at 19:14 UTC | |
by BrowserUk (Patriarch) on Nov 14, 2009 at 21:39 UTC |