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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Arrays have many uses and sometimes perl programmers can overuse hashes, but as an ex-Tcl programmer myself I can give the advice to:
  1. use hashes when you can
  2. when an array is appropriate, use foreach, map and grep. Some perl programmers might overuse map and grep, but when they are good they are VERY good!
  3. if you find yourself using an array index ask yourself why - there is almost always a better way in perl
For the enlightenment of non-Tcl people, Tcl has only two types of data. Strings and lists. That's it. Even function calls are just a list where the first list value is the name (string) of a function (or proc) and the rest of the list values are the arguments (which may be, you guessed it, strings or lists).

The lists aren't even very convenient, vis. lsearch.

Don't think I'm bashing Tcl - it's very useful when you need a straightforward embeddable scripting language. You can even make it do very non-trivial things (vis. OpenACS) but it hurts.

upvar anyone?


In reply to Re^3: lsearch for perl? by aufflick
in thread lsearch for perl? by matt.tovey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-03-28 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found