Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Common Perl Pitfalls

by JavaFan (Canon)
on Apr 09, 2012 at 23:23 UTC ( #964226=note: print w/replies, xml ) Need Help??

in reply to Re^2: Common Perl Pitfalls
in thread Common Perl Pitfalls

The third solution isn't as portable, though.
cat is probably available on more platforms than perl is. Of course, Windows rules the world, and both cat and perl are ported to Windows -- and, AFAIK, neither comes standard with the OS. Unlike cat, perl is not included in the POSIX standard for shell utilities.

Why do you think redefining $/ as I did is a potential problem?
Well, you consider someone modifying the code to be a potential problem. Would if someone modifies your code, and adds a return after the first assignment to $/, but before the second? Would if someone wraps the code in an eval, and the read triggers an exception?

Replies are listed 'Best First'.
Re^4: Common Perl Pitfalls
by Joe_ (Beadle) on Apr 10, 2012 at 15:14 UTC

    Well, that's a tad too advanced for me at the moment. But thanks for sharing your insight. And I had no idea that cat was ported to Windows. I was never what you can call a Windows power user. Thankfully, I switched to Linux :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-22 02:16 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.