I dont really understand what it is you are asking for. However, to do math in shell, you can use the bc command or you can pass in your values to Awk and let Awk do the work for you. These are probably your best bet for floating point math calculations. See man awk and man bc for more information. For greater information regarding Awk, see this site --> Awk GNU Documentation
Im not really a Perl guy (wish I was!), but if the context of the variable is a string, then you could split the string into its component parts. Try a substring or split. Continuing with your modulus approach, divide by 10 to move the decimal point to the left.
How about using a regular expression (in this case any single character) to create an array using split. I dont really write any Perl (just hack around sometimes), so I am not really sure if this will work!
From a math standpoint, suppose the zip code is 12345 and you want to isolate the that 3. Drop the two right most digits by dividing by 10^2. 12345 / 100 = 123. Now use your modulus trick.
The substr() function takes 3 arguments, the string, offset (position, start from 0), and length. For example, substr("Hello", 1, 2) will return the string "el". The details can be obtained from the man page "man perlfunc".
will look it up>> but i have one more question! how do i access the perl tutorial man pages.. I have tried everything and learning some perl would help with this type of issue.. any suggestions on how i can access this tutorial or any of the information on perl itself,, I can't seem to make heads ot tails of trying to get into the man pages of the perl section.. gnu/linux (fediora core 2 vs 2.6.8-1.521).
thanx moxxx68..