Building labs and debugging

God I think the hardest part of perl and the most time I wasted using the language are REFERENCES. I just wish I had read perlretut sooner…
After you learn referencing and dereferencing the topic is pretty ho-hum but – if you are new to perl it is daunting.
Look at this:
push( @{ $localdb{$hash} }, $filepath );
Wow? What the hell is that? Well its a hash of arrays:
45cfa668c6a58b933c7962fd22d3ad30cf381ed201d5777f134f7f5bbc7728f6 => { “file path one”, “filepath two”, }
In my program hashtree all the files are referenced by hash, each hash stores an array listing all the occurrences of that file in a data structure (the directory you fire hashtree at). This allows me to only upload or download one copy of a file. Which is handy if you NEED to keep all of your files but are PAYING for storage.
So back to the weird line noise. the $localdb{$hash} references the scalar value in the hash. The @{} dereferences the array reference that is the value of the key $localdb{$hash}. Then the item $filepath is pushed onto the array.
Anyway perl references are hard to get your head around but very powerful.
I finally have hashtree now at version 0.8 re-written and functional finally. I hope to add AWS S3 support soon as well as file encryption.


I am still studying for my exam and have finished more reviews. I feel as tho I have forgotten more than I have learned. I am currently using Packet Tracer to build labs and have just been expanding the same lab. I want to make it as large as possible and will continue to add sections based on what I am reviewing at the time.
Screenshot from 2017-11-06 21-05-39.png

Leave a comment

Your email address will not be published. Required fields are marked *