VGR has asked for the wisdom of the Perl Monks concerning the following question:
i'm not quiet sure how to use data::dumper...name = "varun" ip='9.12.23.222' #including the irregular spaces
OUTPUT :#!/usr/bin/perl use strict; use warnings; $data="./DATA.txt"; if (open(INFILE, $data)) { @svr_raw = <INFILE>; close(INFILE); } else { print "File $data does not exist or is corrupted\n"; } print $svr_raw->{name};
Required output:administrator@varunraj ~/scripts $ ./learn_2.pl Global symbol "$data" requires explicit package name at ./learn_2.pl l +ine 6. Global symbol "$data" requires explicit package name at ./learn_2.pl l +ine 8. Global symbol "@svr_raw" requires explicit package name at ./learn_2.p +l line 9. Global symbol "$data" requires explicit package name at ./learn_2.pl l +ine 12. Global symbol "$svr_raw" requires explicit package name at ./learn_2.p +l line 15 Execution of ./learn_2.pl aborted due to compilation errors.
varun
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing data present in a text file with references...
by CountZero (Bishop) on Feb 14, 2010 at 20:46 UTC | |
by VGR (Acolyte) on Feb 14, 2010 at 20:57 UTC | |
by CountZero (Bishop) on Feb 14, 2010 at 21:12 UTC | |
|
Re: Accessing data present in a text file with references...
by GrandFather (Saint) on Feb 14, 2010 at 21:07 UTC | |
|
Re: Accessing data present in a text file with references...
by GrandFather (Saint) on Feb 14, 2010 at 20:31 UTC | |
by VGR (Acolyte) on Feb 14, 2010 at 20:47 UTC | |
|
Re: Accessing data present in a text file with references...
by biohisham (Priest) on Feb 15, 2010 at 08:54 UTC |