Hi,
Why wouldn't unpack work? unpack doesn't need terminations. Is the
string an exact count of 6 char strings?
I can't give you an exact example cause I don't know if your string is
unsigned, signed, unicode, etc. but look at the
the templates for pack and unpack and you should be able to grab
I've just tried to install Panther and found out my install disc is bad.
Apple said they'd send a new one in a few days, so that's the good news. The
bad news is that I was doing a clean install and it wiped out all my old
stuff. That's really no big deal either, I just reinstalled the old 10.1.2
On Sunday, December 28, 2003, at 05:28 PM, Bill Stephenson wrote:
So, If I get this right, I should...
1 sudo perl -MCPAN -e shell
2. Do NOT install libwww when it asks me too. (I did)
It should be okay to install a version later than 5.72, I provided a
patch to fix it. See
Hi Kim,
In addition to the pack() solutions you'll find eventually, here are a
couple substr() ones:
my @strings;
push @strings, substr($string, 0, 6, '') while length $string;
or,
my @strings = map substr($string, 6*$_, 6), 0..length($string)/6;
Adjust edge cases as necessary, these are
At 10:10 pm -0800 28/12/03, Kim Helliwell wrote:
I have a long string of characters ( 40,000 chars)
that I need to break up into strings of 6 chars each.
Is there a simple way to do this in Perl? unpack()
doesn't seem to be the right solution; there are no
terminations for the strings I'm after.
I have a long string of characters ( 40,000 chars)
that I need to break up into strings of 6 chars each.
Is there a simple way to do this in Perl? unpack()
doesn't seem to be the right solution; there are no
my $alphabet = join( '', 'A'..'Z' );
my @chunks = unpack( (A6)*, $alphabet );
print
After much searching and grumbling, I found Thilo Planz's post on
building CamelBones 0.2 under Panther
(http://www.nntp.perl.org/group/perl.macosx/6383). After getting this
to work, I thought I would type up more complete directions that work
with Xcode and post a new archive for people
On Dec 28, 2003, at 10:10 PM, Kim Helliwell wrote:
I have a long string of characters ( 40,000 chars)
that I need to break up into strings of 6 chars each.
Is there a simple way to do this in Perl? unpack()
doesn't seem to be the right solution; there are no
terminations for the strings I'm
On Mon, Dec 29, 2003 at 09:03:27AM -0800, R. Hannes Niedner ([EMAIL PROTECTED]) wrote:
my $string = 'string_of_40k_chars';
my @strings = $string =~ /.{6,6}/g;
my $remainder = substr($string, -1, length($string)%6);
You mean /.{6}/ instead of /.{6,6}/, I think. The latter will indeed
work,
On Dec 29, 2003, at 12:47 PM, Andy Lester wrote:
On Mon, Dec 29, 2003 at 09:03:27AM -0800, R. Hannes Niedner
([EMAIL PROTECTED]) wrote:
my $string = 'string_of_40k_chars';
my @strings = $string =~ /.{6,6}/g;
my $remainder = substr($string, -1, length($string)%6);
You mean /.{6}/ instead of
On Dec 29, 2003, at 2:57 PM, Zach Lipton wrote:
After much searching and grumbling, I found Thilo Planz's post on
building CamelBones 0.2 under Panther
(http://www.nntp.perl.org/group/perl.macosx/6383). After getting this
to work, I thought I would type up more complete directions that work
Is unpack the more
efficient (faster, or less memory requiring) way to do this?
Does it matter?
If it does, use Benchmark to find out.
If it doesn't, then the question is noise.
Premature optimization is the root of all evil. Unnecessary
optimization is, by definition, premature.
xoa
--
On Monday, Dec 29, 2003, at 13:28 US/Pacific, Andy Lester wrote:
Premature optimization is the root of all evil. Unnecessary
optimization is, by definition, premature.
Incorrectly anticipating future necessary optimization is the root of
all evil.
Premature optimization is the root of all evil. Unnecessary
optimization is, by definition, premature.
Incorrectly anticipating future necessary optimization is the root of
all evil.
So if it matters in the future, go right ahead and refactor it. The
change is minor. Barring that, write
At 4:01 PM -0600 12/29/03, Andy Lester wrote:
Premature optimization is the root of all evil. Unnecessary
optimization is, by definition, premature.
Incorrectly anticipating future necessary optimization is the root of
all evil.
So if it matters in the future, go right ahead and refactor it.
On Dec 29, 2003, at 8:36 PM, Jeff Lowrey wrote:
At 4:01 PM -0600 12/29/03, Andy Lester wrote:
So if it matters in the future, go right ahead and refactor it. The
change is minor. Barring that, write the code that is most clear.
The first two versions are always throw aways.
Is that because of
16 matches
Mail list logo