Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Perl hex substraction

by ELISHEVA (Prior)
on Feb 15, 2011 at 12:59 UTC ( [id://888224]=note: print w/replies, xml ) Need Help??


in reply to Perl hex substraction

A few tips to get you started:

  • '4d 2c 07 2c 77 b3 77 b3' isn't an array yet. By assigning it to an array variable as you did, you got an array with one element: a very long string. That probably wasn't what you intended. You'll need split to convert that string into an actual array.
  • Perl has two different ways to loop through array elements: for my $element (@somearray) {...} and for (setup counter; test counter; increment counter), as in C. You'll have to decide which is better to use.
  • When you loop through the array elements to print out each line, be careful about array indexes, especially the choice of the last one.
  • Put use strict;use warnings; at the top of your script if you haven't already. You'll have a better shot of knowing if you made a mistake in your choice of array indexes.
  • And don't forget hex

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-25 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found