in reply to Record creation in nested loops

I'd do:
@$AssetRecord{@ExcelColumns} = @Data;
It's called a hash slice.

And you seem to think that while (<@array>) { ... } is sensible code, when it really is quite awful. Don't use that type of idiom. If you want to loop over an array, use for.

_____________________________________________________
Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Record creation in nested loops
by Ninthwave (Chaplain) on Mar 10, 2005 at 14:22 UTC

    I don't particularly think that while (<@array>){....} is sensible code it was just a fragment of what I have tried. I use foreach more often than not. But out of curiousity why do you refer to the while(<@array>) {...} as awful code?

    "No matter where you go, there you are." BB
      It uses <...> in its file-globbing context. This means any elements in @array that contain wildcard characters for your shell will be expanded into all matching filenames. It also means that if any of your elements have whitespace in them, they'll be split on that whitespace.
      @array = ("this", "is not", "cool"); print "[$_]" while <@array>; # [this][is][not][cool]
      It's misuse of an operator, and I'm irked that Perl lets it fly without even alerting you to the potential gaffe you're making.
      _____________________________________________________
      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart