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
>>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 );



Use here scalar instead of array.
$current_ans = join ("-k", @ARGV );

Then

$final_ans = "-k"."current_ans";

Then use $final_ans in your script for further processing using regex or by
converting $final_ans into arrray.




>>print "@array\n";

>>I am running the program as follows which producing the following output
[anadhik...@strawberry test_prog]$ perl te>>>>st1.pl 1 2 3
>>1-k2-k3
>>[anadhik...@strawberry test_prog]$

>>Now my question is why the beginning -k is missing from the output and how
It can be solved?


_____________________________________________________________________ 

This e-mail message may contain proprietary, confidential or legally privileged 
information for the sole use of the person or entity to whom this message was 
originally addressed. Any review, e-transmission dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. If you have received 
this e-mail in error kindly delete this e-mail from your records. If it appears 
that this mail has been forwarded to you without proper authority, please 
notify us immediately at netad...@patni.com and delete this mail.
_____________________________________________________________________

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to