after the declaration of the function...my $iteminbasket = shoppingList(sweater)...imagine this is like a OO call to create a new $iteminbasket object, which declares some lexical variables etc (all black box stuff). Then...&iteminbasket("pair of shoes") ...imagine calls the &iteminbasket method of the created object. you passed it some data, but when you first created the object, it declared a lexical, so it has access to both. Hope this parallel helps a bit.