Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Don't Write That In Perl!

by kyle (Abbot)
on Dec 19, 2007 at 15:48 UTC ( #657903=note: print w/replies, xml ) Need Help??

in reply to Don't Write That In Perl!

Something like ten years ago, I wrote a RADIUS authentication server in Perl. The RADIUS protocol involves sending blocks of binary data in UDP packets.

My skills being what they were ten years ago, I lived in constant fear that my carefully crafted numbers and strings would be converted from one to the other behind my back. I've sadly forgotten the details of this ordeal, but I've carried the "don't write a binary protocol handler in Perl" scars around with me ever since.

As I think about it now, if I were writing it today, I don't think I'd have much problem. I'd make a RADIUS packet object to abstract away all kinds of headaches. I still would have to study pack and unpack a while before I got it right, but I'd do a lot of testing to help guide my way.

Replies are listed 'Best First'.
Re^2: Don't Write That In Perl!
by polettix (Vicar) on Dec 20, 2007 at 02:03 UTC
    I had the same fear, probably derived from some convincement that "Perl is for text". I then had many occasions to be more than happy with Perl's abilities to treat binary data. And, by the way, one involved some RADIUS message exchange!

    Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2023-09-23 16:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found