On Apr 5, 2004, at 9:40 AM, [EMAIL PROTECTED] wrote:
In a message dated 4/5/2004 7:52:33 AM Eastern Daylight Time, [EMAIL PROTECTED] writes:Hi People
I'm trying to get a grip on passing @_ to subroutines. Or rather NOT passing it.
I have a package:
sub HLOM::Links::new { my ($class, %arg) = @_; my $userid = 0; if ($arg{userid}) {$userid = int $arg{userid};} bless { _UserID => $userid, _LinkID => 0, _longmessage => "", _shortmessage => "", _error => "" }, $class; }
and several subroutines.
These subroutines are called externally ie HLOM::Links->FindLink(LinkID
=> $id);
I have seen shift used in Subroutines like: "NumberOfApples = shift(@_);",
any reason for writing the subroutine that way?
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>