Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by choroba (Canon)
on Nov 10, 2011 at 12:30 UTC ( #937363=note: print w/ replies, xml ) Need Help??


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

Try getlogin to get the username.


Comment on Re: How to get system user name from windows using perl
Re^2: How to get system user name from windows using perl
by veerubiji (Sexton) on Nov 10, 2011 at 12:49 UTC

    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.

      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://937363]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2015-07-03 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (49 votes), past polls