Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Testing <>

by ikegami (Pope)
on Oct 03, 2011 at 15:44 UTC ( #929368=note: print w/ replies, xml ) Need Help??

in reply to Testing <>

The problem is that if there's no stdin and no command line args then the script just waits for input.

Just like cat, perl, sort, etc, etc, etc.

This is standard behaviour. Why does it matter to you? Both using -t and implementing a command line option that says there is no STDIN have their drawbacks.

Comment on Re: Testing <>
Re^2: Testing <>
by Anonymous Monk on Oct 04, 2011 at 08:31 UTC
    > Just like cat, perl, sort, etc, etc, etc.
    > This is standard behaviour.

    Yeah, I know and I don't like it.

    I still think, as I did 20 years ago when I first started using UNIX, that these sitting commands waiting for user input was pretty pointless.

    I've never felt the urge to type in 'sort' enter some values then excitedly hitting ^D to see the result.

      I never manually type in stuff, but I often copy-and-paste stuff into a program like sort (or a Perl oneliner) to munge data. That would not be possible with your approach.

        copy and paste? Ugh. Not in this life :-).

        As an aside; these utilites where written long before such new fangled functions were available.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-07-04 20:54 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (60 votes), past polls