Jason Gottshall wrote:
Andrew Ford wrote:
  
I have recently been putting refcards.com together again 
    
...snip...
  
It still needs some work to finish it off, so any suggestions 
on how to fill the remaining space on the card, or 
corrections gratefully received.
    

Wow, this is fantastic. Below are a few things I have on my own "cheat
sheet" that aren't on the refcard. Somebody holler if any of these are
bogus.

Virtual methods:
scalar.chunk(size) # negative size chunks from R to L
scalar.list # treat as a single-item list
scalar.size # returns "1", as if it was single-item list

hash.exists(key) # does key exist?
hash.defined(key) # same as hash.key.defined?
hash.size # number of pairs
hash.item(key) # same as hash.key (when key is _expression_)
hash.list # returns [ key1, val1, key2, val2, ... ]

list.grep(re) # list of items matching re
list.unique # list of unique elements, retains order
list.merge(list1, [list2, ...] ) # combines all lists into new one
list.slice(from, to) # returns subset
list.splice(offset, len, [list]) # modifies list

Special variable "loop" methods:
size, index, prev, next

Filters:
html_entity # fix all entites, not just < and > (which is what "html"
does)
html_line_break # convert "newline" chars to <br>
ucfirst
lcfirst

Also, some suggestions regarding directive syntax:
[% INSERT filename %] # I don't think you can "insert" a block
[% MACRO name[(varlist)] directive %] # optional "prototype" syntax for
predeclaring variables to be localized in param list
[% USE [var =] plugin[(params}] %] # optionally assign return value to a
variable
Maybe the [var = value ...] option could be added to the PROCESS and
WRAPPER directives?

Thanks for sharing this with us, it's a big help!
Jason
  

Added most of those corrections as well as a couple from Andy W, and have put a new version up on refcards.com.  I'll add the corrections I missed tomorrow (too tired to think now).

Andrew
-- 
Andrew Ford,  Director    Pauntley Prints / Ford & Mason Ltd
[EMAIL PROTECTED]   South Wing, Compton House 
pauntley-prints.co.uk     Compton Green, Redmarley  Tel: +44 1531 829900
ford-mason.co.uk          Gloucester, GL19 3JB      Fax: +44 1531 829901
refcards.com/cronolog.org Great Britain          Mobile: +44 7785 258278

Reply via email to