FAQ
The sample code uses O_* constants that won't be imported by the use statement as it stands currently, since it names a specific tag set. This is against perl -current.

--- pod/perlfaq5.pod.orig Mon Oct 23 18:22:27 2000
+++ pod/perlfaq5.pod Mon Oct 23 18:24:09 2000
@@ -705,7 +705,7 @@

Anyway, this is what you can do if you can't help yourself.

- use Fcntl ':flock';
+ use Fcntl ':DEFAULT :flock';
sysopen(FH, "numfile", O_RDWR|O_CREAT) or die "can't open numfile: $!";
flock(FH, LOCK_EX) or die "can't flock numfile: $!";
$num = <FH> || 0;

Search Discussions

  • Ronald J Kimball at Oct 24, 2000 at 2:09 am

    On Mon, Oct 23, 2000 at 06:29:11PM -0700, Peter Scott wrote:
    The sample code uses O_* constants that won't be imported by the use
    statement as it stands currently, since it names a specific tag set.
    This is against perl -current.
    --- pod/perlfaq5.pod.orig Mon Oct 23 18:22:27 2000
    +++ pod/perlfaq5.pod Mon Oct 23 18:24:09 2000
    @@ -705,7 +705,7 @@

    Anyway, this is what you can do if you can't help yourself.

    - use Fcntl ':flock';
    + use Fcntl ':DEFAULT :flock';
    Er, shouldn't that be a list?

    use Fcntl qw/:DEFAULT :flock/;

    Ronald
  • Peter Scott at Oct 24, 2000 at 2:48 am

    At 10:09 PM 10/23/00 -0400, Ronald J Kimball wrote:
    On Mon, Oct 23, 2000 at 06:29:11PM -0700, Peter Scott wrote:
    The sample code uses O_* constants that won't be imported by the use
    statement as it stands currently, since it names a specific tag set.
    This is against perl -current.
    --- pod/perlfaq5.pod.orig Mon Oct 23 18:22:27 2000
    +++ pod/perlfaq5.pod Mon Oct 23 18:24:09 2000
    @@ -705,7 +705,7 @@

    Anyway, this is what you can do if you can't help yourself.

    - use Fcntl ':flock';
    + use Fcntl ':DEFAULT :flock';
    Er, shouldn't that be a list?

    use Fcntl qw/:DEFAULT :flock/;
    D*mn. I'm so used to seeing qw even for single imports in 'use' that I didn't even look. Thanks. Correct patch:


    --- pod/perlfaq5.pod.orig Mon Oct 23 18:22:27 2000
    +++ pod/perlfaq5.pod Mon Oct 23 19:50:18 2000
    @@ -705,7 +705,7 @@

    Anyway, this is what you can do if you can't help yourself.

    - use Fcntl ':flock';
    + use Fcntl qw(:DEFAULT :flock);
    sysopen(FH, "numfile", O_RDWR|O_CREAT) or die "can't open numfile: $!";
    flock(FH, LOCK_EX) or die "can't flock numfile: $!";
    $num = <FH> || 0;

    --
    Peter Scott
    Pacific Systems Design Technologies
  • Jarkko Hietaniemi at Oct 24, 2000 at 1:40 pm

    Er, shouldn't that be a list?

    use Fcntl qw/:DEFAULT :flock/;
    D*mn. I'm so used to seeing qw even for single imports in 'use' that I didn't even look. Thanks. Correct patch:
    Applied, thanks.

    --
    $jhi++; # http://www.iki.fi/jhi/
    # There is this special biologist word we use for 'stable'.
    # It is 'dead'. -- Jack Cohen

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedOct 24, '00 at 1:28a
activeOct 24, '00 at 1:40p
posts4
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase