Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Revelation's scratchpad

by Revelation (Deacon)
on Jun 05, 2004 at 13:03 UTC ( [id://361591]=scratchpad: print w/replies, xml ) Need Help??

For jkeenan1: Another solution would be to user perl 5.8's ability to open in memory files:
@input = qw/here is some input/; my $imfile = join "\n",@input; open(MEMORY,'+<', \$imfile) or die "Can't open memory file: $!"; # Then use IO::Handle or open to just override STDIN. # To be comprehensive you could check the version of perl. If it's no +t high enough, you could require IO::String, to solve the problem, as + well..
Something For me:
sub parameters { return bless [ $_[0], $_[0]->{'params'} ], DummyNameSpace if want('O +BJECT'); # Single Param. return %{$_[0]->{'params'}; # This will create a } package DummyNameSpace; our $AUTOLOAD; sub isa { $_[0]->[1]->{'isa'} = $_[1] if defined $_[1]; return $_[0]->[1]->{'isa'}; } sub VERSION { $_[0]->[1]->{'VERSION'} = $_[1] if defined $_[1]; return $_[0]->[1]->{'VERSION'}; } sub can { $_[0]->[1]->{'can'} = $_[1] if defined $_[1]; return $_[0]->[1]->{'can'}; } sub AUTOLOAD { ref(my $o = shift) or die; # don't mess with garbage collection my $o1 = $o->[1]; ( my $method = $AUTOLOAD ) =~ s{.*::}{}; if ( !$method ) { # AUTOLOAD AS PARAM. $o1->{'AUTOLOAD'} = $_[0] if defined $_[0]; return $o1->{'AUTOLOAD'} } if ( $method =~ /^DESTROY$/ ) { return if !defined wantarray; $o1->{'DESTROY'} = $_[0] if defined $_[0]; return $o1->{'DESTROY'}; } $o1->{$method} = $_[0] if defined $_[0] and return $o1->{$method}; undef $AUTOLOAD; } 1;
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-28 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found