On Fri, 1 Feb 2002, kevin lyda wrote:
> anyone else play with bit shifting in perl? it doesn't seem to be
> working so far.
what about the vec() function..
the below is wrong. ($e ends up size of 3/4 of $s.) but.. hey, i'm
really tired:
#!/usr/bin/perl
$s = "1234567adfasdfl;werl;ksdfkl;sdfwe";
for ( $offset = 0; $offset < length($s) ; $offset += 6) {
$e .= vec($s, $offset, 4) . vec($s, $offset+4, 2) . 32;
}
but proper use of vec() might be what you're after.
--paulj
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!