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: Beginner:
Parser of a line or word into letters

 



jbs
Deleted

Jun 9, 2000, 1:46 PM

Post #1 of 3 (367 views)
Parser of a line or word into letters Can't Post

I need to get a function that will parse a word into its letter.. Am I taking the proper approach by using the ParseWords function??? I think that this is really easy, I just can seem to get over this! I neet this so that I can import a file and ommit the lines that have comments!
-jbs


#THIS PROGRAMS CHECK TO SEE IF THE INPUT FILE HAS ANY COMMENT AND DISPLAYS ANYTHING OTHER THAN COMMENTS
#OPEN THE FILE FUNCTION!!
#6/9/00


#HERE ARE THE VARS UTILIZED
@text=();#PLACE HOLDER FOR THE IMPORTED TEXT
@fchar=();#PLACE HOLDER FOR THE FIRST CHAR
$i;#INCREMENTER FOR THE LOOP

#PARSING FUNCTION
use Text::ParseWords;

open(FILE, "comments.txt");


while(<FILE> ) {
#increment the array to the data
$text[$i]=$_;
#print out the data
print "$i $_ \n";
@fchar=quotewords("",0,$_);
print "Here is fchar: $fchar[0]\n";
++$i;



}

close (FILE);


dws
Deleted

Jun 9, 2000, 6:18 PM

Post #2 of 3 (367 views)
Re: Parser of a line or word into letters [In reply to] Can't Post

@letters = split '', $word;


jbs
Deleted

Jun 10, 2000, 8:24 PM

Post #3 of 3 (367 views)
Re: Parser of a line or word into letters [In reply to] Can't Post

Thanks.. It worked like a charm!
-jbs

 
 


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

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