while(!<>) verses until($_=<>)

Posted on 2006-04-14
Last Modified: 2010-03-05
(In "Gory Details")

Shouldn't these two whiles operate

  while(!<>) {
    print;        # echos ^Zs to the screen

  until($_=<>) {
    print;        # echos only the newline
Question by:hank1
    1 Comment
    LVL 84

    Accepted Solution

    while( !($_=<>) ){
    is like
     until($_=<>) {
        print;        # echos only the newline
    but not like
      while(!<>) {
        print;        # echos ^Zs to the screen
    which does not assign $_

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now