Re: Need help on AoH or array or any other think that might help!
- From: Tim Greer <tim@xxxxxxxxxxxxx>
- Date: Fri, 17 Oct 2008 18:07:57 -0700
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!
.
- Follow-Ups:
- Re: Need help on AoH or array or any other think that might help!
- From: J. Gleixner
- Re: Need help on AoH or array or any other think that might help!
- References:
- Need help on AoH or array or any other think that might help!
- From: cyrusgreats
- Re: Need help on AoH or array or any other think that might help!
- From: J. Gleixner
- Re: Need help on AoH or array or any other think that might help!
- From: cyrusgreats
- Need help on AoH or array or any other think that might help!
- Prev by Date: FAQ 4.7 How do I multiply matrices?
- Next by Date: Re: Help: How to install a *.pm module
- Previous by thread: Re: Need help on AoH or array or any other think that might help!
- Next by thread: Re: Need help on AoH or array or any other think that might help!
- Index(es):
Relevant Pages
|