4 my $prog = $0; $prog =~ s,.*/,,;
5 die "Usage: $prog <uri> [<method> [<args>]...]\n";
14 my @ctor_arg = ($uri);
15 push(@ctor_arg, shift) while @ARGV && $ARGV[0] =~ s/^\+//;
17 $uri = URI->new(@ctor_arg);
21 my $list_context = ($method =~ s/^\@//);
22 #print "URI->new(\"$uri\")->$method ==> ";
24 undef($_) if $_ eq "UNDEF";
29 @result = $uri->$method(@ARGV);
31 @result = scalar($uri->$method(@ARGV));
36 $_ = "«$_»" if /^\s*$/;
41 print join(" ", @result), "\n";
43 print "$uri\n" unless $orig eq $uri;
46 # Some extra methods that might be nice
48 sub UNIVERSAL::class { ref($_[0]) }
52 my $d = Data::Dumper->Dump(\@_, ["self", "arg1", "arg2", "arg3", "arg4"]);