LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] urg...

[ILUG] urg...

Paul Jakma paulj at alphyra.ie
Fri Feb 1 20:13:22 GMT 2002


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





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell