Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: "open" Best Practices

by swl (Curate)
on Jul 13, 2019 at 03:45 UTC ( #11102771=note: print w/replies, xml ) Need Help??

in reply to "open" Best Practices

Thanks for the write-up, it's very useful. The first para can be read to imply that the not-so-good options are currently best practices.

You will see styles of open such as "open FILE, $filename;" or "open(LOG, ">$filename") || die "Could not open $filename";" in many places. These mainly come from versions of Perl before 5.6.0 (released in 2000), because that version of Perl introduced lexical filehandles and the three-argument open. Since then, they have become a best practice, for the reasons below.

Perhaps reword "they have become best practice" to something like "the three argument open has become a best practice".

Replies are listed 'Best First'.
Re^2: "open" Best Practices
by haukex (Chancellor) on Jul 13, 2019 at 06:13 UTC

    I thought about how to make it more clear without repeating myself too much, so I hope I've improved the wording now. Thank you for pointing this out!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2020-02-26 20:01 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (117 votes). Check out past polls.