Please explain @{$y}

2008-01-22 Thread bootleg86 bootleg86
Hi, I came across this construct foreach $i ( @{$y} ) { #do something } Is @ referring to some default array that doesn't need to be declared? Also it's using the associative version of an array? I always thought only hashes were associative. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: Can't understand this code snippet

2008-01-18 Thread bootleg86 bootleg86
Thanks all! I was wondering why the author didn't just call rand. I checked the rest of the source and it's just used as a unique identifier. So using rand would have been much easier. > If that were my program, running under any modern perl version, I'd > exploit the fact that Perl's random numb

Can't understand this code snippet

2008-01-18 Thread bootleg86 bootleg86
Hi, I can't for the life of me figure out what this is trying to do $token = $$ ^ unpack "%L*", `ps -A | "./bin/gzip" Just seems to be it's trying to generate some random number. I only know it's trying to XOR the process ID. What does this part do? unpack "%L*", `ps -A | "./bin/gzip" Thanks --