view release on metacpan or search on metacpan
examples/h2xs.PL view on Meta::CPAN
my ($email,$author,$licence);
eval {
my $username;
($username,$author) = (getpwuid($>))[0,6];
if (defined $username && defined $author) {
$author =~ s/,.*$//; # in case of sub fields
my $domain = $Config{'mydomain'};
$domain =~ s/^\.//;
$email = "$username\@$domain";
view all matches for this distribution
view release on metacpan or search on metacpan
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
print DEBUG "$_[0]\n"; close DEBUG;
}
my (%irow, %icol, $nrows, $clue_has_been_given, $choice, $this_cell);
my @marked;
my $HOME = $ENV{'HOME'} || $ENV{'LOGDIR'} || (getpwuid($<))[7];
srand(time() ^ ($$+($$<15)));
sub choose { my $question = shift; local @list = @_; # @list must be local
# As from 1.22, allows multiple choice if called in array context
sub logit { my ($file, $msg) = @_;
if (! open(LOG, ">> $rcslog")) { warn "can't open $rcslog: $!\n";
} else {
$pid = fork; # log in background for better response time
if (! $pid) {
($user) = getpwuid($>);
print LOG ×tamp, " $file $user $msg\n"; close LOG;
if ($pid == 0) { exit 0; } # the child's end, if a fork occurred
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/ppport.h view on Meta::CPAN
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
lib/Math/ppport.h view on Meta::CPAN
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
src/libmemcached/clients/ms_setting.c view on Meta::CPAN
{
char userpath[PATH_MAX];
struct passwd *usr= NULL;
FILE *fd;
usr= getpwuid(getuid());
snprintf(userpath, PATH_MAX, "%s/%s", usr->pw_dir, DEFAULT_CONFIG_NAME);
if (access (userpath, F_OK | R_OK) == 0)
goto exit;
view all matches for this distribution
view release on metacpan or search on metacpan
=item *
Put in a better example than C<fibo>. Show an example of a
nonrecursive function that simply takes a long time to run.
C<getpwuid> for example? But this exposes the bug that you can't say
C<memoize('getpwuid')>, so perhaps it's not a very good example.
Well, I did add the ColorToRGB example, but it's still not so good.
These examples need a lot of work. C<factorial> might be a better
example than C<fibo>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Message/Passing/Role/Script.pm view on Meta::CPAN
my ($uid, $gid);
if ($self->_has_user) {
my $user = $self->user;
$uid = getpwnam($user) ||
die("User '$user' does not exist, cannot become that user!\n");
(undef, undef, undef, $gid ) = getpwuid($uid);
}
if ($gid) {
setgid($gid) || die("Could not setgid to '$gid' are you root? : $!\n");
}
if ($uid) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/00_courier.t view on Meta::CPAN
# First a simple case
use_ok( 'Messaging::Courier::ExampleMessage' );
ok( my $m = Messaging::Courier::ExampleMessage->new() );
ok( $m->username( $ENV{USER} || getlogin || getpwuid($>) ) );
ok( $m->password( 'bar' ) );
ok( $c->send( $m ) );
{
my $query;
while(1) {
ok( $query = $c->receive() );
last if $query->username() eq ( $ENV{USER} || getlogin || getpwuid($>) );
}
my $reply = $query->reply->token( '42' );
ok( $c->send( $reply ) );
}
view all matches for this distribution
view release on metacpan or search on metacpan
Meta/Utils/Utils.pm view on Meta::CPAN
# return($>);
}
sub cuname() {
my($uid)=POSIX::getuid();
return((POSIX::getpwuid($uid))[0]);
}
sub cgid() {
return(POSIX::getegid());
}
sub get_home_dir() {
my($uid)=POSIX::getuid();
return((POSIX::getpwuid($uid))[7]);
#my($user)=POSIX::getpwnam();
#return(get_user_home_dir($user));
# return(Meta::Utils::Env::get("HOME"));
}
Meta/Utils/Utils.pm view on Meta::CPAN
This routine returns the current users home directory.
The implementation used to work with the environment and getting the
HOME variable but this is very unrobust and works for less platforms
and situations. Currently this uses POSIX which is much more robust
to find the uid of the current user and then the home directory from
the password file using getpwuid. The reason that this does not use
the get_user_home_dir method from this same module is that there is
no convinient way to get the current user name (it would take
another function to convert uid to uname). The implementation marked
out using POSIX::getpwnam does not work.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/ExtUtils/MakeMaker.pm view on Meta::CPAN
my($name, $value) = ($1, $2);
if ($value =~ m/^~(\w+)?/) { # tilde with optional username
$value =~ s [^~(\w*)]
[$1 ?
((getpwnam($1))[7] || "~$1") :
(getpwuid($>))[7]
]ex;
}
# Remember the original args passed it. It will be useful later.
$self->{ARGS}{uc $name} = $self->{uc $name} = $value;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/ExtUtils/MakeMaker.pm view on Meta::CPAN
my($name, $value) = ($1, $2);
if ($value =~ m/^~(\w+)?/) { # tilde with optional username
$value =~ s [^~(\w*)]
[$1 ?
((getpwnam($1))[7] || "~$1") :
(getpwuid($>))[7]
]ex;
}
# Remember the original args passed it. It will be useful later.
$self->{ARGS}{uc $name} = $self->{uc $name} = $value;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Build/Platform/Unix.pm view on Meta::CPAN
sub _detildefy {
my ($self, $value) = @_;
$value =~ s[^~([^/]+)?(?=/|$)] # tilde with optional username
[$1 ?
(eval{(getpwnam $1)[7]} || "~$1") :
($ENV{HOME} || eval{(getpwuid $>)[7]} || glob("~"))
]ex;
return $value;
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/_check-module-version view on Meta::CPAN
# my ($user, $slash) = @_;
# my @ent;
# if (length $user) {
# @ent = getpwnam($user);
# } else {
# @ent = getpwuid($>);
# $user = $ent[0];
# }
# return $ent[7] . $slash if @ent;
# "~$user$slash";
#}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Generic/File/Cache.pm view on Meta::CPAN
{
return( Data::UUID->new->create_str );
}
# We do not actually use any path, but this is for standardisation with Module::Generic::SharedMem
my $path;
( $key, $path ) = ref( $key ) eq 'ARRAY' ? @$key : ( $key, [getpwuid($>)]->[7] );
$path = [getpwuid($path)]->[7] if( $path =~ /^\d+$/ );
if( $key =~ /^\d+$/ )
{
my $id = $self->ftok( $key ) ||
return( $self->error( "Unable to get a key using IPC::SysV::ftok: $!" ) );
return( $id );
view all matches for this distribution
view release on metacpan or search on metacpan
cpanflute.patch view on Meta::CPAN
use Sys::Hostname;
use Getopt::Long;
@@ -11,7 +78,7 @@
# set default options, then get options
my %options=();
$options{'email'}=(getpwuid($<))[0] . "\@redhat.com" ;
-GetOptions(\%options, "email=s", "n=s", "create") || exit 1;
+GetOptions(\%options, "email=s", "n=s", "create", "meta-info=s") || exit 1;
my $InputFile = $ARGV[0];
my $create = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter.pm view on Meta::CPAN
builder => 'Module::Build', # defaults to ExtUtils::MakeMaker
# or specify more than one builder in an
# arrayref
license => $license, # type of license; defaults to 'artistic2'
author => $author, # author's full name (taken from C<getpwuid> if not provided)
email => $email, # author's email address (taken from C<EMAIL> if not provided)
ignores_type => $type, # ignores file type ('generic', 'cvs', 'git', 'hg', 'manifest' )
fatalize => $fatalize, # generate code that makes warnings fatal
verbose => $verbose, # bool: print progress messages; defaults to 0
view all matches for this distribution
view release on metacpan or search on metacpan
use Mojo::File qw/path/;
use File::HomeDir;
use Test::More;
my $user = getlogin() || $ENV{USER} || $ENV{LOGNAME} || getpwuid($<);
my $p = path()->with_roles("+HomeDir");
my @subs = qw/
my_home
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/IRC.pm view on Meta::CPAN
has server_settings => sub {
return {chantypes => '#', prefix => '(ov)@+'};
};
has tls => undef;
has user => sub { $ENV{USER} || getlogin || getpwuid($<) || 'anonymous' };
sub new {
my $self = shift->SUPER::new(@_);
$self->on(message => \&_legacy_dispatch_message);
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Tar/File.pm view on Meta::CPAN
has gid => sub ($self) { $self->_stat('gid') || $GID };
has group => sub ($self) { getgrgid($self->gid) || '' };
has is_complete => sub ($self) { $self->_stat('size') == $self->size ? 1 : 0 };
has mode => sub ($self) { ($self->_stat('mode') || 0) & 0777 };
has mtime => sub ($self) { $self->_stat('mtime') || time };
has owner => sub ($self) { getpwuid($self->uid) || '' };
has path => sub ($self) { $self->asset->to_string || '' };
has size => sub ($self) { $self->_stat('size') || 0 };
has symlink => '';
has type => sub ($self) { $self->_build_type };
has uid => sub ($self) { $self->_stat('uid') || $( };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Command/Author/generate/automake_app.pm view on Meta::CPAN
EOF
$self->cwd(join '/', @dir) if @dir;
my $file = $self->file;
my ($userName,$fullName) = (getpwuid $<)[0,6];
$fullName =~ s/,.+//g;
chomp(my $domain = `hostname -d`);
my $email = $userName.'@'.$domain;
if ( -r $ENV{HOME} . '/.gitconfig' ){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Command/generate/qx_mojo_app.pm view on Meta::CPAN
'frontend/source/index.html' => 'frontend/source/index.html',
'frontend/source/class/app/data/RpcService.js' => 'frontend/source/class/'.$name.'/data/RpcService.js',
't/basic.t' => 't/basic.t',
};
my ($userName,$fullName) = (getpwuid $<)[0,6];
$fullName =~ s/,.+//g;
chomp(my $domain = `hostname -d`);
my $email = $userName.'@'.$domain;
if ( -r $ENV{HOME} . '/.gitconfig' ){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Cron.pm view on Meta::CPAN
sub register {
my ($self, $app, $cronhashes) = @_;
croak "No schedules found" unless ref $cronhashes eq 'HASH';
# for *nix systems, getpwuid takes precedence
# for win systems or wherever getpwuid is not implemented,
# eval returns undef so getlogin takes precedence
$crondir
= path($app->config->{cron}{dir} // File::Spec->tmpdir)
->child(CRON_DIR . (eval { scalar getpwuid($<) } || getlogin || 'nobody'),
$app->mode);
Mojo::IOLoop->next_tick(sub {
if (ref((values %$cronhashes)[0]) eq 'CODE') {
# special case, plugin => 'mm hh dd ...' => sub {}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Ident/Response.pm view on Meta::CPAN
$server_user_name = $ENV{USERNAME};
}
else
{
$server_user_uid = $<;
$server_user_name = scalar getpwuid($<);
}
die "could not determine username"
unless defined $server_user_name
&& $server_user_name;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/MultiConfig.pm view on Meta::CPAN
{
my $self = shift;
my $app = shift;
my $arg = shift;
my $config = {};
my $username = (getpwuid($<))[0]; # TODO: Not on Windows!
my @files;
# Default args if not set
$arg->{moniker} //= $app->moniker;
$arg->{mode} //= $app->mode;
view all matches for this distribution
view release on metacpan or search on metacpan
share/public/revealjs/plugin/highlight/highlight.js view on Meta::CPAN
})();
// END CUSTOM REVEAL.JS INTEGRATION
/*! highlight.js v9.11.0 | BSD3 License | git.io/hljslicense */
!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.r...
c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("roboconf",function(a){var e="[a-zA-Z-_][^\\n{]+\\{",n={cN:"attribute",b:/[a-zA-Z-_]+/,e:/\s*:/,eE:!0,starts:{e:";",r:0,c:[{cN:"variable",b:/\.[a-zA...
view all matches for this distribution
view release on metacpan or search on metacpan
t/register.t view on Meta::CPAN
$log_buffer = '';
eval {
plugin 'SetUserGroup' => {
user => scalar getpwuid $>,
group => 'bad group name !!!!!',
};
};
$error = $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/resources/public/mojo/highlight.js/highlight.min.js view on Meta::CPAN
},{begin:/^\-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{
begin:/^\*{15}$/}]},{className:"addition",begin:"^\\+",end:"$"},{
className:"deletion",begin:"^\\-",end:"$"},{className:"addition",begin:"^\\!",
end:"$"}]}}}());hljs.registerLanguage("perl",function(){"use strict";return function(e){var n={
$pattern:/[\w.]+/,
keyword:"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno...
},t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",
end:"}"},r={variants:[{begin:/\$\d/},{
begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,
relevance:0}]
},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{
view all matches for this distribution
view release on metacpan or search on metacpan
Mon/Client.pm view on Meta::CPAN
$self->{"VERSION"} = undef;
if ($ENV{"USER"} ne "") {
$self->{"USERNAME"} = $ENV{"USER"};
} else {
$self->{"USERNAME"} = (getpwuid ($<))[0];
}
$self->{"OPSTATUS"} = undef;
$self->{"DISABLED"} = undef;
view all matches for this distribution