Sponsored Content
Top Forums Programming Perl: restrict perl from automaticaly creating a hash branches on check Post 302924341 by durden_tyler on Saturday 8th of November 2014 02:12:18 AM
Old 11-08-2014
That's a documented behavior in Perl and is called "autovivification".
Check the stackoverflow website for the question "How do I disable autovivification in Perl?" for a detailed discussion and workarounds.

gandolf989 has a point here. Any reason you do *not* want the intermediate branches to be created? As long as they are empty and your existence checks return the values as expected, your program should be fine.

Autovivification in Perl is by design. It's not a bug; it's a feature. And I think it stems from Perl's tendency to go out of its way to make your text processing task easy.
For an in-depth technical discussion of why it works like that, what its advantages are and what problems it solves, check this link: http://www.sysarch.com/Perl/autoviv.txt
This User Gave Thanks to durden_tyler For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Hash

HI I have a hash like this $hashname->{$filesystem}->{'fsname'}=$filesystem; How to get the values from this multilevel hash. Thanks in advance... :) (1 Reply)
Discussion started by: Harikrishna
1 Replies

2. Shell Programming and Scripting

Perl Hash

hi i have two hash achi %disk1,%disk2 with( key, value) (key1,value1) How to store it in another hash.. Plz replyyy. Regards Hari (1 Reply)
Discussion started by: Harikrishna
1 Replies

3. Shell Programming and Scripting

perl (word by word check if a hash key)

Hi, Now i work in a code that 1-get data stored in the database in the form of hash table with a key field which is the " Name" 2-in the same time i open a txt file and loop through it word by word 3- which i have a problem in is that : I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies

4. UNIX for Advanced & Expert Users

Perl loop txt and check if a hash key

Hi, The task i have to do is to 1- create a database contains the Names .run the query and store results in hash make the Name field is the hash key 2- in the same time i have a txt which i will loop through it word by word and check for each word if a hash key ( compare it with the Names in... (0 Replies)
Discussion started by: eng_shimaa
0 Replies

5. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

6. Shell Programming and Scripting

perl hash - using a range as a hash key.

Hi, In Perl, is it possible to use a range of numbers with '..' as a key in a hash? Something in like: %hash = ( '768..1536' => '1G', '1537..2560' => '2G' ); That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies

7. Shell Programming and Scripting

Perl hash help

Hi , i have the below code its working fine when i execute in unix , but its not working in windows could you pls explain me where i am going wrong. This is the program $data = { '1' => 'one' , '2' => 'two' , 3 => 'three' }; print "hello : $data->{'1'}... (2 Replies)
Discussion started by: ragilla
2 Replies

8. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

9. Programming

Perl: How to load some functions automaticaly, starting Perl inteructively (with -d -e 0)?

I would like to use Perl in 'interactive' mode (kind off), starting it by > perl -d -e 0; But I need to have some function be read on loading. Also, it should not be for anyone who starting Perl or use it any how. I did try to search, but not much result. I have try a file '.perldb':... (1 Reply)
Discussion started by: alex_5161
1 Replies

10. Shell Programming and Scripting

Restrict remote DB connection from PERL

I have PERL code to connect to Oracle database using DBI. e.g. $PERL -e "use DBI; DBI->connect(qw(DBI:Oracle:db111 testu testpass));" by using DBI , if remote DB added to tnsnames.ora , I can connect using DBI . is there a way to restrict not to connect to remote DB using DBI ? ... (1 Reply)
Discussion started by: talashil
1 Replies
PERLCOMMUNITY(1)					 Perl Programmers Reference Guide					  PERLCOMMUNITY(1)

NAME
perlcommunity - a brief overview of the Perl community DESCRIPTION
This document aims to provide an overview of the vast perl community, which is far too large and diverse to provide a detailed listing. If any specific niche has been forgotten, it is not meant as an insult but an omission for the sake of brevity. The Perl community is as diverse as Perl, and there is a large amount of evidence that the Perl users apply TMTOWTDI to all endeavors, not just programming. From websites, to IRC, to mailing lists, there is more than one way to get involved in the community. Where to Find the Community There is a central directory for the Perl community: <http://perl.org> maintained by the Perl Foundation (<http://www.perlfoundation.org/>), which tracks and provides services for a variety of other community sites. Mailing Lists and Newsgroups Perl runs on e-mail; there is no doubt about it. The Camel book was originally written mostly over e-mail and today Perl's development is co-ordinated through mailing lists. The largest repository of Perl mailing lists is located at <http://lists.perl.org>. Most Perl-related projects set up mailing lists for both users and contributors. If you don't see a certain project listed at <http://lists.perl.org>, check the particular website for that project. Most mailing lists are archived at <http://nntp.perl.org/>. There are also plenty of Perl related newsgroups located under "comp.lang.perl.*". IRC The Perl community has a rather large IRC presence. For starters, it has its own IRC network, <irc://irc.perl.org>. General (not help- oriented) chat can be found at <irc://irc.perl.org/#perl>. Many other more specific chats are also hosted on the network. Information about irc.perl.org is located on the network's website: <http://www.irc.perl.org>. For a more help-oriented #perl, check out <irc://irc.freenode.net/#perl>. Perl 6 development also has a presence in <irc://irc.freenode.net/#perl6>. Most Perl-related channels will be kind enough to point you in the right direction if you ask nicely. Any large IRC network (Dalnet, EFnet) is also likely to have a #perl channel, with varying activity levels. Websites Perl websites come in a variety of forms, but they fit into two large categories: forums and news websites. There are many Perl-related websites, so only a few of the community's largest are mentioned here. News sites <http://perl.com/> Run by O'Reilly Media (the publisher of the Camel Book, among other Perl-related literature), perl.com provides current Perl news, articles, and resources for Perl developers as well as a directory of other useful websites. <http://blogs.perl.org/> Many members of the community have a Perl-related blog on this site. If you'd like to join them, you can sign up for free. <http://use.perl.org/> use Perl; used to provide a slashdot-style news/blog website covering all things Perl, from minutes of the meetings of the Perl 6 Design team to conference announcements with (ir)relevant discussion. It no longer accepts updates, but you can still use the site to read old entries and comments. Forums <http://www.perlmonks.org/> PerlMonks is one of the largest Perl forums, and describes itself as "A place for individuals to polish, improve, and showcase their Perl skills." and "A community which allows everyone to grow and learn from each other." <http://stackoverflow.com/> Stack Overflow is a free question-and-answer site for programmers. It's not focussed solely on Perl, but it does have an active group of users who do their best to help people with their Perl programming questions. User Groups Many cities around the world have local Perl Mongers chapters. A Perl Mongers chapter is a local user group which typically holds regular in-person meetings, both social and technical; helps organize local conferences, workshops, and hackathons; and provides a mailing list or other continual contact method for its members to keep in touch. To find your local Perl Mongers (or PM as they're commonly abbreviated) group check the international Perl Mongers directory at <http://www.pm.org/>. Workshops Perl workshops are, as the name might suggest, workshops where Perl is taught in a variety of ways. At the workshops, subjects range from a beginner's introduction (such as the Pittsburgh Perl Workshop's "Zero To Perl") to much more advanced subjects. There are several great resources for locating workshops: the websites mentioned above, the calendar mentioned below, and the YAPC Europe website, <http://www.yapceurope.org/>, which is probably the best resource for European Perl events. Hackathons Hackathons are a very different kind of gathering where Perl hackers gather to do just that, hack nonstop for an extended (several day) period on a specific project or projects. Information about hackathons can be located in the same place as information about workshops as well as in <irc://irc.perl.org/#perl>. If you have never been to a hackathon, here are a few basic things you need to know before attending: have a working laptop and know how to use it; check out the involved projects beforehand; have the necessary version control client; and bring backup equipment (an extra LAN cable, additional power strips, etc.) because someone will forget. Conventions Perl has two major annual conventions: The Perl Conference (now part of OSCON), put on by O'Reilly, and Yet Another Perl Conference or YAPC (pronounced yap-see), which is localized into several regional YAPCs (North America, Europe, Asia) in a stunning grassroots display by the Perl community. For more information about either conference, check out their respective web pages: OSCON <http://conferences.oreillynet.com/>; YAPC <http://www.yapc.org>. A relatively new conference franchise with a large Perl portion is the Open Source Developers Conference or OSDC. First held in Australia it has recently also spread to Israel and France. More information can be found at: <http://www.osdc.com.au/> for Australia, <http://www.osdc.org.il> for Israel, and <http://www.osdc.fr/> for France. Calendar of Perl Events The Perl Review, <http://www.theperlreview.com> maintains a website and Google calendar (<http://www.theperlreview.com/community_calendar>) for tracking workshops, hackathons, Perl Mongers meetings, and other events. Views of this calendar are at <http://www.perl.org/events.html> and <http://www.yapc.org>. Not every event or Perl Mongers group is on that calendar, so don't lose heart if you don't see yours posted. To have your event or group listed, contact brian d foy (brian@theperlreview.com). AUTHOR
Edgar "Trizor" Bering <trizor@gmail.com> perl v5.18.2 2013-11-04 PERLCOMMUNITY(1)
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy