Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

<> and @ARGV

by chip (Curate)
on Jul 28, 2000 at 15:23 UTC ( #24828=note: print w/replies, xml ) Need Help??

in reply to Subtle Quirks

If the connection between <> and @ARGV caught you by surprise, I'm afraid you haven't been reading very carefully.

And <> doesn't read from the files in @ARGV when there's nothing on stdin. It's the other way around. It reads from stdin only when @ARGV is empty (or contains "-").

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
RE: and @ARGV
by beppu (Hermit) on Jul 28, 2000 at 16:20 UTC

    Well, I went and looked at the Camel book again, and (to my surprise) the behaviour was documented. So yes -- I was not reading carefully, but...

    I still think I wasn't out of my mind to be surprised. The only things I've used the angled brackets for are reading from file handles and globbing. The connection between <> and @ARGV doesn't seem obvious to me. It's a special-case behaviour.

    I've only been w/ Perl for 1.5 years. Give me time. :)

      Sorry if I came off as being snippy. It's just that the use of <> and @ARGV is so common in just about every text-oriented Perl script ever written.... I was just surprised that your experience was so atypical. It's as if C programmer were surprised to find that if you're in a while, and you do a return, it gets you out. (BTW, that was a real question from a real former cow orker. He's probably writing VB these days.)

          -- Chip Salzenberg, Free-Floating Agent of Chaos

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://24828]
[james28909]: hi, im james, and i am bat shit crazy. xD
[james28909]: crazy or genius....
[Eily]: hi bat shit crazy, I'm eily
[LanX]: hello James
[james28909]: lol
[james28909]: i honestly didnt thin kanyone was going to respond, or was even paying attention :l
[Eily]: well if you say something like that someone has to pay attention by law
[Eily]: Murphy's law to be precise
LanX Anonymous Monks meeting
holli brings cookies to the meeting

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2017-12-13 17:42 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (373 votes). Check out past polls.