Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Append to file or create file depending on input filename.

by graff (Chancellor)
on Nov 20, 2009 at 23:24 UTC ( #808547=note: print w/replies, xml ) Need Help??


in reply to Re: Append to file or create file depending on input filename.
in thread Append to file or create file depending on input filename.

I wasn't sure about the evaluation happening in the right order, but I tested it and it seems to work. :)

Well, I would be inclined to worry about that too, and unless I find the bit of perl documentation that actually spells out the "official policy" about evaluation order for arguments in a subroutine call, I would consider a successful run on my own machine to be no guarantee that it'll work on other machines, or on my machine after I upgrade to the next Perl release.

And rather than take the time to hunt down that (possibly obscure) snippet of documentation, it would be easier for me just to add one more line of code and one more variable, so I don't have to worry about it.

  • Comment on Re^2: Append to file or create file depending on input filename.

Replies are listed 'Best First'.
Re^3: Append to file or create file depending on input filename.
by bellaire (Hermit) on Nov 21, 2009 at 13:08 UTC

    This is a good point. I don't know how likely this behavior is to change in the future or between platforms, only that the rough rule of thumb is that evaluation happens left-to-right. However, as this mailing-list thread shows, that's a rule subject to many exceptions.

    And, as you might have suspected, the discussion there seems to indicate that the order of evaluation is not well-defined, so perl simply does what it does.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://808547]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2019-11-15 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (85 votes). Check out past polls.

    Notices?