RE: Question related Join function

2009-01-29 Thread sanket vaidya
Pl. see my soln in the original mail -Original Message- From: sanket vaidya [mailto:sanket.vai...@patni.com] Sent: Thursday, January 29, 2009 3:35 PM To: 'Anirban Adhikary' Cc: 'beginners@perl.org' Subject: RE: Question related Join function Hi Anirban, Join

RE: Question related Join function

2009-01-29 Thread sanket vaidya
Hi Anirban, Join works this way only. However u can accomplish your task as follows: -Original Message- From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com] Sent: Thursday, January 29, 2009 3:08 PM To: beginners@perl.org Subject: Question related Join function Dear List >

Question related Join function

2009-01-29 Thread Anirban Adhikary
Dear List I have doubt about the exact working of join function. I have written the following small code use strict; use warnings; my @array= join ("-k", @ARGV ); print "@array\n"; I am running the program as follows which producing the following output [anadhik...@strawbe

Re: "Join" Function

2005-08-09 Thread Christer Ekholm
"Vineet Pande" <[EMAIL PROTECTED]> writes: > hi, > In the following code which reads a file.txt (SEE ATTACHMENT) where I > am trying to understand how to put the DNA sequence in to a single > string... > > print "enter file with DNA sequence: "; > $seqfile = ; > chomp $seqfile; > unless ( open(DNA

Re: "Join" Function

2005-08-08 Thread John W. Krahn
Vineet Pande wrote: > hi, Hello, > In the following code which reads a file.txt (SEE ATTACHMENT) where I am > trying to understand how to put the DNA sequence in to a single string... > > print "enter file with DNA sequence: "; > $seqfile = ; > chomp $seqfile; > unless ( open(DNAFILE, $seqfile)

Re: "Join" Function

2005-08-08 Thread Jeff Eggen
>>> "Vineet Pande" <[EMAIL PROTECTED]> 08/08/2005 9:39:00 am >>> >@dna = ; [snip] >$dna = join( '', @dna); >print "$dna\n"; >THE OUTPUT IS EXACTLY THE SAME AS IN file.txt.Why don't we get the >string joined...of course i agree i must clean whitespace...bu then what is >expected out of join(

RE: "Join" Function

2005-08-08 Thread Ankur Gupta
Vineet Pande wrote: > hi, > In the following code which reads a file.txt (SEE ATTACHMENT) where I > am trying to understand how to put the DNA sequence in to a single > string... > > print "enter file with DNA sequence: "; > $seqfile = ; > chomp $seqfile; > unless ( op

"Join" Function

2005-08-08 Thread Vineet Pande
hi, In the following code which reads a file.txt (SEE ATTACHMENT) where I am trying to understand how to put the DNA sequence in to a single string... print "enter file with DNA sequence: "; $seqfile = ; chomp $seqfile; unless ( open(DNAFILE, $seqfile) ) { print "can't open!!\n"; exit; } @dna =

Re: newline or CR with join function

2004-02-27 Thread R. Joseph Newton
Gregg O'Donnell wrote: > Greetings all, > Instead of joining my scalars with ',' I'd like each to appear on a newline. > Replacing ',' with '\n' doesn't work. "\n" would. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

newline or CR with join function

2004-02-26 Thread Gregg O'Donnell
Greetings all, Instead of joining my scalars with ',' I'd like each to appear on a newline. Replacing ',' with '\n' doesn't work. Suggestions? Thanks! my $cfor_edu = join (',',$bs_alma,$bs,$ms_alma,$ms); - Do you Yahoo!? Get better spam protection with Yahoo! M

RE: newline or CR with join function

2004-02-26 Thread Bob Showalter
Gregg O'Donnell wrote: > Greetings all, > Instead of joining my scalars with ',' I'd like each to appear on a > newline. Replacing ',' with '\n' doesn't work. Suggestions? Thanks! > > my $cfor_edu = join (',',$bs_alma,$bs,$ms_alma,$ms); You need to enclose \n in double quotes. Inside single quot

RE: newline or CR with join function

2004-02-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Gregg O'Donnell wrote: > Greetings all, > Instead of joining my scalars with ',' I'd like each to appear on a > newline. Replacing ',' with '\n' doesn't work. Suggestions? Thanks! > Use double quotes as in "\n", since single quotes will not do the expansion for you. That is \n becomes j

Re: newline or CR with join function

2004-02-26 Thread Tim
At 09:36 AM 2/26/04 -0800, you wrote: Greetings all, Instead of joining my scalars with ',' I'd like each to appear on a newline. Replacing ',' with '\n' doesn't work. Suggestions? Thanks! my $cfor_edu = join (',',$bs_alma,$bs,$ms_alma,$ms); - Do you Yahoo!? Get b

Re: newline or CR with join function

2004-02-26 Thread Tim
Wrong answer, surry! It's that interpolation thing... At 12:45 PM 2/26/04 -0500, you wrote: At 09:36 AM 2/26/04 -0800, you wrote: Greetings all, Instead of joining my scalars with ',' I'd like each to appear on a newline. Replacing ',' with '\n' doesn't work. Suggestions? Thanks! my $cfor_edu = j

Re: newline or CR with join function

2004-02-26 Thread Rob Dixon
Tim wrote: > > You need another pair of parentheses (spelling -- Jenda??)... I can spell too! 'parentheses' is right! Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: newline or CR with join function

2004-02-26 Thread John W. Krahn
Rob Dixon wrote: > > Tim wrote: > > > > You need another pair of parentheses (spelling -- Jenda??)... > > I can spell too! 'parentheses' is right! That depends on if you are talking about one parenthesis or many parentheses. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mai

Re: newline or CR with join function

2004-02-26 Thread Rob Dixon
John W. Krahn wrote: > > Rob Dixon wrote: > > > > Tim wrote: > > > > > > You need another pair of parentheses (spelling -- Jenda??)... > > > > I can spell too! 'parentheses' is right! > > That depends on if you are talking about one parenthesis or many > parentheses. On most continents a 'pair' is

Re: Help needed on split & join function.

2001-11-02 Thread Jeff 'japhy' Pinyan
On Nov 2, eventualdeath said: >Statement 1 :- >@read = join ('\n', split(//, @read)); Well, you don't want to use join() here. join() takes a LIST and returns a STRING. If you use it, your array will have ONE element. That doesn't sound terribly useful. (And you've got '\n' where you probabl

Help needed on split & join function.

2001-11-02 Thread eventualdeath
Hi The script below does not do what I want which is to search a guestbook for a particular word and if that word appear, to show the records. Currently, after the script is run, it returns a blank page. I've confirmed that the fault lies with statement 1, in other words, if I replace statement1

Re: beginners join function question

2001-10-30 Thread Pete Sergeant
> } > $result=join(" ",@list); > > > Bye > > Walter > > > > hi, > > i've read and reread "learning perl"'s explanation of the join > > function but i still can't get join to do what i want. i have a fil

Re: beginners join function question

2001-10-30 Thread walter valenti
#!/usr/bin/perl #use strict; open (NAMES, "names.txt")||die "can't open names.txt $!"; while($lin=){ push (@list,$lin); } $result=join(" ",@list); Bye Walter > hi, > i've read and reread "learning perl"'s explan

beginners join function question

2001-10-30 Thread [EMAIL PROTECTED]
hi, i've read and reread "learning perl"'s explanation of the join function but i still can't get join to do what i want. i have a file which has one word on each line but some lines have more than one word on a line and are seperated by a space. i want to join