Re: unpack returning an array?

2005-03-07 Thread $Bill Luebkert
Ed Chester wrote: > Hi again - > > Thanks to Chris, Lloyd, $Bill, Dave, Paul and all - > - this construct does *mostly* what I want: > > $MyArray[0] = [ unpack('C*',$buffer) ]; > > (for completeness, I wasn't having a problem dereferencing; I was checking > contents of $MyArray with > Data:

Re: Capturing package "source"

2005-03-07 Thread Sisyphus
Lloyd Sartor wrote: I've used ppm and it's great. However, I need to capture the Perl modules that I've used on a project so the software environment can be recreated at some later time. How can I capture Perl packages (on my local machine) that can later be installed using ppm? With perl 5.6

Re: Capturing package "source"

2005-03-07 Thread Chris Wagner
The ppm server is just a web directory. U can use wget to dl all the .ppd files and the tarballs, or just the ones u want. Then u have ur own local repository that u can use offline. Then cd to that dir and run ppm, then add it to the repositoy list with rep add local dirname. Dirname can be a

RE: unpack returning an array?

2005-03-07 Thread Chris Wagner
Why do want each element to be a 2 byte WORD? If the original data is in WORDs then u would import it that way. read INPUT, $buf, 1024; @words = $buf =~ m/(..)/g; or @{$MyArray[$line]} = $buf =~ m/(..)/g; Now each element is a 16 bit packed binary value. To turn that into a number u use unpack.

Re: IO::Socket::INET Handle problem

2005-03-07 Thread Sisyphus
Julian Brown wrote: foreach $x_socket (keys %all_connections) { $hashref = $all_connections{$x_socket}; $socket = $hashref->{'socket'}; $fn = fileno ($socket); $fna = fileno ($x_socket); print "FN ($fn) ($fna)\n"; } The contents of $socket and $x_socket are identical and are of

RE: Capturing package "source"

2005-03-07 Thread stuart arnold
Title: Message one way is to run 'perl -d', and then enter 'v' as a command line. that will display all modules and revs eg: perl -d -e 'print' > v 'Carp.pm' => 'C:/Program Files/MDT Software/PERL/lib/Carp.pm''Carp/Heavy.pm' => 'C:/Program Files/MDT Software/PERL/lib/Carp/Heavy.pm''Devel/

Capturing package "source"

2005-03-07 Thread Lloyd Sartor
I've used ppm and it's great. However, I need to capture the Perl modules that I've used on a project so the software environment can be recreated at some later time. How can I capture Perl packages (on my local machine) that can later be installed using ppm? Thanks, Lloyd __

IO::Socket::INET Handle problem

2005-03-07 Thread Julian Brown
I am running ActiveState Perl 5.8.0 on Win2K and Win2K3 This one has totally confused me and I figure it has something to do with handle references but am not sure. If I need to I will post all of the code, but for simplicity I am only posting the relevant portions only. I do an accept on a lis

RE: unpack returning an array?

2005-03-07 Thread Lloyd Sartor
> What I still cannot get it to do is extract them as hex words This I don't understand. The unpacked number is stored in 8 memory bits. Displaying these 8 bits as decimal, hex, or binary is for human convenience. Use printf if you want to display in hex.

RE: unpack returning an array?

2005-03-07 Thread Ed Chester
Hi again - Thanks to Chris, Lloyd, $Bill, Dave, Paul and all - - this construct does *mostly* what I want: $MyArray[0] = [ unpack('C*',$buffer) ]; (for completeness, I wasn't having a problem dereferencing; I was checking contents of $MyArray with Data::Dumper.) 'C*' works great and chucks

Re: Help needed for a beginner in perl and in programming in general.

2005-03-07 Thread n6
perl.org and perl.com along with: http://www-130.ibm.com/developerworks/linux has alot of good info on perl. -Nex6 Ahmed Khater wrote: Dear list members: First of all, I am very sorry for the cross-posting of my message and if my message seems of-topic for some Perl lists to which I have just sub

RE: unpack returning an array?

2005-03-07 Thread Chris Wagner
Maybe ur having trouble dereferencing the unpacked array. U need to take a slice out of @MyArray. $buffer = pack('C*',0x7c,0x45,0x3e,0x02); $MyArray[0] = [ unpack('C*',$buffer) ]; print $MyArray[0]; print join " ", @{$MyArray[0]}; ARRAY(0x1555220) 124 69 62 2 At 06:39 AM 3/7/05 -0800, Ed C

Re: eval a file inside a script

2005-03-07 Thread Lloyd Sartor
that's beautiful...thanks "$Bill Luebkert" <[EMAIL PROTECTED]> 03/07/2005 09:19 AM                 To:        Lloyd Sartor <[EMAIL PROTECTED]>         cc:        perl-win32-users@listserv.ActiveState.com         Subject:        Re: eval a file inside a script Lloyd Sartor wrote: > > I

Re: eval a file inside a script

2005-03-07 Thread Rhesa Rozendaal
Lloyd Sartor wrote: Is there an easier or more concise way to eval a script file inside another script than the following? open WCFG,'<.\waveform_conf.pl'; @cfg = ; close WCFG; eval "@cfg"; Yes, either "do" or "require" are what you need. do 'waveform_conf.pl'; is probably sufficient for

Re: eval a file inside a script

2005-03-07 Thread $Bill Luebkert
Lloyd Sartor wrote: > > Is there an easier or more concise way to eval a script file inside > another script than the following? > > open WCFG,'<.\waveform_conf.pl'; > @cfg = ; > close WCFG; > eval "@cfg"; Have you tried do './waveform_conf.pl'; -- ,-/- __ _ _ $Bill Luebker

eval a file inside a script

2005-03-07 Thread Lloyd Sartor
Is there an easier or more concise way to eval a script file inside another script than the following? open WCFG,'<.\waveform_conf.pl'; @cfg = ; close WCFG; eval "@cfg"; ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsu

RE: unpack returning an array?

2005-03-07 Thread Lloyd Sartor
I think you want to use 'C4' (or 'C*' or whatever) instead of 'H8' to get an array of bytes. $buffer = pack('C*',0x7c,0x45,0x3e,0x02); $MyArray[0] = [ unpack('C*',$buffer) ]; "Ed Chester" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 03/07/2005 08:39 AM                 To:        "Paul

Re: unpack returning an array?

2005-03-07 Thread $Bill Luebkert
Ed Chester wrote: >>How about: >>my @array = unpack ("H8", $buffer); >>$MyArray[$i] = [EMAIL PROTECTED]; >>Or even: >>$MyArray[$i] = [ unpack ("H8", $buffer) ]; > > > Thanks for the suggestion - you're right, unpack is seeing scalar context. > Your two ideas are the same, they do indeed assign

RE: unpack returning an array?

2005-03-07 Thread Ed Chester
> How about: > my @array = unpack ("H8", $buffer); > $MyArray[$i] = [EMAIL PROTECTED]; > Or even: > $MyArray[$i] = [ unpack ("H8", $buffer) ]; Thanks for the suggestion - you're right, unpack is seeing scalar context. Your two ideas are the same, they do indeed assign the output of pack to a (1

RE: unpack returning an array?

2005-03-07 Thread Paul Sobey
Might be wrong about this but you're giving unpack a scalar context with $MyArray[$i]; How about: my @array = unpack ("H8", $buffer); $MyArray[$i] = [EMAIL PROTECTED]; Or even: $MyArray[$i] = [ unpack ("H8", $buffer) ]; ? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAI

unpack returning an array?

2005-03-07 Thread Ed Chester
Hello all - I posted sometime last week about ways of parsing image file data and doing image processing 'raw' without external software/libraries. I'm working on this at byte level now and will post the basic code to populate an array with pixel values when its cleaned up. Meanwhile, I have

FW: Help needed for a beginner in perl and in programming in general.

2005-03-07 Thread Mike Rabbitt
Mike Rabbitt Hi Chad - Check this link out - http://mccammon.ucsd.edu/~ycheng/roberts-perl-tutorial.htm It was the first tutorial I did many moons ago and it really helped get me up and running with Perl HTH Mike Rabbitt I.T. Applications Manager Legal Advice Bureau: 0845-055-050

RE: Help needed for a beginner in perl and in programming in gene ral.

2005-03-07 Thread Chad I. Uretsky
One of my favorites for beginners is "Perl 5 by Example," which you can find here: http://affy.blogspot.com/p5be/index.htm I'd also recommend the O'Reilly books, "Learning Perl" and "Programming Perl." Chad Uretsky Lead Network and Security Engineer NetIQ Corporation [EMAIL PROTECTED] Direct: 71