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

Revelation's scratchpad

by Revelation (Deacon)
on Jun 05, 2004 at 13:03 UTC ( #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?

What's my password?
Create A New User
[thezip]: I don't intend on doing any offline development in the Czech Republic soon, so i think I'm safe!
[thezip]: :-)
[choroba]: Yeah, there are countries with wifi everywhere
[choroba]: also, I didn't have a smart phone at that time

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2017-03-23 21:08 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (294 votes). Check out past polls.