Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: How to get system user name from windows using perl

by veerubiji (Sexton)
on Nov 10, 2011 at 12:49 UTC ( #937369=note: print w/ replies, xml ) Need Help??


in reply to Re: How to get system user name from windows using perl
in thread How to get system user name from windows using perl

thanks for your reply and I tried as you said like this,

my $username = getlogin || getpwuid($<) || "veeru"; print $username;

it printing my usename its working ok but How can I use this variable in my template process.


Comment on Re^2: How to get system user name from windows using perl
Download Code
Re^3: How to get system user name from windows using perl
by Eliya (Vicar) on Nov 10, 2011 at 15:18 UTC
    but How can I use this variable in my template process

    You could put it in your $data hash:

    $data->{username} = ...; ... $template->process(\*DATA, $data, $filename) ... \issuedby{[% username %]}

      Than you very much thats perfect, its working.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937369]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-07-24 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls