CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
From Array to string

 



tallest1
Deleted

Jul 23, 2000, 5:42 AM

Post #1 of 3 (432 views)
From Array to string Can't Post

Is there a quick and easy way to turn an array into one a string?


$string = \@array; perhaps? (just a guess)


japhy
Enthusiast

Jul 23, 2000, 6:27 AM

Post #2 of 3 (432 views)
Re: From Array to string [In reply to] Can't Post

There is no general rule for converting an array to a string. What do you want?

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


$str = join "," => @array; # foo,bar,blat
$str = \@array; # a reference to @array
$str = "@array"; # actually join " " => @array;
</pre><HR></BLOCKQUOTE>


tallest1
Deleted

Jul 23, 2000, 6:35 AM

Post #3 of 3 (432 views)
Re: From Array to string [In reply to] Can't Post

I just need the contents of a file put onto a string. I have the contents in an array and I just needed to make it a string. I think the line of code on the bottom will do the trick.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives