view release on metacpan or search on metacpan
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
has cwd => (
is => 'rw',
default => sub {
Path::Class::Dir->new_foreign('Unix', '/');
},
);
sub _first_index (&@)
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
}
sub find
{
my($self, $path) = @_;
$path = Path::Class::Dir->new_foreign('Unix', $path) unless ref $path;
$path = Path::Class::Dir->new_foreign('Unix', $self->cwd, $path)
unless $path->is_absolute;
my $store = $self->store;
return $store if $path eq '/';
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_cwd
{
my($self, $con, $req) = @_;
my $dir = Path::Class::Dir->new_foreign('Unix', $req->args)->cleanup;
$dir = $dir->absolute($self->cwd) unless $dir->is_absolute;
my @list = grep !/^\.$/, $dir->components;
while(1)
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
splice @list, $i, 1;
}
}
$dir = Path::Class::Dir->new_foreign('Unix', @list);
if(ref($self->find($dir)) eq 'HASH')
{
$self->cwd($dir);
$con->send_response(250 => 'CWD command successful');
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_size
{
my($self, $con, $req) = @_;
my $file = $self->find(Path::Class::File->new_foreign('Unix', $req->args));
if(defined($file) && !ref($file))
{
$con->send_response(213 => length $file);
}
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_mkd
{
my($self, $con, $req) = @_;
my $path = Path::Class::Dir->new_foreign('Unix', $req->args);
my $file = $self->find($path->parent);
if($path->basename ne '' && defined($file) && ref($file) eq 'HASH')
{
if(exists $file->{$path->basename})
{
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_rmd
{
my($self, $con, $req) = @_;
# TODO: be more picky about rmd and file or dele a directory
my $path = Path::Class::Dir->new_foreign('Unix', $req->args);
my $file = $self->find($path->parent);
if(defined($file) && ref($file) eq 'HASH')
{
if(exists $file->{$path->basename})
{
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_dele
{
my($self, $con, $req) = @_;
my $path = Path::Class::File->new_foreign('Unix', $req->args);
my $file = $self->find($path->parent);
if(defined($file) && ref($file) eq 'HASH')
{
if(exists $file->{$path->basename})
{
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
sub cmd_rnfr
{
my($self, $con, $req) = @_;
my $path = Path::Class::File->new_foreign('Unix', $req->args);
my $dir = $self->find($path->parent);
if(ref($dir) eq 'HASH')
{
if(exists $dir->{$path->basename})
{
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
$con->send_response(503 => 'Bad sequence of commands');
$self->done;
return;
}
my $path = Path::Class::File->new_foreign('Unix', $req->args);
my $dir = $self->find($path->parent);
if(ref($dir) eq 'HASH')
{
if(exists $dir->{$path->basename})
lib/AnyEvent/FTP/Server/Context/Memory.pm view on Meta::CPAN
if($dir)
{
my $h = $self->find($dir);
if(ref($h) eq 'HASH')
{
$dir = Path::Class::Dir->new_foreign('Unix', $dir);
@list = map { $dir->file($_) } sort keys %$h;
}
else
{
$dir = Path::Class::File->new_foreign('Unix', $dir);
@list = "$dir";
}
}
else
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Finger.pm view on Meta::CPAN
=head1 CAVEATS
Finger is an oldish protocol and almost nobody uses it anymore.
Most finger clients do not have a way to configure an alternate port.
Binding to the default port 79 on Unix usually requires root. Running
L<AnyEvent::Finger::Server> as root is not recommended.
Under Linux you can use C<iptables> to forward requests to port 79 to
an unprivileged port. I was able to use this incantation to forward port 79
to port 8079:
view all matches for this distribution
view release on metacpan or search on metacpan
=item Compatibility to L<AnyEvent::Fork::Remote>
If you want to write code that works with both this module and
L<AnyEvent::Fork::Remote>, you need to write your code so that it assumes
there are two file handles for communications, which might not be unix
domain sockets. The C<run> function should start like this:
sub run {
my ($rfh, @args) = @_; # @args is your normal arguments
my $wfh = fileno $rfh ? $rfh : *STDOUT;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/File/Spec.pm view on Meta::CPAN
symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian.
dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP.
cygwin => 'Cygwin');
my $module = $module{$^O} || 'Unix';
require "File/Spec/$module.pm";
@ISA = ("File::Spec::$module");
1;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3.pm view on Meta::CPAN
=cut
sub connect {
my ($self) = @_;
my $cv = AnyEvent->condvar;
tcp_connect "unix/", $self->{path}, sub {
my ($fh) = @_;
return $cv->send(0) unless $fh;
$self->{ipchdl} = AnyEvent::Handle->new(
view all matches for this distribution
view release on metacpan or search on metacpan
xt/author/eol.t view on Meta::CPAN
'lib/AnyEvent/I3X/Workspace/OnDemand/UserGuide.pod',
't/00-compile.t',
't/01-basic.t'
);
eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
t/03-notice.t view on Meta::CPAN
plan tests => 10;
test_tcp(
server => sub {
my $port = shift;
our $SHELL = AnyEvent::Debug::shell "unix/", "/tmp/aedebug.shell";
my $ircd = AnyEvent::IRC::Server->new(
port => $port,
'servername' => 'fushihara.anyevent.server.irc',
prepared_cb => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Devel/CheckOS.pm view on Meta::CPAN
A learned sage once wrote on IRC:
$^O is stupid and ugly, it wears its pants as a hat
Devel::CheckOS provides a more friendly interface to $^O, and also lets
you check for various OS "families" such as "Unix", which includes things
like Linux, Solaris, AIX etc.
It spares perl the embarrassment of wearing its pants on its head by
covering them with a splendid Fedora.
=head1 SYNOPSIS
use Devel::CheckOS qw(os_is);
print "Hey, I know this, it's a Unix system\n" if(os_is('Unix'));
print "You've got Linux 2.6\n" if(os_is('Linux::v2_6'));
=head1 USING IT IN Makefile.PL or Build.PL
inc/Devel/CheckOS.pm view on Meta::CPAN
Takes a list of OS names. If the current platform matches any of them,
it returns true, otherwise it returns false. The names can be a mixture
of OSes and OS families, eg ...
os_is(qw(Unix VMS)); # Unix is a family, VMS is an OS
=cut
sub os_is {
my @targets = @_;
inc/Devel/CheckOS.pm view on Meta::CPAN
Thanks to David Golden for the name and ideas about the interface, and
to the cpan-testers-discuss mailing list for prompting me to write it
in the first place.
Thanks to Ken Williams, from whose L<Module::Build> I lifted some of the
information about what should be in the Unix family.
Thanks to Billy Abbott for finding some bugs for me on VMS.
Thanks to Matt Kraai for information about QNX.
view all matches for this distribution
view release on metacpan or search on metacpan
xt/99-minimumversion.t
xt/99-pod.t
xt/99-synopsis.t
xt/99-test-prerequisites.t
xt/99-todo.t
xt/99-unix-text.t
xt/99-versions.t
xt/copyright.t
xt/meta-lint.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/InfluxDB.pm view on Meta::CPAN
$cv = AE::cv;
$db->select(
database => 'mydb',
# return time in Unix epoch format
epoch => "s",
# raw query
q => "SELECT count(value) FROM cpu_load"
." WHERE region = 'eu-east' AND time > now() - 14d"
lib/AnyEvent/InfluxDB.pm view on Meta::CPAN
clause, grouped by C<group_by> and empty values filled with C<fill>, ordered by
C<order_by> with number of results limited to C<limit> with offset C<offset>.
To limit number of returned series use C<slimit> with offset C<soffset>.
If C<into> parameter is provided the result of the query will be copied to specified
measurement.
If C<epoch> is provided the returned C<time> value will in Unix epoch format.
Optional C<chunk_size> can be provided to override the default value of 10,000 datapoints.
The required C<on_success> code reference is executed if request was successful,
otherwise executes the required C<on_error> code reference.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
=item eval <node> <expr...>
Joins all remaining arguments into a string and evaluates it on the given
node. Return values are handled as with F<aemp cal>.
Example: find the unix process ID of the node called posicks.
aemp eval posicks '$$'
=item trace <node>
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/author-eol.t view on Meta::CPAN
't/author-synopsis.t',
't/release-common_spelling.t',
't/release-kwalitee.t'
);
eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
$file .= '.pm';
foreach my $dir ( @INC ) {
next if ref $dir;
my $path = File::Spec->catfile($dir, $file);
next unless -e $path;
require ExtUtils::MM_Unix;
return ExtUtils::MM_Unix->parse_version($path);
}
return undef;
}
# Load CPAN.pm and it's configuration
view all matches for this distribution
view release on metacpan or search on metacpan
t/author-eol.t view on Meta::CPAN
't/release-common_spelling.t',
't/release-kwalitee.t',
't/release-pod-linkcheck.t'
);
eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/MySQL.pm view on Meta::CPAN
$param = { database => $param };
}
$param->{port} ||= 3306;
if( $param->{host} eq '' || $param->{host} eq 'localhost' ) { # unix socket
my $sock = $param->{mysql_socket} || `mysql_config --socket`;
if( !$sock ) {
_report_error($dbh, 'connect', 2002, "Can't connect to local MySQL server through socket ''");
$cb->();
return;
}
$param->{host} = '/unix';
$param->{port} = $sock;
}
warn "Connecting to $param->{host}:$param->{port} ...";
weaken( my $wdbh = $dbh );
view all matches for this distribution
view release on metacpan or search on metacpan
t/author-eol.t view on Meta::CPAN
't/01api.t',
't/02client.t',
't/03token.t'
);
eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Net/Curl/Queued/Stats.pm view on Meta::CPAN
=head1 ATTRIBUTES
=head2 stamp
Unix timestamp for statistics update.
=head2 stats
C<HashRef[Num]> with statistics:
view all matches for this distribution
view release on metacpan or search on metacpan
t/author-eol.t view on Meta::CPAN
't/release-common_spelling.t',
't/release-kwalitee.t',
't/release-pod-linkcheck.t'
);
eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
view all matches for this distribution