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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
How to trim data?



Nov 26, 2000, 6:11 PM

Post #1 of 2 (766 views)
How to trim data? Can't Post

I have got a data with spaces infront and back of it.I want to get that data alone .Is there any function in Perl so that i can extract my data from it.
I have to extract the data till a new line is found.
for eg:type 6 5

so i want to extract 6 and 5 from this line and i have already located type by pattern matching.
Will you please help me to solve this problem.I have been lokking through some Perl tutorials but i didn't get any solution.
I think that you can help me in this matter.

Thanking You in advance.


Nov 26, 2000, 6:34 PM

Post #2 of 2 (766 views)
Re: How to trim data? [In reply to] Can't Post

It might be as simple as:

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

@fields = split ' ', $string;

Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher


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

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