wrote:
> On Oct 17, 2:59Â*pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
> wrote:
>> cyrusgre...@gmail.com 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!