Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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.

Replies are listed 'Best First'.
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?
[Corion]: Oh - "Cyber Monday" week is coming up... That's why weird stuff is already discounted now...
[Corion]: marto: Oh, cool, I hope you get to enjoy the trip and Copenhagen! I found it nice (but the mermaid is underwhelming)
[marto]: the kids and their mother are coming too, actually only 9 people at the wedding in total. Still, will be fun

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-11-19 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (280 votes). Check out past polls.

    Notices?