Code Comments
Programming Forum and web based access to our favorite programming groups.I see many examples in the camel book where a subroutine takes one argument and the one argument is an array ref. my (foo_ref) = shift; There is however at least one example where it is my foo_ref = shift; I am trying to figure out if this matters. What would shift care about list context? shift should still yield one thing an array ref??? See page 356 in the camel book, and page 224. (I think). matthewsacks1415@yahoo.com ________________________________________ __________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Post Follow-up to this messageMatthew Sacks wrote: > I see many examples in the camel book where a > subroutine takes one argument and the one argument is > an array ref. > > my (foo_ref) = shift; > > There is however at least one example where it is > > my foo_ref = shift; > > I am trying to figure out if this matters. What would > shift care about list context? shift should still > yield one thing an array ref??? See page 356 in > the camel book, and page 224. (I think). > matthewsacks1415@yahoo.com shift() returns a scalar in either list context or scalar context so both statements do the same thing. John -- use Perl; program fulfillment
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.