in reply to Re: Building XML with tab delimited
in thread Building XML with tab delimited

Well, tried it but made no difference :(

Replies are listed 'Best First'.
Re^3: Building XML with tab delimited
by AnomalousMonk (Archbishop) on Aug 11, 2016 at 12:50 UTC

    What AnonyMonk is getting at is that you define  sub buildXMLElements() { ... } to take no arguments and then pass it a bunch of arguments. This only works because you call the function in a way that defeats prototype checking. If you had enabled warnings, Perl would have chided you about this situation:

    c:\@Work\Perl\monks>perl -le "use warnings; use strict; ;; func('hi there'); ;; sub func () { print @_; } " main::func() called too early to check prototype at -e line 1. hi there

    Prototypes can be very useful for what they're useful for. But why use them in a way that defeats their purpose and also means you have to disable warnings so it won't nag you endlessly? Please see Prototypes in perlsub, and also the very enlightening Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen.


    Give a man a fish:  <%-{-{-{-<

      Thank you for that great explanation....I will get rid of the () where not needed.