root/lang/perl/Spread-DStorage/trunk/examples/client.pl
@
10933
| Revision 10933, 393 bytes (checked in by fujiwara, 5 years ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | #!/usr/bin/perl |
| 2 | use strict; |
| 3 | use Spread::DStorage::Client; |
| 4 | $| = 1; |
| 5 | |
| 6 | my $client = Spread::DStorage::Client->new; |
| 7 | print "> "; |
| 8 | while (<>) { |
| 9 | chomp; |
| 10 | if ( /^set (.+?) (.+)$/i ) { |
| 11 | print ">> ", $client->set( $1 => $2 ), "\n"; |
| 12 | } |
| 13 | elsif ( /^get (.+?)$/i ) { |
| 14 | print ">> ", $client->get($1), "\n"; |
| 15 | } |
| 16 | else { |
| 17 | print "invalid command\n"; |
| 18 | } |
| 19 | print "\n> "; |
| 20 | } |
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)