2008/9/26 Vyacheslav Karamov <[EMAIL PROTECTED]>:
> %attrs = shift if @_ > 2;
I doubt this can work correctly.
You may need:
%attrs = @_; # get the leftover arguments as hash's keys/values
or,
%attrs = %{+shift}; # get the third argument which is a hash reference
> But how could I preserve attributes order?
>
You can only get the fixed order with sorting a hash, see perldoc -f sort.
If you really need an original order, use an array instead.
ie, you can creat that a data structure:
( [key1, value1], [key2, value2] ... )
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/