LINUX CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
Mandriva Linux
2008.1 / 2009 RC1

256,150
Fedora 9 / 10 Alpha
216,522
KNOPPIX Live DVD
5.3.1

209,884
Kororaa AIGLXgl Live
CD 0.3

180,509
Beryl 0.2.1
178,619
BackTrack 3.0
171,720
aircrack 2.41
158,233
MPlayer 1.0 RC2
158,135
VLC 0.9.0
113,121
Cedega 6.0
108,001

WEEK'S BEST

  • Softpedia Linux RS...
  • Ubuntu 8.04.1
  • Pidgin 2.5.1
  • Adobe Flash Player...
  • The Gimp 2.4.7 / 2...
  • openSUSE Linux 11....
  • Linux Kernel 2.6.2...
  • Super Grub Disk 0....
  • Skype 2.0.068
  • OpenOffice.org 2.4...
  • Mozilla Firefox 3....
  • Transmission 1.33
  • DeVeDe 3.11b
  • Wine 1.1.3
  • wine-doors 0.1.2
  • Shoreline Firewall...
  • Linux Mint 5.0
  • Google Gadgets 0.1...
  • Fedora 9 / 10 Alpha
  • Opera 9.52
  • Home / Linux / Programming / Libraries

    Want 0.18



    No screenshots available
    Downloads: 57  Add to download basket  Tell us about an update
    User Rating:
    Rated by:
    Good (3.8/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robin Houston | More programs
    Perl Artistic License / FREE
    February 4th, 2008, 17:49 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Add a review  Refer to a friend  Subscribe

     

    Want description

     

    Want is a Perl module created to implement the `want' command.

    Want is a Perl module created to implement the `want' command.

    SYNOPSIS

    use Want;
    sub foo :lvalue {
    if (want(qw'LVALUE ASSIGN')) {
    print "We have been assigned ", want('ASSIGN');
    lnoreturn;
    }
    elsif (want('LIST')) {
    rreturn (1, 2, 3);
    }
    elsif (want('BOOL')) {
    rreturn 0;
    }
    elsif (want(qw'SCALAR !REF')) {
    rreturn 23;
    }
    elsif (want('HASH')) {
    rreturn { foo => 17, bar => 23 };
    }
    return
    }

    This module generalises the mechanism of the wantarray function, allowing a function to determine in some detail how its return value is going to be immediately used.

    ...

    EXAMPLES

    use Carp 'croak';
    use Want 'howmany';
    sub numbers {
    my $count = howmany();
    croak("Can't make an infinite list") if !defined($count);
    return (1..$count);
    }
    my ($one, $two, $three) = numbers();


    use Want 'want';
    sub pi () {
    if (want('ARRAY')) {
    return [3, 1, 4, 1, 5, 9];
    }
    elsif (want('LIST')) {
    return (3, 1, 4, 1, 5, 9);
    }
    else {
    return 3;
    }
    }
    print pi->[2]; # prints 4
    print ((pi)[3]); # prints 1


    sub backstr :lvalue {
    if (want(qw'LVALUE ASSIGN')) {
    my ($a) = want('ASSIGN');
    $_[0] = reverse $a;
    return undef;
    }
    elsif (want('RVALUE')) {
    my $t = scalar reverse $_[0];
    }
    else {
    carp("Not in ASSIGN context");
    }
    return
    }

    print "foo -> ", backstr("foo"), "n"; # foo -> oof
    backstr(my $robin) = "nibor";
    print "$robin is now $robinn"; # $robin is now robin

    Requirements:

    · Perl

      


    TAGS:

    implement want | want command | Perl module | Want | implement | want

    Related downloads IT News Popular downloads New additions   Latest reviews  
    Crypt::KDF::BaseKDFGenerator 0.02
    Crypt::KDF::BaseKDFGenerator is a basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033.
    Crypt::Imail 0.01
    Crypt::Imail is a Perl module that can be used to encrypt and decrypt IMail passwords.
    Crypt::KDF::KDF2Generator 0.02
    Crypt::KDF::KDF2Generator is a KDF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033.
    Crypt::KDF::KDF1Generator 0.02
    Crypt::KDF::KDF1Generator is a KDF1 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033.
    Crypt::HCE_SHA 0.70
    Crypt::HCE_SHA is a Perl extension implementing one way hash chaining encryption using SHA.


    HTML code for linking to this page:


    Go to top



    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM