Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "$<" & "$>" mean in Perl

Tags:

variables

perl

An example will be highly appreciated. Below is a sample of where I read it:

$self->parameter(
    name => 'real_user',
    xpath => undef, 
    default => scalar(getpwuid($<))
);
$self->parameter(
    name => 'production',
    xpath => '/config/production', 
    default => $self->get('user_uid') == $>
);
like image 659
Jay Wong Avatar asked Nov 30 '22 21:11

Jay Wong


1 Answers

A $ followed by symbol? To perlvar!

$<
The real uid of this process.

$>
The effective uid of this process.

Use them to find out what user is running the program.

like image 80
Quentin Avatar answered Dec 04 '22 22:12

Quentin