A
April
print $wholething, $wholething2, "\!", "\n";
Thank you
!
How can I get them on the same line?
Thank you
!
How can I get them on the same line?
print $wholething, $wholething2, "\!", "\n";
Thank you
!
How can I get them on the same line?
April said:print $wholething, $wholething2, "\!", "\n";
Thank you
!
How can I get them on the same line?
April said:print "Enter a phrase and convert the first letter to upper case and
add a ! at end: ";
my $input = <STDIN>;
my $firststinput = uc( substr($input, 0, 1) );
print $firststinput, substr($input, 1), "\!", "\n";
That is because you are asking for another keyboard input.
chomp $input;
April said:print $firststinput, "\!", "\n";
April said:this is more concise:
print "Enter a phrase and convert the first letter to upper case and
add a ! at end: ";
chomp( my $input = <STDIN> );
print ucfirst( $input ), "\!", "\n";
TIMTOWTDI:
print "Enter a phrase and convert the first letter to upper case and add
a ! at end: ";
( my $input = <STDIN> ) =~ s/$/!/;
print "\u$input";
John
TIMTOWTDI:
print "Enter a phrase and convert the first letter to upper case and add
a ! at end: ";
( my $input = <STDIN> ) =~ s/$/!/;
print "\u$input";
John
April said:print $wholething, $wholething2, "\!", "\n";
Thank you
!
How can I get them on the same line?
Tim said:I assume that the $wholething2 variable has a new line in it, because
it
should work. Why are you escaping \ the ! character? Are you running
this on the command line or something?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.