--- Kyle Babich <[EMAIL PROTECTED]> wrote:
> Still getting the same problem, name requires explicit package name.
>
> #!/usr/bin/perl -wT
> use strict;
> use Data::Dumper;
> use CGI qw( :standard );
>
> print header ( "text/html" );
>
> my $hash_ref = do ( 'fried.dat' ) || die "error: unable to open
> fried.txt\n";
> print Dumper $hash_ref;
>
> print <<"EndOfHTML";
>
> our($name); chicken
>
> EndOfHTML
>
> fried.dat:
>
> {
> name => 'fried'
> }
Kyle,
That's because, with the example I sent, you are populating a hashref with the 'do'
statement.
You don't have any scalar called $name. Change this:
our($name); chicken
To this:
$hash_ref->{name} chicken
Also, you probably will want to read "perldoc perlreftut" (type that at the command
line without
the quotes). That will explain how references work and make this easier to understand.
Cheers,
Curtis "Ovid" Poe
=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]