Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Output to another file help

by roboticus (Chancellor)
on Nov 08, 2012 at 21:21 UTC ( #1002986=note: print w/replies, xml ) Need Help??

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.


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

    Nevermind, found out about lc() function.

Re^2: Output to another file help
by jaffinito34 (Acolyte) on Nov 08, 2012 at 21:36 UTC

    PERFECT!, any ideas how to quickly convert the firstInitial to lowercase? Right now my script outputs the first initial, first 3 of the last name, and last 4 of ssn, but it does so that it looks like this:

    First, Last, 000-000-0000, etc...

    output: FLas0000

    I'm trying to get it like: flas0000

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002986]
[karlgoethebier]: choroba: another chapter of "Learning English At The Monastry"?
[shmem]: Corion, well then... next issue, sequence number not a shared resource :P
[Discipulus]: shmem i'm searching it.. but failing i was sure was in Re: Let's Make PerlMonks Great Again! -- suggestions and dreams
erix recommends Vanished Kingdoms
[Corion]: shmem: Yeah, something like that. Not that that would be a solved issue. Simply process all events that come in from a single interface sequentially. Ah well.
[Discipulus]: their

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2017-05-23 08:29 GMT
Find Nodes?
    Voting Booth?