Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Extracting Directories and Sub Directories and Countin
WICHTIG  !!!!!!!!                   Hi ihr Perlers

Ich möchte Euch mitteilen, das Ihr den """Wallbanger"""" bitte aus Eurer
Liste streichen sollt.!!!!!!!!!!
Ich habe keine Lust, jeden Montag über 100 Mails von Euch zu Löschen.
OLAF KLENNER ist jetzt ein 1/2 Jahr schon TOD !!!!!!

mit lieben Gruß

Sonja    seine Frau!!!!!



----- Original Message -----
From: "Gunnar Hjalmarsson" <noreply@gunnar.cc>
To: <beginners@perl.org>
Sent: Friday, October 29, 2004 1:19 AM
Subject: Re: Extracting Directories and Sub Directories and Counting


> [ replying to the list since that's where the discussion belongs ]
>
> Ron Smith wrote (to me privately): 
>
> Well, it's not a special variable type. $HoA{$dir} is a reference to an
> anonymous array, which you dereference with the @{ $HoA{$dir} } construct.
> 
>
> I now realize that the small piece of code above combines three
> components of Perl that make it a really powerful programming language:
> Hashes, references and regular expressions.
> 
>
> Sounds plausible. :)
> 
>
> Hmm.. It's usually practical to not add "\n" like that, but take care of
> linebreaks in connection with printing the variable. Without adding
> "\n", instead of saying
>
>      print @basenames;
>
> you can say e.g.
>
>      print join("\n", @basenames), "\n";
> 
>
> No, it's rather just because you didn't declare the %count hash properly
> (you also had 'frames' instead of '$frames' a couple of times). Instead of
>
>      for my $frames (@{ $HoA{$dir}}) {
>          my $count{frames} += 1;
>          print "$count{frames}\n";
>      }
>
> you want
>
>      my %count;
>      for my $frames ( @{ $HoA{$dir} } ) {
>          $count{$frames} += 1;
>          print "$count{$frames}\n";
>      }
> 
>
> Now when I've helped you with the syntax error, I believe you can figure
> out how to print the counts similar to what you did with the previous
> code version. If not, please feel free to post (to the list) again.
> 
>
> References and data structures are indeed tricky in the beginning - I
> sure thought they were - but they are well documented at the same time.
> These are some applicable parts of the Perl docs:
>
>      perldoc perlreftut
>      perldoc perlref
>
>      perldoc perldsc
>      perldoc perllol
>
> As regards books, others are better suited than me to give
> recommendations (the only Perl book I have is the "Camel").
> 
>
> Only you can tell.
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Sonja
10-29-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:27 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.