Re: Need help on AoH or array or any other think that might help!



cyrusgreats@xxxxxxxxx wrote:

On Oct 17, 2:59 pm, "J. Gleixner" <glex_no-s...@xxxxxxxxxxxxxxxxxxxxx>
wrote:
cyrusgre...@xxxxxxxxx wrote:
Hello good people out there. I need to write a perl script that
will parse the log and generate the following output:

What have you done so far and what questions do you have?

Any help will be appreciated...million thanks in advance

Put in some sort of effort by at least reading some
documentation, or maybe a book, and posting your code.

perldoc -f split
perldoc -f open
perldoc perldsc

here portion of the code:

my %inventory;
open (FILE, $file) || die ("Could not open file. $!");
foreach my $el (<FILE)>) {

^^^ You should always copy and paste your actual code you're using. The
above is broken: (<FILE)>)

($name, $category, $item, $price) = split ("|", $el);

I don't think that's going to do what you want. Did you print the
output to ensure it's going to work how you want, before you save the
values into a hash. I'd start there, fixing those issues, before you
try and move onto saving the hash keys/values and processing against
it.

--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.



Relevant Pages

  • Re: Need help on AoH or array or any other think that might help!
    ... perldoc -f split ... of foreach), but it will run. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Arrays instead of files into hashes
    ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ... terminology extraction for linguistic purposes. ... little script and the output is an array which I can display in a file ...
    (comp.lang.perl.misc)
  • Re: Need help on AoH or array or any other think that might help!
    ... of foreach), but it will run. ... understand the issue now that you've seen the code this was in response ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Newbie php problem
    ... Please forget the first part of the script, as I do put some extra ... accepting input, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (alt.php)
  • Re: Favorite object-oriented modules?
    ... Programming in Perl? ... developing with other people that do go crazy and not CPAN modules. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)