Want 0.14
Sponsored Links
Want 0.14 Ranking & Summary
File size:
0.017 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
902
Date added:
2007-05-05
Publisher:
Robin Houston
Want 0.14 description
Want is a Perl module created to implement the `want command.
SYNOPSIS
use Want;
sub foo :lvalue {
if (want(qwLVALUE ASSIGN)) {
print "We have been assigned ", want(ASSIGN);
lnoreturn;
}
elsif (want(LIST)) {
rreturn (1, 2, 3);
}
elsif (want(BOOL)) {
rreturn 0;
}
elsif (want(qwSCALAR !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("Cant 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(qwLVALUE 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
SYNOPSIS
use Want;
sub foo :lvalue {
if (want(qwLVALUE ASSIGN)) {
print "We have been assigned ", want(ASSIGN);
lnoreturn;
}
elsif (want(LIST)) {
rreturn (1, 2, 3);
}
elsif (want(BOOL)) {
rreturn 0;
}
elsif (want(qwSCALAR !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("Cant 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(qwLVALUE 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
Want 0.14 Screenshot
Want 0.14 Keywords
Bookmark Want 0.14
Want 0.14 Copyright
WareSeeker periodically updates pricing and software information of Want 0.14 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Want 0.14 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
returning to work
tax return
return to sender
return on equity
return to mysterious island
superman returns
return the favor
perl modules
return of the mack
return to castle wolfenstein
return on investment
batman returns
safe return
return address labels
return the favour
install perl module
return on assets
return the favor keri hilson
Related Software
PLJava is Perl module that will embed Perl into Java. Free Download
Devel::Hints is a Perl module created to access compile-time hints at runtime. Free Download
EasyTool is the library of Perl Functions in Common Usage. Free Download
JDBC is a Perl 5 interface to Java JDBC (via Inline::Java). Free Download
Text::WagnerFischer is an implementation of the Wagner-Fischer edit distance. Free Download
Inline-API is a Perl module that teach you how to bind a programming language to Perl using Inline.pm. Free Download
foundation Perl module inheritance without objects. Free Download
App::Manager is a Perl module for installing, managing and uninstalling software packages. Free Download
Latest Software
Popular Software
Favourite Software