Professional Web Applications Themes

Extra newline characters. - PERL Beginners

I'm working the exercises out of the "Learning Perl" book, but I'm doing so through a shell account from a Window$ box into a UNIX environment. I'm experiencing an oddity wherein I'm getting, what I think are, extra newlines or carriage returns in my code as I type it in the shell through a telnet session. This phenomenon, of course, throws off the results of the code. Has anyone experienced this? Is there a solution? I've tried several adjustments in the code I'm writing by using an extra 'chomp' or' chop', but this method is hit-and-miss. There may be some ...

  1. #1

    Default Extra newline characters.

    I'm working the exercises out of the "Learning Perl" book, but I'm doing so through a shell account from a Window$ box into a UNIX environment. I'm experiencing an oddity wherein I'm getting, what I think are, extra newlines or carriage returns in my code as I type it in the shell through a telnet session. This phenomenon, of course, throws off the results of the code.

    Has anyone experienced this? Is there a solution? I've tried several adjustments in the code I'm writing by using an extra 'chomp' or' chop', but this method is hit-and-miss. There may be some ENV variable or something else I can use to get some consistency going.

    TIA
    Ron




    ---------------------------------
    Do you Yahoo!?
    vote. - Register online to vote today!
    Ron Guest

  2. #2

    Default Re: Extra newline characters.

    On Fri, 8 Oct 2004 11:11:26 -0700 (PDT), Ron Smith
    <com> wrote: 

    What UNIX environment? What terminal emulator? I know that Solaris
    includes a handy utility called dos2unix that will help pull out
    annoying extra characters from DOS created text files. Perhaps this
    utility is found in other UNIXy OSs as well.

    --Errin
    Errin Guest

  3. #3

    Default Re: Extra newline characters.

    I'm not sure what you mean. I'm new at logging into shell accounts through a 'telnet' session. I'm on a Window$ 2000 box, using 'telnet' to log into 'sdf.lonestar.org'. The first thing that appears at login is the following:

    NetBSD/alpha (sdf) (ttypu)

    Does that help?

    Ron


    Errin Ln <com> wrote:
    On Fri, 8 Oct 2004 11:11:26 -0700 (PDT), Ron Smith
    wrote: 

    What UNIX environment? What terminal emulator? I know that Solaris
    includes a handy utility called dos2unix that will help pull out
    annoying extra characters from DOS created text files. Perhaps this
    utility is found in other UNIXy OSs as well.

    --Errin

    --
    To unsubscribe, e-mail: org
    For additional commands, e-mail: org






    ---------------------------------
    Do you Yahoo!?
    Yahoo! Mail Address AutoComplete - You start. We finish.
    Ron Guest

  4. #4

    Default RE: Extra newline characters.

    Try:

    $ stty sane
    $ TERM=vt100; export TERM

    That will give you a common default terminal emulation. I would
    recommend getting a better windows client terminal. Some good free ones
    are putty and teraterm. Cygwin is a complete linux emulation package
    the runs on windows and includes decent terminal emulators (and I
    believe perl comes with it).


    ------------------------------------------------------------------------------

    This email is confidential and may be legally privileged.

    It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, isunauthorized.

    If you are not the intended recipient, any disclosure, copying, distributionor any action omitted or taken in reliance on it, is prohibited and may beunlawful. If you believe that you have received this email in error, pleasecontact the sender, delete this e-mail and destroy all copies.

    ================================================== ============================

    Kevin Guest

  5. #5

    Default Re: Extra newline characters.

    On Fri, 8 Oct 2004, Ron Smith wrote:
     

    Let's try to nip bad habits in the bud before they take hold.

    Do you have SSH access to this machine ?

    Since you just said the host by name -- that was brave! -- I was able to
    take a look at it and *boy* do you have a lot of ports open. Finger?
    RPC? Truly the person running this computer is incredibly brave :-)

    The telnet protocol is extremely insecure. Among other things, all
    traffic, including passwords, is transmitted as clear text, so anyone
    watching packets stream by can see everything you're doing. Danger!

    This server is also running SSH, which is much, much safer to use than
    Telnet. If possible, you should use SSH and forget telnet ever existed.

    -> $ ssh blah.blah.blah.org
    The authenticity of host 'blah.blah.blah.org (300.400.500.600)'
    can't be established.
    RSA key fingerprint is So:me:-c:ha:in:-o:f-:le:tt:er:s-:an:d-:di:gi:ts.
    -> Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'blah.blah.blah.org,300.400.500.600'
    (RSA) to the list of known hosts.
    blah.blah.org's password:
    -> [ENTER YOUR PASSWORD HERE; IT ISN'T ECHOED BACK TO YOU. --chd]

    The -> lines indicate places you need to type in a response.

    If all goes well here, you'll get a prompt after the password.

    And tell whoever is running this machine that they should lock it down.



    --
    Chris Devers
    Chris Guest

  6. #6

    Default Re: Extra newline characters.


    atleast he omited login+pwd. :)
    ----- Original Message -----
    From: Chris Devers <com>
    Date: Friday, October 8, 2004 3:03 pm
    Subject: Re: Extra newline characters.
     
    > accounts 
    > 'telnet' 
    > login 
    >
    > Let's try to nip bad habits in the bud before they take hold.
    >
    > Do you have SSH access to this machine ?
    >
    > Since you just said the host by name -- that was brave! -- I was
    > able to
    > take a look at it and *boy* do you have a lot of ports open.
    > Finger?
    > RPC? Truly the person running this computer is incredibly brave :-)
    >
    > The telnet protocol is extremely insecure. Among other things, all
    > traffic, including passwords, is transmitted as clear text, so
    > anyone
    > watching packets stream by can see everything you're doing. Danger!
    >
    > This server is also running SSH, which is much, much safer to use
    > than
    > Telnet. If possible, you should use SSH and forget telnet ever
    > existed.
    > -> $ ssh blah.blah.blah.org
    > The authenticity of host 'blah.blah.blah.org (300.400.500.600)'
    > can't be established.
    > RSA key fingerprint is So:me:-c:ha:in:-o:f-:le:tt:er:s-:an:d-
    > :di:gi:ts. -> Are you sure you want to continue connecting
    > (yes/no)? yes
    > Warning: Permanently added 'blah.blah.blah.org,300.400.500.600'
    > (RSA) to the list of known hosts.
    > blah.blah.org's password:
    > -> [ENTER YOUR PASSWORD HERE; IT ISN'T ECHOED BACK TO YOU. --chd]
    >
    > The -> lines indicate places you need to type in a response.
    >
    > If all goes well here, you'll get a prompt after the password.
    >
    > And tell whoever is running this machine that they should lock it
    > down.
    >
    >
    > --
    > Chris Devers
    >
    > --
    > To unsubscribe, e-mail: org
    > For additional commands, e-mail: org
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>
    >
    >
    >[/ref]

    mgoland@optonline.net Guest

  7. #7

    Default Re: Extra newline characters.

    On Fri, 8 Oct 2004 net wrote:
     

    Thank Cthulu for minor disasters...


    --
    Chris Devers
    Chris Guest

  8. #8

    Default Re: Extra newline characters.

    Whoa! Easy big fella!

    sdf.lonestar.org is a *FREE* public access system.

    No reason for secrecy or alarm. Notice the *FREE*
    and remember, you get what you pay for.

    And they do tell you about using ssh for access
    when you initially sign up.


    On Fri, 8 Oct 2004, Chris Devers wrote:
     
    >
    > Let's try to nip bad habits in the bud before they take hold.
    >
    > Do you have SSH access to this machine ?
    >
    > Since you just said the host by name -- that was brave! -- I was able to
    > take a look at it and *boy* do you have a lot of ports open. Finger?
    > RPC? Truly the person running this computer is incredibly brave :-)
    >
    > The telnet protocol is extremely insecure. Among other things, all
    > traffic, including passwords, is transmitted as clear text, so anyone
    > watching packets stream by can see everything you're doing. Danger!
    >
    > This server is also running SSH, which is much, much safer to use than
    > Telnet. If possible, you should use SSH and forget telnet ever existed.
    >
    > -> $ ssh blah.blah.blah.org
    > The authenticity of host 'blah.blah.blah.org (300.400.500.600)'
    > can't be established.
    > RSA key fingerprint is So:me:-c:ha:in:-o:f-:le:tt:er:s-:an:d-:di:gi:ts.
    > -> Are you sure you want to continue connecting (yes/no)? yes
    > Warning: Permanently added 'blah.blah.blah.org,300.400.500.600'
    > (RSA) to the list of known hosts.
    > blah.blah.org's password:
    > -> [ENTER YOUR PASSWORD HERE; IT ISN'T ECHOED BACK TO YOU. --chd]
    >
    > The -> lines indicate places you need to type in a response.
    >
    > If all goes well here, you'll get a prompt after the password.
    >
    > And tell whoever is running this machine that they should lock it down.
    >
    >
    >
    >[/ref]
    Dennis Guest

  9. #9

    Default Re: Extra newline characters.

    On Fri, 8 Oct 2004 11:51:34 -0700 (PDT), Ron Smith
    <com> wrote: 
    > so through a shell account from a Window$ box into a UNIX environment. I'm
    > experiencing an oddity wherein I'm getting, what I think are, extra newlines
    > or carriage returns in my code as I type it in the shell through a telnet
    > session. This phenomenon, of course, throws off the results of the code. 
    > adjustments in the code I'm writing by using an extra 'chomp' or' chop', but
    > this method is hit-and-miss. There may be some ENV variable or something
    > else I can use to get some consistency going. 
    >
    > What UNIX environment? What terminal emulator? I know that Solaris
    > includes a handy utility called dos2unix that will help pull out
    > annoying extra characters from DOS created text files. Perhaps this
    > utility is found in other UNIXy OSs as well.
    >
    > --Errin
    >[/ref]

    Hi again, Ron,

    First, try to bottom post. People on this list will snap at 'ya if your don't!

    Yes, that helps, it tells us what OS you're writing for, and also how
    you connect to that OS (DOS telnet). Now, where do you develop your
    scripts? Do you write your scripts on the Win2000 machine and then
    copy/ftp them over to the UNIX box to test/implement? The more
    details you give us the better able we'll be to help!

    --Errin
    Errin Guest

  10. #10

    Default Fwd: Extra newline characters.

    ---------- Forwarded message ----------
    From: Errin Ln <com>
    Date: Fri, 8 Oct 2004 15:36:28 -0500
    Subject: Re: Extra newline characters.
    To: Ron Smith <com>


    On Fri, 8 Oct 2004 13:24:22 -0700 (PDT), Ron Smith
    <com> wrote:
    <<SNIP>> 

    You're welcome!
     

    My guess, in this case, is that you're terminal emulator (DOS) is
    having trouble talking to the shell. I would try some of the
    suggestions from Kevin:
     
     

    I'm wondering what shell you are using? you can type:
    # echo $SHELL
    on most UNIX accounts, this will be set for you and will contain your
    default shell. Kevin's suggestions will work with most shells, but
    Cshell would likely complain. I think your problem is more shell and
    terminal-emulation related, rather than Perl related. I'd suggest a
    good new-to-UNIX book, If I were you. Do you have a SysAdmin you can
    contact with problems or help-needed questions? If so, I would
    explain your problem to her/him as she/he (wow, that's annoying, huh?
    trying to keep PC is a pain!) would be most familiar with your
    environment and terminal options.

    I also agree with Kevin that a good terminal emulation program could
    help you. To follow Chris' advice, the really good ones will support
    SSH, as well. I'd suggest Putty:
    http://www.chiark.greenend.org.uk/~sgtatham/putty/

    --Errin

    PS:
    I forgot to mention some further BeginnersPerl mailing list
    etiquette: Try to CC the list with your replies, as well. Some
    people will complain if you don't! Keep up the UNIX and Perl
    learning!
    Errin Guest

  11. #11

    Default Extra newline characters.

    Thanks all. The problem was at the begining of the 'TELNET' session, I have to type in: UNSET CRLF.



    ---------------------------------
    Do you Yahoo!?
    Yahoo! Mail Address AutoComplete - You start. We finish.
    Ron Guest

  12. #12

    Default Re: Extra newline characters.

    On Fri, 8 Oct 2004 15:25:36 -0700 (PDT), Ron Smith
    <com> wrote: 


    You're welcome!

    and

    welcome to the list!!

    --Errin
    Errin Guest

Similar Threads

  1. Help - Extra Characters
    By ErinT in forum Macromedia ColdFusion
    Replies: 4
    Last Post: June 3rd, 05:18 PM
  2. Unicode and newline characters in XML text sond via Web Service
    By Krzysztof Fink-Finowicki via .NET 247 in forum ASP.NET Web Services
    Replies: 6
    Last Post: January 23rd, 05:29 PM
  3. extra characters in XML export
    By Rowan_Ferguson@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: August 3rd, 01:17 PM
  4. Removing newline characters
    By Amit in forum PHP Development
    Replies: 2
    Last Post: January 25th, 05:28 AM
  5. Simple Regex question (~[^newline characters])
    By dk_sz in forum PHP Development
    Replies: 2
    Last Post: July 6th, 07:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139