this does not work:
sub extract{
#retrieve subset of data from a single file
#return that data in a list context
my $fh = shift; #filehandle reference
my @creds;
local $/ = '<entry>';
@creds = grep {/./} $fh;
@creds
}
this does work::
sub extract{
#retrieve subset of data from a single file
#return that data in a list context
my $fh = shift; #filehandle reference
my @creds;
local $/ = '<entry>';
for (<$fh>){ push @creds,$_};
@creds
}
the first returns *main::IN
the second returns the actual data that i want.
i looked at perldoc perlref and the camel book- tried different ways of
doing things- but i must be missing something!!!
I doubt that one is much better than the other for what i want to do,
but i would like to understand why i can't do it the first way.
*sigh*
thanks :)
willy
http://www.hackswell.com/corenth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>