Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Re: There's Only One Way To Do It

by jdporter (Canon)
on Apr 07, 2004 at 15:53 UTC ( #343314=note: print w/replies, xml ) Need Help??

in reply to Re: There's Only One Way To Do It
in thread There's Only One Way To Do It

I hear ya. I once worked on a project where I inherited some perl code from someone whose knowledge of arrays was limited to the following:
  • Iteration: for $line ( @lines )
  • Read from file: @lines = <FILE>;
  • Write to file: print FILE @lines;
His code was rife with hacks like
# add the new item to the list: open TMP, "> $tmp"; print TMP @items; print TMP $new_item; close TMP; open TMP, "< $tmp"; @items = <TMP>; close TMP;
It baffles and amazes me that someone could know how to read and write arrays to file, but not have learned about the push operator! Also disgusting was the fact that this person didn't know enough to put that snippet in a subroutine. He C&P'd it (and every other hack he ever devised) rampantly throughout his code.

The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2016-10-23 12:26 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.