Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: File parse

by myocom (Deacon)
on Dec 05, 2002 at 18:41 UTC ( #217850=note: print w/ replies, xml ) Need Help??

in reply to File parse

This is a perfect job for unpack. The following test code should prove helpful:

use strict; while (<DATA>) { chomp; my @array = unpack("A12A16A11A*", $_); # @array has 4 elements now print map("'$_'\n", @array); } __DATA__ 0x130005d 0x230f0 SNMP 0x130009c 0x1006b SnmpPif
"One word of warning: if you meet a bunch of Perl programmers on the bus or something, don't look them in the eye. They've been known to try to convert the young into Perl monks." - Frank Willison

Comment on Re: File parse
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2015-11-27 06:09 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (719 votes), past polls