Re: Strange chop behaviour

2001-05-01 Thread Paul
--- Francis Henry <[EMAIL PROTECTED]> wrote: > Craig, > > I'm a newbie too, but isn't the function "chomp"? chomp is the one Craig seems to need, but there's also a chop. chop() alsways knock a character off; chomp only pops input record seperators (like newline, or CRLF, depending on what the

Re: Strange chop behaviour

2001-05-01 Thread Craig Moynes/Markham/IBM
TED], [EMAIL PROTECTED] i.org> Subject: Re: Strange chop behaviour

Re: Strange chop behaviour

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Craig Moynes/Markham/IBM" <[EMAIL PROTECTED] bm.com> whispered: | open ( ERR, "; You are mixing things here you don't want to mix. This should just be: while ($in = ) { You *can* mix these, but there is no real reason to. Especially not in your sample c

Re: Strange chop behaviour

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Collin Rogowski" <[EMAIL PROTECTED]> w hispered: | They exist both. | chop removes the last character. | chomp removes the last character if it's newline. Let's get this straight and correct. chomp removes the input record separator ($/). This may or may

Re: Strange chop behaviour

2001-05-01 Thread Collin Rogowski
They exist both. chop removes the last character. chomp removes the last character if it's newline. To the original problem: I had a similar problem once. Maybe your file has DOS-Newlines which are to characters (\r\n). If you chop, you keep \r at the end which could mess around with printing it

Re: Strange chop behaviour

2001-05-01 Thread Greg Meckes
chomp removes only the newline (what you want I think) and chop removes the last character #instead of chop $in; #Try: chomp $in; Greg __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: Strange chop behaviour

2001-05-01 Thread Francis Henry
Craig, I'm a newbie too, but isn't the function "chomp"? Francis Craig Moynes/Markham/IBM wrote: > A little background. I am running an scp process within a perl script and > redirecting the error to a file (scp_err). I then read in the lines of > this file and attempt to place them in an e

Strange chop behaviour

2001-05-01 Thread Craig Moynes/Markham/IBM
A little background. I am running an scp process within a perl script and redirecting the error to a file (scp_err). I then read in the lines of this file and attempt to place them in an error string to log to syslog. Code Sample: #!/usr/bin/perl -w open ( ERR, "; chop $in; pr