SVN: toys/rsget.pl/RSGet: Get.pm Processor.pm

sparky sparky at pld-linux.org
Thu Sep 17 23:47:12 CEST 2009


Author: sparky
Date: Thu Sep 17 23:47:12 2009
New Revision: 10620

Modified:
   toys/rsget.pl/RSGet/Get.pm
   toys/rsget.pl/RSGet/Processor.pm
Log:
- cookie creator


Modified: toys/rsget.pl/RSGet/Get.pm
==============================================================================
--- toys/rsget.pl/RSGet/Get.pm	(original)
+++ toys/rsget.pl/RSGet/Get.pm	Thu Sep 17 23:47:12 2009
@@ -136,6 +136,20 @@
 	return $self->stage0();
 }
 
+sub cookie
+{
+	my $self = shift;
+
+	return unless $self->{_cookie};
+	return if -r $self->{_cookie};
+
+	open my $c, ">", $self->{_cookie};
+	foreach my $line ( @_ ) {
+		print $c join( "\t", @$line ), "\n";
+	}
+	close $c;
+}
+
 sub get
 {
 	my $self = shift;

Modified: toys/rsget.pl/RSGet/Processor.pm
==============================================================================
--- toys/rsget.pl/RSGet/Processor.pm	(original)
+++ toys/rsget.pl/RSGet/Processor.pm	Thu Sep 17 23:47:12 2009
@@ -42,6 +42,12 @@
 	pr join( ", ", @opts ) . ", " if @opts;
 }
 
+sub p_func
+{
+	my $f = shift;
+	pr $space . "\${self}->$f(";
+}
+
 sub p_line
 {
 	s/\$-{/\$self->{/g;
@@ -205,11 +211,8 @@
 		} elsif ( s/^MULTI\s*\(// ) {
 			p_ret( "multi" );
 			p_line();
-		} elsif ( s/^PRINT\s*\(// ) {
-			pr $space . '$self->print(';
-			p_line();
-		} elsif ( s/^LOG\s*\(// ) {
-			pr $space . '$self->log(';
+		} elsif ( s/^(PRINT|LOG|COOKIE)\s*\(// ) {
+			p_func( lc $1 );
 			p_line();
 		} elsif ( s/^!\s+// ) {
 			my $line = quotemeta $_;


More information about the pld-cvs-commit mailing list