Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^7: Using filepath method to identify an .html page

by blue_cowdawg (Prior)
on Jan 22, 2013 at 18:13 UTC ( #1014750=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Using filepath method to identify an .html page
in thread Using filepath method to identify an .html page

      (please do not get mad at me, i'am trying to code your solution into python code, which is easier to me)

Oh... I won't get mad at you. If you want to code this in Python, I don't do snakes. You're on your own. Why in the world would you ask about Python code in a Perl forum?


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re^7: Using filepath method to identify an .html page
Re^8: Using filepath method to identify an .html page
by Nik on Jan 22, 2013 at 18:19 UTC
    Perl is great, its just too tough for me. Python is more clear.
    I need your help

    1. to see in regards of "specification" if this was indeed possible.
    2. just wanted 1-line of Perl code to see it working, and then write the same 1-line in Python.

    Wouldn't something like the following work as intended WITHOUT custom function?
    pin = int( htmlpage.encode("hex"), 16 ) % 10000
    Can you please explain the differences to what i have posted opposed to your coding:
    foreach my $ltr(@ltrs){ $hash = ( $hash + ord($ltr)) %10000;
    I want to understand this.
          Perl is great, its just too tough for me. Python is more clear. I need your help

      Sorry, what part of "I don't do snakes" isn't clear?

          I want to understand this.

      Not that hard given the split that proceeds the code you quoted. Iterate over each element of the array and find the ordinal of the character in that element. Add the integer value of that ordinal to the previous value and perform a modulo arithmetic operation on the sum and store the sum back into the original scalar.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
      "...Perl is great, its just too tough for me. Python is more clear..."

      That's OK nik. But please ask Monty for further information. Yet another trap?

      I hope that helps. Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2014-08-29 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls