I would appreciate some help with this. I am learning
Perl. I have a string inputed by the user. This string
is then split, every first letter of each word in the
string is uppercased, then joined back together and
printed.

Here is my code, can anyone help? Thanks, Sara G.

!/usr/bin/perl
# Demonstrating split and join when prompting the user
for input and then changing the first letter of each
word in a sentence to uppercase.

use strict;

print "Please enter a sentence of your choice\n";
my $firstline = <STDIN>;
chomp ( $firstline );

my @words = split( / /, $firstline );
print "$_\n" foreach ( @words );


$firstline = join( ' ', @words ); # joins the string
back together and prints it.
print "$firstline\n";


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to