From tim at consultix-inc.com Tue Sep 6 08:50:36 2005 From: tim at consultix-inc.com (Tim Maher) Date: Tue, 6 Sep 2005 08:50:36 -0700 Subject: SPUG: Perl needs a better IDE article Message-ID: <20050906155036.GA27378@jumpy.consultix-inc.com> Go to www.perl.com, and click on the "Improving Perl's Tools" graphic in the upper left corner, for an interesting article. The author feels that one reason that Java is eating Perl's lunch in the enterprise is that Perl's development tools, which for most JAPHs are simply vi or emacs and PerlTidy, are many years behind Java's. He talks about ECLIPSE, and other IDEs, that could be enhanced to close this gap. It's a well written and extensively researched article, so check it out! -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my Fall, 2005 book: "Minimal Perl for UNIX/Linux People" | | See http://minimalperl.com for details, ordering, and email-list signup | *--------------------------------------------------------------------------* From keith.reed at philips.com Tue Sep 6 09:06:55 2005 From: keith.reed at philips.com (Keith Reed) Date: Tue, 6 Sep 2005 09:06:55 -0700 Subject: SPUG: Perl needs a better IDE article In-Reply-To: <20050906155036.GA27378@jumpy.consultix-inc.com> Message-ID: by way of discussion, I wonder if any part of Perl's lagging is caused by modules falling out of support by ActiveState's release of Perl. One example that comes to mind is GD::Graph. We built some web-based lines-of-code graphing/trending programs, and over the course of time, the GD packages were no longer built or bundled with ActiveState's Perl. We have also had trouble with Microsoft's CommonDialog control no longer working from our Perl command-line programs. Even some Tk stuff has broken with the most recent release of Perl. As a language, Perl is cool. It has made some pretty difficult tasks, reasonable. We're starting to look a C# and the .NET framework, because MS has seemingly taken a Perlesque approach to the language and provided soooo many libraries and components. As always, we plan on using (at least what we think is) the right tool for the right job, and Perl is so versatile. Keith Tim Maher Sent by: spug-list-bounces at pm.org 2005-09-06 08:50 AM Please respond to tim at consultix-inc.com To spug-list at pm.org cc Subject SPUG: Perl needs a better IDE article Classification Go to www.perl.com, and click on the "Improving Perl's Tools" graphic in the upper left corner, for an interesting article. The author feels that one reason that Java is eating Perl's lunch in the enterprise is that Perl's development tools, which for most JAPHs are simply vi or emacs and PerlTidy, are many years behind Java's. He talks about ECLIPSE, and other IDEs, that could be enhanced to close this gap. It's a well written and extensively researched article, so check it out! -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my Fall, 2005 book: "Minimal Perl for UNIX/Linux People" | | See http://minimalperl.com for details, ordering, and email-list signup | *--------------------------------------------------------------------------* _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050906/9146f2b8/attachment.html From jobs-noreply at seattleperl.org Wed Sep 7 09:24:38 2005 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed, 7 Sep 2005 09:24:38 -0700 (PDT) Subject: SPUG: JOB: Seattle Central, Instructor of Web Programming in Perl Message-ID: The IT Programs Department at Seattle Central Community College provides IT education in the areas of Networking, Databases, Programming, Web Design/Development. We have an immediate need for an instructor to teach ITC 216 Web Programming using PERL and ITC 280 Web Databases with PHP/MySQL. ITC 216 is a server-side programming class geared toward Web Developers and Programmers, while ITC 280 is similar but adds database functionality to web sites using MySQL. Students have, at minimum, 3-4 quarters programming experience (1/2-1year). ITC 216 will be offered Mondays/Wednesdays 1-3:15, ITC 280 will be offered Mondays/Wednesdays 10-12:05. Persons interested in pursuing this teaching opportunity must have advanced knowledge of the programming language being used, and its applications to Web Development, including a minimum of 3-4 years industry experience in Web Development. Previous teaching experience is desired, but not required. This is a contract position for the fall quarter (duration September 26-December 20); instructor would have a very short time frame to develop a syllabus for the class before the start of the quarter. Pay scale averages $4000/class, depending on experience. Placement would be directly with Seattle Central. We are located at 1701 Broadway, Seattle WA. This is an on-campus course, telecommuting is not an option. Interested persons should send an email indicating interest and a resume to Lisa Sandoval at lsandoval at sccd.ctc.edu . Course outlines are available upon request. Lisa Sandoval Information Technology Programs Seattle Central Community College 1701 Broadway 2BE 3166 Seattle, WA 98122 Phone: (206) 287-5558 --direct line (206) 587-6327 --front office Email: lsandoval at sccd.ctc.edu From wildwood_players at yahoo.com Thu Sep 8 15:23:07 2005 From: wildwood_players at yahoo.com (Richard Wood) Date: Thu, 8 Sep 2005 15:23:07 -0700 (PDT) Subject: SPUG: multiline matching question Message-ID: <20050908222307.14561.qmail@web30611.mail.mud.yahoo.com> SPUGsters, I am trying to efficiently grab sets of data from multiple lines of a file and print the collected data out on one line per set. I've never tried multi line matching before ( I usually just write a program that tests which kind of line I am processing). But I believe that this can be done in one match statement. So I would like some help. Currently, in the test file that I am including, I am getting the data from the second set of lines which seems pretty unusual to me. I'm looking forward to understanding what I am doing wrong. The file consists of 150 character records. Every third record starts a new set of data. I need bits and pieces from records 1 & 2 of each set. here is the command line that I am using: $ perl -wne 'undef $/;/(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80})/gs and print "$1 $2 $3 $4 $5 $6\n";' sample.txt based on this sort of working, I also tried this: $ perl -wne 'undef $/;/(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80}).{222}/gs and print "$1 $2 $3 $4 $5 $6\n";' sample.txt but it didn't work any better/worse. I am attaching the sample.txt file, which has 4 sets of records. When I run the command, as I say, I get the second of the 4 sets of data: AP01 AZ 468 71-70-0 0000 100 ENGINE DRAINS CC 135 Thanks in advance for your thoughts, Rich Wood Richard O. Wood Wildwood IT Consultants, Inc. wildwood_players at yahoo.com 425.281.1914 mobile 206.544.9885 desk ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: sample.txt Url: http://mail.pm.org/pipermail/spug-list/attachments/20050908/7738f32b/sample.txt From jerry.gay at gmail.com Thu Sep 8 16:50:44 2005 From: jerry.gay at gmail.com (jerry gay) Date: Thu, 8 Sep 2005 16:50:44 -0700 Subject: SPUG: multiline matching question In-Reply-To: <20050908222307.14561.qmail@web30611.mail.mud.yahoo.com> References: <20050908222307.14561.qmail@web30611.mail.mud.yahoo.com> Message-ID: <1d9a3f4005090816502d77fb98@mail.gmail.com> On 9/8/05, Richard Wood wrote: > SPUGsters, > > I am trying to efficiently grab sets of data from > multiple lines of a file and print the collected data > out on one line per set. I've never tried multi line > matching before ( I usually just write a program that > tests which kind of line I am processing). But I > believe that this can be done in one match statement. > So I would like some help. Currently, in the test > file that I am including, I am getting the data from > the second set of lines which seems pretty unusual to > me. I'm looking forward to understanding what I am > doing wrong. > don't worry, it *can* be done :) > The file consists of 150 character records. Every > third record starts a new set of data. I need bits > and pieces from records 1 & 2 of each set. > by 'record' here, i assume you mean 'line in a file'. > I am attaching the sample.txt file, which has 4 sets > of records. When I run the command, as I say, I get > the second of the 4 sets of data: > from what i can tell, you do mean a 'record' is three lines long. from what you've attached... > AP01 AZ 468 71-70-0 0000 100 > ENGINE DRAINS > > AP01 AZ 468 71-70-0 0000 100 > ENGINE DRAINS CC 135 > > AP01 AZ 468 71-70-0 LIN 500, 100X > ENGINE DRAINS > > AP01 AZ 468 71-70-0 LIN 548+ 100XA > ENGINE DRAINS > it seems the third line is always blank. that, to me, means that you have two-line records, and the record separator is "\n\n" (which looks just like a blank line). if you consult 'perldoc perlrun', you'll find the '-0' option, which allows you to specify the input record seperator. there's a special variation of this flag, '-00' (note these are zeroes, not letter Os,) which sets perl to slurp in 'paragraph mode' which means it will create a new record every time it sees two or more newlines in a row. since you want to print the fields as space separated, you can set the output field seperator, '$,' $,= ' '; there's still a newline seperating lines in your record, though, the one preceding 'ENGINE DRAINS' in your example data. this can be replaced with whitespace using y/\n/ / assuming each record each has seven fields, and only the last field allows ' ' (space) as a valid field character, you can use a special form of split to ...split... the fields on whitespace. also, if you limit the split to seven fields, you'll have only that many, even if the last field has space characters in it. my @a= split ' ' => $_, 7; since you don't want to print the first field, you can print a slice of the field array you created: print @a[1..6]; putting it all together, and using '-n' and '-l', which i'll leave for you to look up if you desire, you get: perl -n00le "$,=' '; y/\n/ /; my @a= split ' ', $_, 7; print @a[1..6]" sample.txt hope that helps. ~jerry From krahnj at telus.net Thu Sep 8 19:18:51 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu, 08 Sep 2005 19:18:51 -0700 Subject: SPUG: multiline matching question In-Reply-To: <20050908222307.14561.qmail@web30611.mail.mud.yahoo.com> References: <20050908222307.14561.qmail@web30611.mail.mud.yahoo.com> Message-ID: <4320F10B.9020102@telus.net> Richard Wood wrote: > SPUGsters, > > I am trying to efficiently grab sets of data from > multiple lines of a file and print the collected data > out on one line per set. I've never tried multi line > matching before ( I usually just write a program that > tests which kind of line I am processing). But I > believe that this can be done in one match statement. > So I would like some help. Currently, in the test > file that I am including, I am getting the data from > the second set of lines which seems pretty unusual to > me. I'm looking forward to understanding what I am > doing wrong. > > The file consists of 150 character records. Every > third record starts a new set of data. I need bits > and pieces from records 1 & 2 of each set. > > here is the command line that I am using: > > $ perl -wne 'undef > $/;/(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80})/gs > and print "$1 $2 $3 $4 $5 $6\n";' sample.txt $ perl -MO=Deparse -wne 'undef $/;/(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80})/gs and print "$1 $2 $3 $4 $5 $6\n";' sample.txt BEGIN { $^W = 1; } LINE: while (defined($_ = )) { undef $/; print "$1 $2 $3 $4 $5 $6\n" if /(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80})/gs; } -e syntax OK You are undefining the input record separator after the program has read the first line so you need to either undefine it in a BEGIN block or with a command line switch: perl -ne'BEGIN{undef $/}...' Or: perl -0777ne'...' Your expression '//gs and print ""' will only execute once. You need to loop over each match like: perl -0777ne'print "$1 $2 $3 $4 $5 $6\n" while /^(AP01).{5}(..)..(\d\d\d).{38}(.{19}).{9}(.{5}).{64}(.{80})/gms' sample.txt Another way to do it: perl -F'\n\s+\n' -0777ane'/^AP01/ and print join " ", unpack( "a4x5a2x2a3x38a19x9a5x64a80", $_ ), "\n" for @F' sample.txt John -- use Perl; program fulfillment From kmeyer at blarg.net Fri Sep 9 03:41:23 2005 From: kmeyer at blarg.net (Ken Meyer) Date: Fri, 9 Sep 2005 03:41:23 -0700 Subject: SPUG: FW: GSLUG TOMORROW, September 10th -- Centeris Linux/Windows Interoperability OSS Message-ID: ############################################### The September 2005, regular meeting of the Greater Seattle Linux Users Group (GSLUG) will be held this Saturday, September 10th, starting at 10:00 AM on the North Seattle Community College campus. ******************************************************** We are confirmed to use room IB 3319. Parking is free on weekends. For directions, please visit the GSLUG monthly meetings web page at: http://www.gslug.org/meeting.html Room 3319 is in the Instruction Building (IB) on the west side of the building, facing College Way, on the third (top) floor about mid-way between the two ventilation towers. Parking is available directly to the west of the building and there are elevators in the towers. Please feel free to forward this announcement as appropriate. ******************************************************** NOTE: Regrets for the late notice. After experiencing two bail-outs by presenters, we were going to cancel when this very interesting offer arrived, completely out of the blue. The presentation topic will be: * 10:00 AM - Centeris' Linux/Windows Interoperability Application David Louden - Program Manager Chris Rude - Engineering Manager Michelle Arney - Marketing Manager Abstract: By providing simple and familiar administrator tools and improved Linux/Windows compatibility, many of the barriers to Linux adoption for both mid-market and enterprise companies can be removed. We will discuss the barriers to increasing Linux adoption, the solutions we are planning for the open source community, our own solution to extend those capabilities across configuration and management tasks, and finally present a product demo. Centeris is a local start-up company working with the open source community to improve platform interoperability. We focus primarily on Red Hat and SuSE right now, and are making contributions to the SAMBA open source efforts, so that others can leverage the code we have created. ------------ Out of the box, Linux and Windows servers do not work well together, and it is difficult to configure the two systems to co-exist happily in the same network. In order to have true platform choice in the data center or back office, enhanced interoperability of these operating systems must be provided. We will share some of the advancements we?ve made, both in our open source contributions to SAMBA and within our own product, currently in beta, which will make it easier for customers to configure and manage Linux servers. ------------ We would like to get the local Linux users' perspective on the steps we are taking and whether they see any value in the efforts we are making. We are truly interested in feedback from the group. What do they think of the idea overall? Is the product plan good or a hunk of crap? Is anyone interested in checking-out the software and providing feedback? Note from Your Organizer: As I understand it, Centeris perceives that a major impediment to adoption of Linux by the enterprise is that means to ease the transition incrementally from Windows are inadequate, and few CIO's will take the chance of doing it "cold turkey", particularly because this requires generating a whole new set of competencies in the administration personnel. Ergo, this product is intended to link Windows and Linux servers in a manner that allows administration of the Linux boxes via familiar Windows procedures, including use of the Windows Active Directory. The commercial product will add to the open source functions to assist sysadmins in setting-up and managing such open source applications as Apache. It is asserted that the portion of the Centeris offering that is being open-sourced will provide substantial stand-alone functionality associated with the process of linking the servers. The demo will apparently be performed using VMWare, which should provide interesting insights in itself. --------------- * 11:15 AM - The Future of GSLUG Periodically, volunteers who manage any community organization without any stated "terms of office" will "burn out", or will find that other obligations that have been going unaddressed are ganging-up on them, or will even want to free-up time to address other creative aspects of Linux promotion. This appears to be the case at present with a substantial portion of the present active GSLUG organizers (and strangely coincidentally, for some other similar organizations in the area). In fact, if we had stood-by our stated schedules for the intent to refocus our lives, this meeting would not be occurring at all. This year, GSLUG celebrated its 10th anniversary as the leading local force for promoting and understanding Linux in the Puget Sound area. Will it survive to age 11? Is support of the anti-Windows worth the effort? There is an immediate critical need to discuss the future of GSLUG in an environment in which people are not reluctant to share their ideas for fear that they will immediately be asked to assume the responsibility for implementing them, but conversely, in which they are willing to step-up and share part of some aspect of the load. Who will step-up to the plate as Brian, Heather, Dave and Ken have been doing for periods from one to three years already? Do the purpose and objectives of the organization need to be re-oriented to create enthusiasm for contributing to its support? Have recent presentations been too elementary to attract the experts among us? Do you loath the sight of the people running the organization? Is there a need for somewhat more formal organizational structure, to assure volunteers that they will not be grabbing a tiger by the tail (ill-defined and open-ended commitment)? We have leads on some excellent presentations for future meetings, but if you respond to the call by ducking under your table, better take a good look around there, because it could be your last opportunity in the foreseeable future. - Ken Meyer --------------------------------------------------------------------- The typical GSLUG meeting agenda is as follows: 10:00 AM First Presentation 11:00 AM Break 11:10 AM Key Announcements and (usually) Raffle Quiz 11:15 AM Second Presentation 12:15 PM Break 12:30 PM Raffle prizes giveaway, when available 12:35 PM GSLUG business, including discussion of potential future presentation topics Announcements by attendees Requests for assistance desired during the following Workshop session, including trouble-shooting and help with Linux installation (bring your system). 1:00 PM-ish Formal meeting is adjourned; Workshop and social networking opportunities begin, including: * Installation and trouble-shooting assistance For recommendations on preparations to maximize the probability of a successful outcome, it is recommended that you consult the "What to Bring" topic, way down the page at: http://www.gslug.org/meeting.html * Potential break-out discussions about interest-group activities * Informal PGP key signing * Talking, chatting, blathering, etc, etc. 4:00 PM End of meeting ----------------------------------------------------------------------- GSLUG meetings are held regularly on the second Saturday of the month at 10 AM, currently at North Seattle Community College and USUALLY in room 3319. Meeting announcements are posted to the gslug-announce mail list. To receive reminders for future GSLUG meetings and notice of other GSLUG activities, you are invited to join the list at: http://lists.gslug.org/mailman/listinfo/gslug-announce Directions, agenda, and presenters' bios will also be posted on the GSLUG website, on the home page and at: http://www.gslug.org/meeting.html You are also invited to join the gslug-general discussion list at: http://lists.gslug.org/mailman/listinfo/gslug-general And a new wiki site is at: http://wiki.gslug.org/ -- The GSLUG Crew ------------------------------- 30 ---------------------------- From MichaelRWolf at att.net Mon Sep 12 22:44:43 2005 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 12 Sep 2005 22:44:43 -0700 Subject: SPUG: FW: Perl Question Message-ID: I got this question from a recent student in one of the Perl classes I taught. Anyone ever heard of such a thing or have an idea other than a simple shell-like script that copies and fiddles with permissions? ===================================== How do you convert a perl script with an extension of .pl into a Windows Command Script with an extension of .CMD? I know how to convert a perl script into a Windows Batch Script with pl2bat but I can't seem to find a similar utility for .CMD files. There must be a way since a former vendor has done all of their Perl scripts in this manner. Do you have any ideas? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From atom.powers at gmail.com Tue Sep 13 08:07:51 2005 From: atom.powers at gmail.com (Atom Powers) Date: Tue, 13 Sep 2005 08:07:51 -0700 Subject: SPUG: FW: Perl Question In-Reply-To: <20050913054452.1687517769@x6.develooper.com> References: <20050913054452.1687517769@x6.develooper.com> Message-ID: Try this, after turning the perl scrit into a batch file do: 'rename script.bat script.cmd' A cmd script is a batch scritpt; the only difference I am aware of is that Windows NT decided to use "cmd" for it's batch extensions when the command interpreter changed from 'command.exe' to 'cmd.exe'. On 9/12/05, Michael R. Wolf wrote: > > I got this question from a recent student in one of the Perl classes I > taught. Anyone ever heard of such a thing or have an idea other than a > simple shell-like script that copies and fiddles with permissions? > > ===================================== > > How do you convert a perl script with an extension of .pl into a Windows > Command Script with an extension of .CMD? > > I know how to convert a perl script into a Windows Batch Script with > pl2bat > but I can't seem to find a similar utility for .CMD files. > > There must be a way since a former vendor has done all of their Perl > scripts > in this manner. > > Do you have any ideas? > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf at att.net > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > -- -- Perfection is just a word I use occasionally with mustard. --Atom Powers-- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050913/bbfa6d3b/attachment.html From KBuff at zetron.com Tue Sep 13 10:43:01 2005 From: KBuff at zetron.com (Kurt Buff) Date: Tue, 13 Sep 2005 10:43:01 -0700 Subject: SPUG: FW: Perl Question Message-ID: <054222519C2ED411A68E00508B603AC70A3D08EB@zetxch01.zetron.com> Atom Powers wrote: > Try this, after turning the perl scrit into a batch file do: > 'rename script.bat script.cmd' > > A cmd script is a batch scritpt; the only difference I am > aware of is that Windows NT decided to use "cmd" for it's > batch extensions when the command interpreter changed from > 'command.exe' to 'cmd.exe'. > > > > On 9/12/05, Michael R. Wolf wrote: > > I got this question from a recent student in one of the Perl classes I > > taught. Anyone ever heard of such a thing or have an idea other than a > > simple shell-like script that copies and fiddles with permissions? > > > > ===================================== > > > > How do you convert a perl script with an extension of .pl into a Windows > > Command Script with an extension of .CMD? > > > > I know how to convert a perl script into a Windows Batch Script with pl2bat > > but I can't seem to find a similar utility for .CMD files. > > > > There must be a way since a former vendor has done all of their Perl scripts > > in this manner. > > > > Do you have any ideas? > > > > -- > > Michael R. Wolf > > All mammals learn by playing! > > MichaelRWolf at att.net While Atom is correct about the procedure, there are subtle differences, or used to be, between cmd.exe and command.com. Also - I haven't checked this in a while, so it may have changed - the default for double-clicking on a .bat file would invoke command.com, and double-clicking on a .cmd file would invoke cmd.exe, and sometimes those differences would come out to play. This was especially frustrating when running a scheduled job that might do different things depending on the file extension of the script. For fun just now, from the console of my Windows 2003 Server, I did a Start/Run of 'command' (no extension), and it launched a shell called command.com, and it showed the following: Microsoft(R) Windows DOS (C)Copyright Microsoft Corp 1990-2001. Launching cmd.exe in the same fashion yields: Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. The command.com shell is not really DOS any more, of course, but it's probably safer to assume that there are still differences between it and cmd.exe. Michael, if your student is interested in pursuing this, have your him or her do two things: 1) search the hard drive for the help file describing the cmd.exe shell - it's probably ntcmds.chm, depending on the flavor of Windows. 2) Have him or her open a native Windows shell by typing cmd.exe from Start/Run, then type 'help cmd' at the prompt. Those should make for illuminating reading. Kurt From mwallend at spikus.com Mon Sep 19 15:31:50 2005 From: mwallend at spikus.com (Michael Wallendahl) Date: Mon, 19 Sep 2005 15:31:50 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? Message-ID: <432F3C56.1010906@spikus.com> Hello, I'm wondering if anyone has a suggestions on a good algorithm to 'pretty-print' a nested hash in tabular form? Take the following hash: ---BEGIN PERL--- #!perl use strict; use warnings; my %h; $h{one}->{First} = 'Bob'; $h{one}->{Last} = 'Marley'; $h{two}->{First} = 'Sue Ellen'; $h{two}->{Last} = 'Smith'; ---END PERL--- Is there an easy way to print out the contents of %h in a tabular form so that the width of each column is set to the largest element? Like this: First Last --------- ------ Bob Marley Sue Ellen Smith In the past I've resorted to traversing the nested hash looking at each element's value, saving the largest width away in a variable, and then using printf statements. This quickly gets messy as the number of columns increase. For example, continuing on with perl: ---BEGIN PERL--- my $max_first = 5; # Length of column name 'First' as the min. my $max_last = 4; # Length of column name 'Last' as the min. foreach my $user (keys %h) { my $len_f = length($h{$user}->{First}); my $len_l = length($h{$user}->{Last }); if ($len_f > $max_first) { $max_first = $len_f; } if ($len_l > $max_last ) { $max_last = $len_l; } } print "Max length of First column: $max_first\n"; print "Max length of Last column : $max_last\n"; # print heading. printf "%-*s %-*s\n", $max_first, 'First', $max_last , 'Last'; # print underlines for heading. printf "%-*s %-*s\n", $max_first, '-' x $max_first, $max_last , '-' x $max_last; # print out data. foreach my $user (keys %h) { printf "%-*s %-*s\n", $max_first, $h{$user}->{First}, $max_last , $h{$user}->{Last }, } ---END PERL--- Is there an easier way to do this that I'm just overlooking? All those printf's just look messy to me. Thanks, -Mike From ryan at the-summit.net Mon Sep 19 15:44:33 2005 From: ryan at the-summit.net (Ryan Allen) Date: Mon, 19 Sep 2005 15:44:33 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? In-Reply-To: <432F3C56.1010906@spikus.com> References: <432F3C56.1010906@spikus.com> Message-ID: <20050919224433.GA26406@the-summit.net> Try using Data::Dumper. I've saved many hours debugging with this: #!perl use strict; use warnings; use Data::Dumper; my %h; $h{one}->{First} = 'Bob'; $h{one}->{Last} = 'Marley'; $h{two}->{First} = 'Sue Ellen'; $h{two}->{Last} = 'Smith'; print Dumper $h; -- Ryan * Michael Wallendahl wrote on [09-19-05y 15:40]: > Hello, > > I'm wondering if anyone has a suggestions on a good algorithm to > 'pretty-print' a nested hash in tabular form? > > Take the following hash: > > ---BEGIN PERL--- > > #!perl > > use strict; > use warnings; > > my %h; > > $h{one}->{First} = 'Bob'; > $h{one}->{Last} = 'Marley'; > $h{two}->{First} = 'Sue Ellen'; > $h{two}->{Last} = 'Smith'; > > ---END PERL--- > > Is there an easy way to print out the contents of %h in a tabular form > so that the width of each column is set to the largest element? Like > this: > > First Last > --------- ------ > Bob Marley > Sue Ellen Smith > > In the past I've resorted to traversing the nested hash looking at each > element's value, saving the largest width away in a variable, and then > using printf statements. This quickly gets messy as the number of columns > increase. > > For example, continuing on with perl: > > ---BEGIN PERL--- > > my $max_first = 5; # Length of column name 'First' as the min. > my $max_last = 4; # Length of column name 'Last' as the min. > foreach my $user (keys %h) { > my $len_f = length($h{$user}->{First}); > my $len_l = length($h{$user}->{Last }); > if ($len_f > $max_first) { $max_first = $len_f; } > if ($len_l > $max_last ) { $max_last = $len_l; } > } > > print "Max length of First column: $max_first\n"; > print "Max length of Last column : $max_last\n"; > > # print heading. > printf "%-*s %-*s\n", > $max_first, 'First', > $max_last , 'Last'; > > # print underlines for heading. > printf "%-*s %-*s\n", > $max_first, '-' x $max_first, > $max_last , '-' x $max_last; > > # print out data. > foreach my $user (keys %h) { > printf "%-*s %-*s\n", > $max_first, $h{$user}->{First}, > $max_last , $h{$user}->{Last }, > > } > > ---END PERL--- > > Is there an easier way to do this that I'm just overlooking? > All those printf's just look messy to me. > > Thanks, > -Mike > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > -- +-----------------------------+ | ryan at the-summit.net | | http://www.the-summit.net | +-----------------------------+ From ryan at the-summit.net Mon Sep 19 15:48:03 2005 From: ryan at the-summit.net (Ryan Allen) Date: Mon, 19 Sep 2005 15:48:03 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? In-Reply-To: <432F3C56.1010906@spikus.com> References: <432F3C56.1010906@spikus.com> Message-ID: <20050919224803.GA26500@the-summit.net> Sorry, that does not exactly answer your question. Should of read the whole E-mail first. - Ryan (who just learned about Data::Dumper and wants to tell the world about it) * Michael Wallendahl wrote on [09-19-05y 15:40]: > Hello, > > I'm wondering if anyone has a suggestions on a good algorithm to > 'pretty-print' a nested hash in tabular form? > > Take the following hash: > > ---BEGIN PERL--- > > #!perl > > use strict; > use warnings; > > my %h; > > $h{one}->{First} = 'Bob'; > $h{one}->{Last} = 'Marley'; > $h{two}->{First} = 'Sue Ellen'; > $h{two}->{Last} = 'Smith'; > > ---END PERL--- > > Is there an easy way to print out the contents of %h in a tabular form > so that the width of each column is set to the largest element? Like > this: > > First Last > --------- ------ > Bob Marley > Sue Ellen Smith > > In the past I've resorted to traversing the nested hash looking at each > element's value, saving the largest width away in a variable, and then > using printf statements. This quickly gets messy as the number of columns > increase. > > For example, continuing on with perl: > > ---BEGIN PERL--- > > my $max_first = 5; # Length of column name 'First' as the min. > my $max_last = 4; # Length of column name 'Last' as the min. > foreach my $user (keys %h) { > my $len_f = length($h{$user}->{First}); > my $len_l = length($h{$user}->{Last }); > if ($len_f > $max_first) { $max_first = $len_f; } > if ($len_l > $max_last ) { $max_last = $len_l; } > } > > print "Max length of First column: $max_first\n"; > print "Max length of Last column : $max_last\n"; > > # print heading. > printf "%-*s %-*s\n", > $max_first, 'First', > $max_last , 'Last'; > > # print underlines for heading. > printf "%-*s %-*s\n", > $max_first, '-' x $max_first, > $max_last , '-' x $max_last; > > # print out data. > foreach my $user (keys %h) { > printf "%-*s %-*s\n", > $max_first, $h{$user}->{First}, > $max_last , $h{$user}->{Last }, > > } > > ---END PERL--- > > Is there an easier way to do this that I'm just overlooking? > All those printf's just look messy to me. > > Thanks, > -Mike > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > -- +-----------------------------+ | ryan at the-summit.net | | http://www.the-summit.net | +-----------------------------+ From jerry.gay at gmail.com Mon Sep 19 16:59:13 2005 From: jerry.gay at gmail.com (jerry gay) Date: Mon, 19 Sep 2005 16:59:13 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? In-Reply-To: <432F3C56.1010906@spikus.com> References: <432F3C56.1010906@spikus.com> Message-ID: <1d9a3f4005091916596d8f46f8@mail.gmail.com> On 9/19/05, Michael Wallendahl wrote: > Hello, > > I'm wondering if anyone has a suggestions on a good algorithm to > 'pretty-print' a nested hash in tabular form? > > Take the following hash: [snip perl example] > Is there an easy way to print out the contents of %h in a tabular form > so that the width of each column is set to the largest element? Like > this: > > First Last > --------- ------ > Bob Marley > Sue Ellen Smith > i believe the answer you're looking for can be found in Damian Conway's Perl6::Form module. i'm sure you'll find the documentation enlightening, especially the section entitled "Distributive field widths," which appears just after halfway from the top of the document. http://search.cpan.org/~dconway/Perl6-Form-0.04/Form.pm there's no reason to wait for Perl 6 when it's here already :) ~jerry From haircut at gmail.com Mon Sep 19 17:13:40 2005 From: haircut at gmail.com (Adam Monsen) Date: Mon, 19 Sep 2005 17:13:40 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? In-Reply-To: <432F3C56.1010906@spikus.com> References: <432F3C56.1010906@spikus.com> Message-ID: <9ebd65110509191713251fda57@mail.gmail.com> On 9/19/05, Michael Wallendahl wrote: > Hello, > > I'm wondering if anyone has a suggestions on a good algorithm to > 'pretty-print' a nested hash in tabular form? [...] You could pick a max length for each column, then use substr to truncate anything longer than your desired max length. Other than that, the algorithm you've implemented looks fine. Any fancy solutions (like using a custom tied hash that sorts keys or keeps track of the longest value, or something like that) would have to do the same work as what you wrote, but would probably be less straightforward to maintain. But, of course, YMMV, TMTOWTDI, etc. HTH, -AMM -- Adam Monsen http://adammonsen.com/ From jlanza at gmail.com Mon Sep 19 17:41:43 2005 From: jlanza at gmail.com (Joshua Lanza) Date: Mon, 19 Sep 2005 17:41:43 -0700 Subject: SPUG: Pretty-Printing Nested Hashes? In-Reply-To: <9ebd65110509191713251fda57@mail.gmail.com> References: <432F3C56.1010906@spikus.com> <9ebd65110509191713251fda57@mail.gmail.com> Message-ID: <2ed41ac70509191741150961ee@mail.gmail.com> Have you tried to do this with formats? I think they're easier to maintain than a bunch of printf statements. There's a how-to at http://www.cs.mcgill.ca/~abatko/computers/programming/perl/howto/format/ On 9/19/05, Adam Monsen wrote: > On 9/19/05, Michael Wallendahl wrote: > > Hello, > > > > I'm wondering if anyone has a suggestions on a good algorithm to > > 'pretty-print' a nested hash in tabular form? > [...] > > You could pick a max length for each column, then use substr to > truncate anything longer than your desired max length. Other than > that, the algorithm you've implemented looks fine. Any fancy solutions > (like using a custom tied hash that sorts keys or keeps track of the > longest value, or something like that) would have to do the same work > as what you wrote, but would probably be less straightforward to > maintain. But, of course, YMMV, TMTOWTDI, etc. > > HTH, > -AMM > > -- > Adam Monsen > http://adammonsen.com/ > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > From MichaelRWolf at att.net Fri Sep 23 13:15:18 2005 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Fri, 23 Sep 2005 13:15:18 -0700 Subject: SPUG: The State of the Onion 9 Message-ID: It's finally been posted. perl.com: The State of the Onion 9 http://www.perl.com/pub/a/2005/09/22/onion.html -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From james at banshee.com Thu Sep 29 12:16:10 2005 From: james at banshee.com (James Moore) Date: Thu, 29 Sep 2005 12:16:10 -0700 Subject: SPUG: XML::Simple not playing well with Apache/mod_perl? Message-ID: <200509291901.j8TJ1jb6009761@server2.banshee.com> I've got a problem with Apache 1.33 and XML::Simple, or at least I think I do. Apache is dying with these sorts of errors: Attempt to free unreferenced scalar: SV 0xa2a4394, Perl interpreter: 0x900ad48. A thread exited while 2 threads were running. (note that I'm not trying to use threads in my mod_perl code, but might be doing so in CPAN libraries.) When I remove the call to XMLin (from XML::Simple), these errors go away. When I put the call back in, the errors come back, 100% of the time. (Easy to reproduce.) Anyone else run into something like this? It doesn't seem likely that XML::Simple would cause mod_perl to die like this, but the gun appears to be warm to the touch if not exactly smoking. - James Moore From charles.e.derykus at boeing.com Thu Sep 29 14:15:04 2005 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu, 29 Sep 2005 14:15:04 -0700 Subject: SPUG: XML::Simple not playing well with Apache/mod_perl? Message-ID: > I 've got a problem with Apache 1.33 and XML::Simple, or at least I think I do. > Apache is dying with these sorts of errors: > Attempt to free unreferenced scalar: SV 0xa2a4394, Perl interpreter: > A thread exited while 2 threads were running. >(note that I'm not trying to use threads in my mod_perl code, but might be doing so in CPAN libraries.) > When I remove the call to XMLin (from XML::Simple), these errors go away. > When I put the call back in, the errors come back, 100% of the time. (Easy to reproduce.) > Anyone else run into something like this? It doesn't seem likely that XML::Simple would cause mod_perl to die like > this, but the gun appears to be warm to the touch if not exactly smoking. I haven't seen this but you might want to poke around one of the search engines, etc. Here's a general pointer: http://answers.google.com/answers/threadview?id=2263 -- Charles DeRykus From lmzaldivar at gmail.com Fri Sep 30 13:41:55 2005 From: lmzaldivar at gmail.com (Luis Medrano Zaldivar) Date: Fri, 30 Sep 2005 13:41:55 -0700 Subject: SPUG: Help!!!! Message-ID: <433da2d3.5ea8c0a6.289f.ffffb770@mx.gmail.com> Gang, I'm modifying a script were has this variable @{$responce} and I need to pull all the data from there but I don't recall how to do it. I will appreciate if you can help me with this. Thanks, Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050930/4c4925da/attachment.html From mike206 at gmail.com Fri Sep 30 13:47:00 2005 From: mike206 at gmail.com (mike) Date: Fri, 30 Sep 2005 13:47:00 -0700 Subject: SPUG: Help!!!! In-Reply-To: <433da2d3.5ea8c0a6.289f.ffffb770@mx.gmail.com> References: <433da2d3.5ea8c0a6.289f.ffffb770@mx.gmail.com> Message-ID: that's the same as @$responce $responce is an array reference and is treated like an array (dereferenced) when you put @ in front of it. so you can foreach(@$responce) if you want to. you can access each element by doing $responce->[some_integer] instead of $responce[some_integer] i prefer using references 99% of the time On 9/30/05, Luis Medrano Zaldivar wrote: > > Gang, > > I'm modifying a script were has this variable @{$responce} and I need to > pull all the data from there but I don't recall how to do it. I will > appreciate if you can help me with this. > > Thanks, > > Luis > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050930/f438191b/attachment.html From rick.croote at philips.com Fri Sep 30 13:47:24 2005 From: rick.croote at philips.com (Rick Croote) Date: Fri, 30 Sep 2005 13:47:24 -0700 Subject: SPUG: Help!!!! In-Reply-To: <433da2d3.5ea8c0a6.289f.ffffb770@mx.gmail.com> Message-ID: Can you be more specific by what you mean "pull all the data"? What is it you are trying to do? --- Rick Croote Software Engineer Environment and Tools Team Philips Medical Systems Bothell, WA Rick.Croote at Philips.com Phone: 425-487-7834 "Luis Medrano Zaldivar" Sent by: spug-list-bounces at pm.org 2005-09-30 01:41 PM To cc Subject SPUG: Help!!!! Classification Gang, I?m modifying a script were has this variable @{$responce} and I need to pull all the data from there but I don?t recall how to do it. I will appreciate if you can help me with this. Thanks, Luis _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050930/f12d0498/attachment.html From lmzaldivar at gmail.com Fri Sep 30 14:04:32 2005 From: lmzaldivar at gmail.com (Luis Medrano Zaldivar) Date: Fri, 30 Sep 2005 14:04:32 -0700 Subject: SPUG: Help!!!! In-Reply-To: Message-ID: <433da823.2a50eda5.692f.ffffbf27@mx.gmail.com> Here is what I got: my $responce = $rpc->call ("blogger.getUsersBlogs",$key,$username,$password); I need to extract what is on $responce meaning values and keys related to those values. I hope this can be more clear and any of you can point me on the right direction. Thanks, Luis _____ From: Rick Croote [mailto:rick.croote at philips.com] Sent: Friday, September 30, 2005 1:47 PM To: Luis Medrano Zaldivar; spug-list at pm.org Subject: Re: SPUG: Help!!!! Can you be more specific by what you mean "pull all the data"? What is it you are trying to do? --- Rick Croote Software Engineer Environment and Tools Team Philips Medical Systems Bothell, WA Rick.Croote at Philips.com Phone: 425-487-7834 "Luis Medrano Zaldivar" Sent by: spug-list-bounces at pm.org 2005-09-30 01:41 PM To cc Subject SPUG: Help!!!! Classification Gang, I'm modifying a script were has this variable @{$responce} and I need to pull all the data from there but I don't recall how to do it. I will appreciate if you can help me with this. Thanks, Luis _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050930/9031c660/attachment-0001.html From jerry.gay at gmail.com Fri Sep 30 14:10:14 2005 From: jerry.gay at gmail.com (jerry gay) Date: Fri, 30 Sep 2005 14:10:14 -0700 Subject: SPUG: Help!!!! In-Reply-To: <433da823.2a50eda5.692f.ffffbf27@mx.gmail.com> References: <433da823.2a50eda5.692f.ffffbf27@mx.gmail.com> Message-ID: <1d9a3f400509301410l1fdfbb5er31ce5203d40d8387@mail.gmail.com> my $responce = $rpc->call ("blogger.getUsersBlogs",$key,$username,$password); use Data::Dumper; $Data::Dumper::Indent= 1; print Dumper $responce; this will show you the data inside the '$responce' reference. access the info using methods mentioned above. for more, see 'perldoc perlref' ~jerry From benb at speakeasy.net Fri Sep 30 14:20:56 2005 From: benb at speakeasy.net (BenRifkah Burnett) Date: Fri, 30 Sep 2005 14:20:56 -0700 Subject: SPUG: Help!!!! In-Reply-To: <433da823.2a50eda5.692f.ffffbf27@mx.gmail.com> References: <433da823.2a50eda5.692f.ffffbf27@mx.gmail.com> Message-ID: <433DAC38.3080208@speakeasy.net> Louis. From the information you give below it appears as though $responce is a hash reference. Luis Medrano Zaldivar wrote: > > > > Here is what I got: > > > > my $responce = $rpc->call > ("blogger.getUsersBlogs",$key,$username,$password); > > > > I need to extract what is on $responce meaning values and keys related > to those values. > 'Keys' and 'Values' sounds like hash lingo. However, from the snippet below it appears as though $responce is an array reference. > > > I'm modifying a script were has this variable @{$responce} and I need > to pull all the data from there but I don't recall how to do it. I > will appreciate if you can help me with this. > > The syntax @{$foo} means that $foo is a reference and you want to treat it like an array. Do you know the what kind of variable $responce is? To find out try calling the ref() function with $responce as the argument: my $ref = ref($responce); print STDERR "response is a :'$ref'"; This will tell you what kind of variable you are working with. See the documentation for the ref function by running 'perldoc -f ref' Once you know what kind of variable it is you can get to the information it holds in different ways. See perldoc perlref for details on how to get information out of hash and array references depending on how you want to use it. Also, $responce may not be a simple data structure. Since it's being returned by the method 'call' on the $rpc object $responce may be an object itself. Where did the $rpc object come from? Do you know what "Class" it belongs to? Documentation for this Class should tell you what to expect when you use the "call" method and how to get the information you need out of it. Good Luck, -- Ben Burnett -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050930/b3067f01/attachment.html From rlucas at tercent.com Fri Sep 30 14:19:42 2005 From: rlucas at tercent.com (Randall Lucas) Date: Fri, 30 Sep 2005 14:19:42 -0700 Subject: SPUG: Data::Dumper, was re: Help In-Reply-To: References: Message-ID: <20050930211942.GQ12038@tercent.com> > I need to extract what is on $responce meaning values and keys related to > those values. > > I hope this can be more clear and any of you can point me on the right > direction. Luis, in general you will find Data::Dumper to be quite helpful: #!/usr/bin/perl -w use strict; use Data::Dumper; print Dumper \$response; # note that you should generally put a \ in front of the var to # make it a reference, although in this case it already likely is. __END__ This graphically prints out the content of the variable in an eval-able (perl code) form, giving you the full breakdown of keys, values, etc. Best, Randall -- Randall Lucas Tercent, Inc. DF93EAD1 From lmzaldivar at gmail.com Fri Sep 30 14:35:11 2005 From: lmzaldivar at gmail.com (Luis Medrano Zaldivar) Date: Fri, 30 Sep 2005 14:35:11 -0700 Subject: SPUG: Help!!!! In-Reply-To: <1d9a3f400509301410l1fdfbb5er31ce5203d40d8387@mail.gmail.com> Message-ID: <433daf4f.17d99565.07ca.3e71@mx.gmail.com> I see the content of the variable $responce but my question is how can I pipe each value to a particular variable or array? Thanks, Luis -----Original Message----- From: jerry gay [mailto:jerry.gay at gmail.com] Sent: Friday, September 30, 2005 2:10 PM To: Luis Medrano Zaldivar Cc: spug-list at pm.org Subject: Re: SPUG: Help!!!! my $responce = $rpc->call ("blogger.getUsersBlogs",$key,$username,$password); use Data::Dumper; $Data::Dumper::Indent= 1; print Dumper $responce; this will show you the data inside the '$responce' reference. access the info using methods mentioned above. for more, see 'perldoc perlref' ~jerry From jerry.gay at gmail.com Fri Sep 30 14:47:48 2005 From: jerry.gay at gmail.com (jerry gay) Date: Fri, 30 Sep 2005 14:47:48 -0700 Subject: SPUG: Help!!!! In-Reply-To: <433daf4f.17d99565.07ca.3e71@mx.gmail.com> References: <1d9a3f400509301410l1fdfbb5er31ce5203d40d8387@mail.gmail.com> <433daf4f.17d99565.07ca.3e71@mx.gmail.com> Message-ID: <1d9a3f400509301447s30379dbeq9e33041eb91b4e2c@mail.gmail.com> On 9/30/05, Luis Medrano Zaldivar wrote: > I see the content of the variable $responce but my question is how can I > pipe each value to a particular variable or array? > rather than writing a lengthy tutorial on references, i'll point you to the docs. just type the following (in single quotes) from the shell: 'perldoc perlreftut' - Mark's very short tutorial about references 'perldoc perldsc' - Perl Data Structures Cookbook 'perldoc perlref' - Perl references and nested data structures it won't take long to read through these docs (especially the first one) and find what you need to move on. ~jerry