Stripping line breaks

2001-08-25 Thread Rory O'Connor
Another quick one - how can I easily strip line break characters from a variable? Thanks! providing the finest in midget technology -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Rory, Saturday, August 25, 2001, Rory O'Connor <[EMAIL PROTECTED]> wrote: ROC> Another quick one - how can I easily strip line break characters from a ROC> variable? see perldoc -f chomp Best wishes, Maximmailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail

Re: Stripping line breaks

2001-08-25 Thread Rory O'Connor
thanks all for your help. It is my understanding that chomp($var); will only strip the \n from the end of a string. I'm dealing with strings that could potentially be littered with newline characters. I have an o'reilly perl book, but it's not super clear on how to strip *all* newline character

RE: Stripping line breaks

2001-08-25 Thread Gibbs Tanton - tgibbs
If you always know it will be a \n, then you can do $str =~ tr/\n//d; -Original Message- From: Rory O'Connor To: [EMAIL PROTECTED] Sent: 8/25/2001 10:13 AM Subject: Re: Stripping line breaks thanks all for your help. It is my understanding that chomp($var); will only strip the \n

RE: Stripping line breaks

2001-08-25 Thread Rory O'Connor
can do >$str =~ tr/\n//d; > >-Original Message- >From: Rory O'Connor >To: [EMAIL PROTECTED] >Sent: 8/25/2001 10:13 AM >Subject: Re: Stripping line breaks > >thanks all for your help. It is my understanding that chomp($var); will >only strip the \n from the

Re[2]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Rory, Saturday, August 25, 2001, Rory O'Connor <[EMAIL PROTECTED]> wrote: ROC> thanks all for your help. It is my understanding that chomp($var); will ROC> only strip the \n from the end of a string. I'm dealing with strings ROC> that could potentially be littered with newline characters

Re[4]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Saturday, August 25, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? CS> You can. CS> $a =~ s!$/!!g; CS> Perl just gets confused with the /'s, you have to use alternate CS> delimiters. ok, what about "$!"

Re[6]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? >> >> CS> You can. >> >> CS> $a =~ s!$/!!g; >> >> CS> Perl just gets confused with the /'s, you have to use alternate >> CS> delimite

Re[8]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> >> >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? >> >> >> >> CS> You can. >> >> >> >> CS> $a =~ s!$/!!g; >> >> >> >> CS> Perl just gets confused with the /'s, you have to use alte

Re[10]: Stripping line breaks

2001-08-26 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: [] >> CS> or am I misunderstanding you? >> >> may be. >> example: >> >> $regex=; chomp $regex; >> $variable=; chomp $variable; >> $a =~ s!$variable!$regex!; >> CS> Well, in this case, I don't see a prob

Re: Re[2]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sat, 25 Aug 2001, Maxim Berlin wrote: > Hello Rory, > p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? You can. $a =~ s!$/!!g; Perl just gets confused with the /'s, you have to use alternate delimiters. Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Re[4]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: > Hello Christopher, > > Saturday, August 25, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: > >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? > > CS> You can. > > CS> $a =~ s!$/!!g; > > CS> Perl just gets confused with the /'s,

Re: Re[6]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: > Hello Christopher, > > Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: > > >> >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? > >> > >> CS> You can. > >> > >> CS> $a =~ s!$/!!g; > >> > >> CS> Perl just gets

Re: Re[8]: Stripping line breaks

2001-08-25 Thread Christopher Solomon
On Sun, 26 Aug 2001, Maxim Berlin wrote: > Hello Christopher, > > Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: > > CS> or am I misunderstanding you? > > may be. > example: > > $regex=; chomp $regex; > $variable=; chomp $variable; > $a =~ s!$variable!$regex!; > We

Re: Re[6]: Stripping line breaks

2001-08-28 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Maxim Berlin <[EMAIL PROTECTED]> whispered: | | well, ${ unassigned now... | And must remain unassigned, otherwise there is no way to disambiguate: print "$dayday" and print "${day}day" -spp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: Re[6]: Stripping line breaks

2001-08-28 Thread Jeff 'japhy/Marillion' Pinyan
On Aug 28, Stephen P. Potter said: >Lightning flashed, thunder crashed and Maxim Berlin <[EMAIL PROTECTED]> whispered: >| >| well, ${ unassigned now... >| > >And must remain unassigned, otherwise there is no way to disambiguate: > >print "$dayday" >and >print "${day}day" But you can use ${{} a

Re: Re[6]: Stripping line breaks

2001-08-28 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Jeff 'japhy/Marillion' Pinyan whispered: | On Aug 28, Stephen P. Potter said: | | >Lightning flashed, thunder crashed and Maxim Berlin <[EMAIL PROTECTED]> whispere > d: | >| | >| well, ${ unassigned now... | >| | > | >And must remain unassigned, otherwise