view release on metacpan or search on metacpan
lib/Excel/XLSX.pm view on Meta::CPAN
maybe font_strikeout => ( $font->{Strikeout} ) ? 1 : undef,
maybe font_script => ( $font->{Super} ) ? $font->{Super} : undef,
) : (),
),
maybe num_format => $format->{FmtIdx},
maybe locked => ( $format->{Lock} ) ? 1 : undef,
maybe hidden => ( $format->{Hidden} ) ? 1 : undef,
maybe align => ( $format->{AlignH} )
? $align_h->[ $format->{AlignH} ]
: undef,
maybe valign => ( defined $format->{AlignV} )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ExclusiveLock/Guard.pm view on Meta::CPAN
my($class, $filename, %args) = @_;
my $retry_count = $args{retry_count} || 5;
my $fh;
my $count = 0;
my $is_locked = 1;
while (1) {
$ERRSTR = undef;
$is_locked = 1;
unless (open $fh, '>', $filename) {
$ERRSTR = "failed to open file:$filename:$!";
return;
}
if ($args{nonblocking}) {
unless (flock $fh, LOCK_EX | LOCK_NB) {
if ($! != EWOULDBLOCK) {
$ERRSTR = "failed to flock file:$filename:$!";
return;
}
$is_locked = 0;
}
} else {
unless (flock $fh, LOCK_EX) {
$ERRSTR = "failed to flock file:$filename:$!";
return;
lib/ExclusiveLock/Guard.pm view on Meta::CPAN
}
bless {
filename => $filename,
fh => $fh,
is_locked => $is_locked,
}, $class;
}
sub is_locked { $_[0]->{is_locked} }
sub DESTROY {
my $self = shift;
return unless $self->{is_locked};
my $fh = delete $self->{fh};
my $filename = delete $self->{filename};
unless (close $fh) {
warn "failed to close file:$filename:$!";
lib/ExclusiveLock/Guard.pm view on Meta::CPAN
}
# try unlink lock file
if (open my $unlink_fh, '<', $filename) { # else is unlinked lock file by another process?
# A
if (flock $unlink_fh, LOCK_EX | LOCK_NB) { # else is locked the file by another process
if (-f $filename && stat($unlink_fh)->ino == do { my $s = stat($filename); $s ? $s->ino : -1 }) { # else is unlink and create file by another process in the A timing
unless (unlink $filename) {
warn "failed to unlink file:$filename:$!";
}
unless (flock $unlink_fh, LOCK_UN) {
lib/ExclusiveLock/Guard.pm view on Meta::CPAN
for non-blocking
sub nonblocking_transaction {
my $lock = ExclusiveLock::Guard->new('/tmp/foo.lock', nonblocking => 1 )
or die 'lock error: ' . ExclusiveLock::Guard->errstr;
unless ($lock->is_locked) {
warn 'is locked';
return;
}
# inner of lock
}
view all matches for this distribution
view release on metacpan or search on metacpan
public/javascripts/vendor/jquery/jquery-1.7.2.min.js view on Meta::CPAN
/*! jQuery v1.7.2 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("ifram...
a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3]....
.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(argumen...
view all matches for this distribution
view release on metacpan or search on metacpan
1.004003 2022-09-30
[ Bug Fixes ]
- If exporting non-CODE items which happen to have the same name as
exported CODE items, their export was being quietly blocked. These
exports should now work.
Diab Jerius++
<https://github.com/tobyink/p5-exporter-tiny/issues/9>
- Using ! with a tag now works; it was previously documented as working
but not implemented.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ExtUtils/Install.pm view on Meta::CPAN
: 0 unless defined $Has_Win32API_File;
if ( ! $Has_Win32API_File ) {
my @msg=(
"Cannot schedule $descr at reboot.",
"Try installing Win32API::File to allow operations on locked files",
"to be scheduled during reboot. Or try to perform the operation by",
"hand yourself. (You may need to close other perl processes first)"
);
if ( $moan ) { _warnonce(@msg) } else { _choke(@msg) }
return 0;
lib/ExtUtils/Install.pm view on Meta::CPAN
=head2 _unlink_or_rename( $file, $tryhard, $installing )
OS-Specific, Win32/Cygwin
Tries to get a file out of the way by unlinking it or renaming it. On
some OS'es (Win32 based) DLL files can end up locked such that they can
be renamed but not deleted. Likewise sometimes a file can be locked such
that it cant even be renamed or changed except at reboot. To handle
these cases this routine finds a tempfile name that it can either rename
the file out of the way or use as a proxy for the install so that the
rename can happen later (at reboot).
view all matches for this distribution
view release on metacpan or search on metacpan
bundled/ExtUtils-Install/ExtUtils/Install.pm view on Meta::CPAN
: 0 unless defined $Has_Win32API_File;
if ( ! $Has_Win32API_File ) {
my @msg=(
"Cannot schedule $descr at reboot.",
"Try installing Win32API::File to allow operations on locked files",
"to be scheduled during reboot. Or try to perform the operation by",
"hand yourself. (You may need to close other perl processes first)"
);
if ( $moan ) { _warnonce(@msg) } else { _choke(@msg) }
return 0;
bundled/ExtUtils-Install/ExtUtils/Install.pm view on Meta::CPAN
=item _unlink_or_rename( $file, $tryhard, $installing )
OS-Specific, Win32/Cygwin
Tries to get a file out of the way by unlinking it or renaming it. On
some OS'es (Win32 based) DLL files can end up locked such that they can
be renamed but not deleted. Likewise sometimes a file can be locked such
that it cant even be renamed or changed except at reboot. To handle
these cases this routine finds a tempfile name that it can either rename
the file out of the way or use as a proxy for the install so that the
rename can happen later (at reboot).
view all matches for this distribution
view release on metacpan or search on metacpan
t/ExtUtils/SVDmaker/expected/File/Package.pm view on Meta::CPAN
# The eval messes with the stack. Since not using an eval, need
# to double check to make sure import does not die.
####
# Poor man's eval where trap off the Carp::croak function.
# The Perl authorities have Core::die locked down tight so
# it is next to impossible to trap off of Core::die. Lucky
# must everyone uses Carp::croak instead of just dieing.
#
# Anyway, get the benefit of a lot of stack gyrations to
# formulate the correct error msg by Exporter::import.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Extism/ppport.h view on Meta::CPAN
get_av|5.006000|5.003007|p
getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
lib/Extism/ppport.h view on Meta::CPAN
PERL_MALLOC_WRAP|5.009002|5.009002|Vn
PerlMem_calloc|5.006000||Viu
PerlMem_free|5.005000||Viu
PerlMem_free_lock|5.006000||Viu
PerlMem_get_lock|5.006000||Viu
PerlMem_is_locked|5.006000||Viu
PerlMem_malloc|5.005000||Viu
PERL_MEMORY_DEBUG_HEADER_SIZE|5.019009||Viu
PerlMemParse_calloc|5.006000||Viu
PerlMemParse_free|5.006000||Viu
PerlMemParse_free_lock|5.006000||Viu
PerlMemParse_get_lock|5.006000||Viu
PerlMemParse_is_locked|5.006000||Viu
PerlMemParse_malloc|5.006000||Viu
PerlMemParse_realloc|5.006000||Viu
PerlMem_realloc|5.005000||Viu
PerlMemShared_calloc|5.006000||Viu
PerlMemShared_free|5.006000||Viu
PerlMemShared_free_lock|5.006000||Viu
PerlMemShared_get_lock|5.006000||Viu
PerlMemShared_is_locked|5.006000||Viu
PerlMemShared_malloc|5.006000||Viu
PerlMemShared_realloc|5.006000||Viu
PERL_MG_UFUNC|5.007001||Viu
Perl_modf|5.006000|5.006000|n
PERL_MULTICONCAT_HEADER_SIZE|5.027006||Viu
lib/Extism/ppport.h view on Meta::CPAN
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FAQ/OMatic/Auth.pm view on Meta::CPAN
# given an ($id,$password,...) array, writes it into idfile
sub writeIDfile {
my ($id,$password,@rest) = @_;
my $lockf = FAQ::OMatic::lockFile("idfile");
FAQ::OMatic::gripe('error', "idfile is locked.") if (not $lockf);
if (not open(IDFILE, "<$FAQ::OMatic::Config::metaDir/idfile")) {
FAQ::OMatic::unlockFile($lockf);
FAQ::OMatic::gripe('abort', "FAQ::OMatic::Auth::writeIDfile: Couldn't "
."read $FAQ::OMatic::Config::metaDir/idfile because $!");
lib/FAQ/OMatic/Auth.pm view on Meta::CPAN
# record. (smacks of a hack, but this is Perl!)
return undef if (($id eq 'version') and (not $dontHideVersion));
my $lockf = FAQ::OMatic::lockFile("idfile");
FAQ::OMatic::gripe('error', "idfile is locked.") if (not $lockf);
if (not open(IDFILE, "<$FAQ::OMatic::Config::metaDir/idfile")) {
FAQ::OMatic::unlockFile($lockf);
FAQ::OMatic::gripe('abort', "FAQ::OMatic::Auth::readIDfile: Couldn't "
."read $FAQ::OMatic::Config::metaDir/idfile because $!");
view all matches for this distribution
view release on metacpan or search on metacpan
include/ppport.h view on Meta::CPAN
get_av|5.006000|5.003007|p
getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
include/ppport.h view on Meta::CPAN
PERL_MALLOC_WRAP|5.009002|5.009002|Vn
PerlMem_calloc|5.006000||Viu
PerlMem_free|5.005000||Viu
PerlMem_free_lock|5.006000||Viu
PerlMem_get_lock|5.006000||Viu
PerlMem_is_locked|5.006000||Viu
PerlMem_malloc|5.005000||Viu
PERL_MEMORY_DEBUG_HEADER_SIZE|5.019009||Viu
PerlMemParse_calloc|5.006000||Viu
PerlMemParse_free|5.006000||Viu
PerlMemParse_free_lock|5.006000||Viu
PerlMemParse_get_lock|5.006000||Viu
PerlMemParse_is_locked|5.006000||Viu
PerlMemParse_malloc|5.006000||Viu
PerlMemParse_realloc|5.006000||Viu
PerlMem_realloc|5.005000||Viu
PerlMemShared_calloc|5.006000||Viu
PerlMemShared_free|5.006000||Viu
PerlMemShared_free_lock|5.006000||Viu
PerlMemShared_get_lock|5.006000||Viu
PerlMemShared_is_locked|5.006000||Viu
PerlMemShared_malloc|5.006000||Viu
PerlMemShared_realloc|5.006000||Viu
PERL_MG_UFUNC|5.007001||Viu
Perl_modf|5.006000|5.006000|n
PERL_MULTICONCAT_HEADER_SIZE|5.027006||Viu
include/ppport.h view on Meta::CPAN
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
view all matches for this distribution
view release on metacpan or search on metacpan
deps/libffi/ltmain.sh view on Meta::CPAN
fi
$opt_dry_run || {
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
removelist=$lockfile
$RM "$lockfile"
fi
}
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hidapi/libusb/hid.c view on Meta::CPAN
return actual_length;
}
}
/* Helper function, to simplify hid_read().
This should be called with dev->mutex locked. */
static int return_data(hid_device *dev, unsigned char *data, size_t length)
{
/* Copy the data out of the linked list item (rpt) into the
return buffer (data), and delete the liked list item. */
struct input_report *rpt = dev->input_reports;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Door.pm view on Meta::CPAN
sub _build_fsa_transitions {
my ($self) = @_;
my $transitions = {
locked => {
unlock_door => FSA::Engine::Transition->new({
test => 'TURN KEY CLOCKWISE',
action => sub {$self->action_turn_key(@_)},
state => 'closed',
}),
},
closed => {
lock_door => FSA::Engine::Transition->new({
test => 'TURN KEY ANTICLOCKWISE',
action => sub {$self->action_turn_key(@_)},
state => 'locked',
}),
open_door => FSA::Engine::Transition->new({
test => 'PULL DOOR',
action => sub {print "There is a rising 'eeerrrRRRKKK' sound\n";},
state => 'open',
t/lib/Door.pm view on Meta::CPAN
sub _build_fsa_states {
my ($self) = @_;
my $states = {
locked => {
entry_action => sub {print "The door is locked\n";},
exit_action => sub {print "We are about to unlock the door\n";},
},
closed => {
entry_action => sub {print "The door is closed but unlocked\n";},
},
open => {
entry_action => sub {print "The door is open\n";},
exit_action => sub {print "We are about to shut the door\n";},
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ham/Device/FT817COMM.pm view on Meta::CPAN
=head2 Initialization
The instance of the device and options are created with the constructor and port configurations shown above.
The variable which is an instance of the device may be named at that point. In this case B<$FT817>.
The serialport must be a valid port and not locked. You must consider that your login must have
permission to access the port either being added to the group or giving the user suffucient privilages.
The baudrate 'baud' must match the baudrate of the radio B<CAT RATE> which is menu item B<14>.
Note that you are not limited to one radio. You can create more than one instance using a different name and serial port
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FTN/JAM.pm view on Meta::CPAN
}
my $handleref = $_[0];
my $timeout = $_[1];
if ( $$handleref{locked} ) {
return 1;
}
if ( flock( $$handleref{jhr}, 6 ) ) {
$$handleref{locked} = 1;
return 1;
}
for ( my $i = 0 ; $i < $timeout ; $i++ ) {
sleep(1);
if ( flock( $$handleref{jhr}, 6 ) ) {
$$handleref{locked} = 1;
return 1;
}
}
$Errnum = $FTN::JAM::Errnum::BASE_NOT_LOCKED;
lib/FTN/JAM.pm view on Meta::CPAN
sub UnlockMB {
my ($handleref) = @_ or croak 'UnlockMB requires a reference to a file hash as a parameter.';
if ( $$handleref{locked} ) {
flock( $$handleref{jhr}, 8 );
delete $$handleref{locked};
}
return 1;
}
=head2 ReadMBHeader
lib/FTN/JAM.pm view on Meta::CPAN
if ( !defined( $$headerref{PasswordCRC} ) ) {
$$headerref{PasswordCRC} = 0;
}
if ( !defined( $$headerref{BaseMsgNum} ) ) { $$headerref{BaseMsgNum} = 0; }
if ( !$$handleref{locked} ) {
$Errnum = $FTN::JAM::Errnum::BASE_NOT_LOCKED;
return;
}
$$headerref{Signature} = "JAM";
lib/FTN/JAM.pm view on Meta::CPAN
if ( !defined( $$headerref{PasswordCRC} ) ) {
$$headerref{PasswordCRC} = 0xffffffff;
}
if ( !defined( $$headerref{Cost} ) ) { $$headerref{Cost} = 0; }
if ( !$$handleref{locked} ) {
$Errnum = $FTN::JAM::Errnum::BASE_NOT_LOCKED;
return;
}
my $buf;
lib/FTN/JAM.pm view on Meta::CPAN
if ( !defined( $$headerref{PasswordCRC} ) ) {
$$headerref{PasswordCRC} = 0xffffffff;
}
if ( !defined( $$headerref{Cost} ) ) { $$headerref{Cost} = 0; }
if ( !$$handleref{locked} ) {
$Errnum = $FTN::JAM::Errnum::BASE_NOT_LOCKED;
return;
}
my $buf;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Facebook/Graph/Cookbook/Recipe1.pod view on Meta::CPAN
return $response->finalize;
};
$urlmap->map("/facebook/postback" => $postback);
It's really stupid of us to pass our access token along the URL especially since we requested C<offline_access>. We're only doing it here to demonstrate the usage of it. If you're requesting offline access, you should keep the access token locked awa...
=head2 Step 9: Let's do something already!
So now that we finally have an access token we can start making privileged requests. That works like this:
view all matches for this distribution
view release on metacpan or search on metacpan
t/10-basic.t view on Meta::CPAN
$ia->add_list(
elements => [ 'Item 1', 'Item 2', 'Item 3' ],
);
$ia->add_blockquote( 'Blocked out!' );
$ia->add_embed(
source => 'http://www.example.com/embed.js',
);
view all matches for this distribution
view release on metacpan or search on metacpan
break;
case HBCNTX:
ptr = "This operation not allowed in current context";
break;
case HLOCKD:
ptr = "This object is locked by the FAME session";
break;
case HNETCN:
ptr = "Could not connect to service on host.";
break;
case HNFAME:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Farabi/files/public/assets/codemirror/addon/merge/merge.js view on Meta::CPAN
}, 5000);
};
function buildGap(dv) {
var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock");
lock.title = "Toggle locked scrolling";
var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type);
CodeMirror.on(dv.copyButtons, "click", function(e) {
var node = e.target || e.srcElement;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fedora/App/ReviewTool/Command/submit.pm view on Meta::CPAN
#summary => "Review Request: $name - $sum",
summary => $self->gen_summary($srpm),
comment => $comment,
alias => $self->_alias($name),
dependson => $self->depends_on,
blocked => $self->blocks,
bug_file_loc => "$url",
);
print "...done.\n\nReview bug for $name is: $bug\n\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fedora/Bugzilla/Bug.pm view on Meta::CPAN
'exists' => 'depends_on_bug',
'keys' => 'all_dependent_bugs',
},
);
has _blocked => (
traits => [ 'MooseX::AttributeHelpers::Trait::Collection::Bag' ],
clear_master => 'xml',
# FIXME trigger on set needed
is => 'ro',
isa => 'Bag',
auto_deref => 1,
# right now, use of lazy_build or builder is broken with this metaclass
#lazy_build => 1,
default => sub { shift->_build__blocked },
clearer => '_clear__blocked',
predicate => '_has__blocked',
lazy => 1,
provides => {
'empty' => 'blocks_anything',
'count' => 'num_blocked',
'exists' => 'blocks_bug',
'keys' => 'all_blocked_bugs',
},
);
sub _build__dependson
{ return { map { $_ => 1 } @{ shift->_from_atts('dependson') } } }
sub _build__blocked
{ return { map { $_ => 1 } @{ shift->_from_atts('blocked') } } }
has cc_list => (
traits => [ 'MooseX::AttributeHelpers::Trait::Collection::List' ],
clear_master => 'xml',
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/href.html view on Meta::CPAN
allowed you to have as many mailing lists as you wanted as long as your
total number of subscribers was fewer than (I think) 2,000. And I had set
up a few more mailing lists for other projects I had dabbled with. Last
week I revisited that account as I wanted to create
<a href="http://eepurl.com/gQUco5">a new list for Line of Succession</a>. But I found
that the account had been locked because the pricing plans had changed and
the free level could now only use a single mailing list (or âaudienceâ, as
they now describe them). So Iâve subscribed to a paid plan. And Iâve added
a sign-up form to the web site. Most of the marketing material Iâve read
agrees that getting a long list of email addresses should be one of your
prime targets - so Iâm trying to do that now.</p>
view all matches for this distribution
view release on metacpan or search on metacpan
case 423: return "Locked"; // RFC 4918
case 424: return "Failed Dependency"; // RFC 4918
case 425: return "Unordered Collection"; // RFC 3648
case 426: return "Upgrade Required"; // RFC 2817
case 449: return "Retry With"; // Microsoft
case 450: return "Blocked by Parental Controls"; // Microsoft
case 500: return "Internal Server Error";
case 501: return "Not Implemented";
case 502: return "Bad Gateway";
case 503: return "Service Unavailable";
case 504: return "Gateway Timeout";
view all matches for this distribution
view release on metacpan or search on metacpan
PeerPort => $port || 1314)
or return undef;
binmode $s;
my $self = bless {
blocked => 0,
sock => $s,
outbuf => "",
outq => {
LP => [],
},
my $flags = 0;
fcntl $self->{sock}, F_GETFL, $flags
or die "fcntl(F_GETFL) failed: $!";
fcntl $self->{sock}, F_SETFL, $flags & ~O_NONBLOCK
or die "fcntl(F_SETFL) failed: $!";
$self->{blocked} = 1;
}
sub unblock {
my $self = shift;
my $flags = 0;
fcntl $self->{sock}, F_GETFL, $flags
or die "fcntl(F_GETFL) failed: $!";
fcntl $self->{sock}, F_SETFL, $flags | O_NONBLOCK
or die "fcntl(F_SETFL) failed: $!";
$self->{blocked} = 0;
}
# Protocol encoding
use constant KEY => "ft_StUfF_key";
use constant KEYLEN => length KEY;
print "wrote $b bytes\n" if DEBUG;
last if $b == 0;
$count += $b;
substr($self->{outbuf}, 0, $b) = "";
last if $self->{blocked} and $b < 4096;
}
return $count;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/BasicFlock.pm view on Meta::CPAN
unlock($filename);
=head1 DESCRIPTION
Lock files using the flock() call. The file to be locked must
already exist. This is a very thing interface.
=head1 AUTHOR
David Muir Sharnoff, <muir@idiom.com>
view all matches for this distribution
view release on metacpan or search on metacpan
t/readwrite.t view on Meta::CPAN
ok(File::Blarf::blarf($tempfile,$joined),'Wrote array to file');
ok($read = File::Blarf::slurp($tempfile,{ Chomp => 1, }),'Read array from file (scalar context)');
is($read,$joined,'Read data is written data, even in scalar context');
#
# Try to write to a locked file
#
open(my $FH, '<', $tempfile);
flock $FH, LOCK_EX;
my $timedout = 0;
eval {
t/readwrite.t view on Meta::CPAN
};
alarm 0;
if($@ && $@ eq "timeout\n") {
$timedout = 1;
}
ok($timedout,'Write operation on locked file timed out');
flock $FH, LOCK_UN;
ok(File::Blarf::blarf($tempfile,$joined, { Flock => 1, }),'Wrote array to a, now unlocked, file');
close($FH);
view all matches for this distribution
view release on metacpan or search on metacpan
- Removed used of deprecated Class::MOP::load_class().
0.23 2013-01-26
- The new_events() watcher method blocked when using IO::Kqueue as the watcher
backend. Reported and patched by Jun Kuriyama.
0.22 2012-04-13
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Copy/ppport.h view on Meta::CPAN
get_av|5.006000|5.003007|p
getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
lib/File/Copy/ppport.h view on Meta::CPAN
PERL_MALLOC_WRAP|5.009002|5.009002|Vn
PerlMem_calloc|5.006000||Viu
PerlMem_free|5.005000||Viu
PerlMem_free_lock|5.006000||Viu
PerlMem_get_lock|5.006000||Viu
PerlMem_is_locked|5.006000||Viu
PerlMem_malloc|5.005000||Viu
PERL_MEMORY_DEBUG_HEADER_SIZE|5.019009||Viu
PerlMemParse_calloc|5.006000||Viu
PerlMemParse_free|5.006000||Viu
PerlMemParse_free_lock|5.006000||Viu
PerlMemParse_get_lock|5.006000||Viu
PerlMemParse_is_locked|5.006000||Viu
PerlMemParse_malloc|5.006000||Viu
PerlMemParse_realloc|5.006000||Viu
PerlMem_realloc|5.005000||Viu
PerlMemShared_calloc|5.006000||Viu
PerlMemShared_free|5.006000||Viu
PerlMemShared_free_lock|5.006000||Viu
PerlMemShared_get_lock|5.006000||Viu
PerlMemShared_is_locked|5.006000||Viu
PerlMemShared_malloc|5.006000||Viu
PerlMemShared_realloc|5.006000||Viu
PERL_MG_UFUNC|5.007001||Viu
Perl_modf|5.006000|5.006000|n
PERL_MULTICONCAT_HEADER_SIZE|5.027006||Viu
lib/File/Copy/ppport.h view on Meta::CPAN
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
view all matches for this distribution
view release on metacpan or search on metacpan
CounterFile.pm view on Meta::CPAN
close(F) || croak("Can't close $file: $!");
bless { file => $file, # the filename for the counter
'value' => $value, # the current value
updated => 0, # flag indicating if value has changed
# handle => XXX, # file handle symbol. Only present when locked
};
}
sub locked
{
exists shift->{handle};
}
sub lock
{
my($self) = @_;
$self->unlock if $self->locked;
my $fh = gensym();
my $file = $self->{file};
open($fh, "+<$file") or croak "Can't open $file: $!";
CounterFile.pm view on Meta::CPAN
sub unlock
{
my($self) = @_;
return unless $self->locked;
my $fh = $self->{handle};
if ($self->{updated}) {
# write back new value
CounterFile.pm view on Meta::CPAN
sub inc
{
my($self) = @_;
if ($self->locked) {
$self->{'value'}++;
$self->{updated} = 1;
} else {
$self->lock;
$self->{'value'}++;
CounterFile.pm view on Meta::CPAN
sub dec
{
my($self) = @_;
if ($self->locked) {
unless ($self->{'value'} =~ /^\d+$/) {
$self->unlock;
croak "Autodecrement is not magical in perl";
}
$self->{'value'}--;
CounterFile.pm view on Meta::CPAN
sub value
{
my($self) = @_;
my $value;
if ($self->locked) {
$value = $self->{'value'};
}
else {
$self->lock;
$value = $self->{'value'};
CounterFile.pm view on Meta::CPAN
numerical counters (digits only).
You can peek at the value of the counter (without incrementing it) by
using the C<value()> method.
The counter can be locked and unlocked with the C<lock()> and
C<unlock()> methods. Incrementing and value retrieval are faster when
the counter is locked, because we do not have to update the counter
file all the time. You can query whether the counter is locked with
the C<locked()> method.
There is also an operator overloading interface to the
File::CounterFile object. This means that you can use the C<++>
operator for incrementing and the C<--> operator for decrementing the counter,
and you can interpolate counters directly into strings.
view all matches for this distribution