in reply to [SOLVED] Output to another file help
You're treating $firstName as an array reference, but it's presumably a string. What you want to do is create a variable that holds the first initial, then you can print that. Something like this:
my $firstName = 'Marco'; my $firstInitial = substr($firstName, 0, 1); print "First initial is '$firstInitial'\n";
Read the documentation for substr to see how it works.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Output to another file help
by jaffinito34 (Acolyte) on Nov 08, 2012 at 21:39 UTC | |
|
Re^2: Output to another file help
by jaffinito34 (Acolyte) on Nov 08, 2012 at 21:36 UTC |