But think about what not having those variables means.

No other language I know of allows the application programmer to write a standard piece of code:

while( <$fh> ) { processRecord( $_ ); }

And with that standard, recognisable, picked-up-in-the-first-week-of-programming construct, can process any file. Regardless of whether it uses *nix conventions, or dos conventions or Mac conventions or network/socket conventions. Or if it is uses fixed length records. Or paragraphs.

The same common construct deals with all these by simply changing the value of one variable.

You want scope for errors?

Most runtime libraries have readline() and writeline() subs or methods, but the record separator is hardwired.

Want to read or write a *nix file on a dos machine, or MAC file on a *nix machine? Then you have to implement it yourself and move to using low-level reads() or getc() and doing your own buffering. And repeat the exercise for each input type. And each output type. And every programmer on every platform has to do the same.

Every facility Perl provides is there for a reason: to simplify the life of the programmer and move as much code into the thoroughly tested and supported RTL and core as possible. The more the core does, the less the programmer has to.

And all the current vogue for rejecting and deprecating Perl's features, on the basis of OO orthodoxy, or one-size-fits-all "best practices" does, is create the need for every programmer to re-invent those features themselves.

And that simply creates the scope for errors, not prevents them! And all for the sake of less need to educate and cheaper programmers. You see a good ROI in that?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^7: winter games, perl, ice and bling by BrowserUk
in thread winter games, perl, ice and bling by mobiusinversion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.