Re: Looping through an anonymous array of arrays

2008-06-06 Thread Gunnar Hjalmarsson
Rodrick Brown wrote: my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop? One way: my $level = 0; breakdown( $arrayRef ); sub breakdown { my $ref = shift;

Re: Looping through an anonymous array of arrays

2008-06-06 Thread Chas. Owens
On Fri, Jun 6, 2008 at 9:31 PM, Rodrick Brown <[EMAIL PROTECTED]> wrote: > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? > You can treat an array reference like an array by

Re: Looping through an anonymous array of arrays

2008-06-06 Thread Jeff Peng
On Sat, Jun 7, 2008 at 9:31 AM, Rodrick Brown <[EMAIL PROTECTED]> wrote: > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? > Try this code: use strict; my $arrayRef = [ 1,

Looping through an anonymous array of arrays

2008-06-06 Thread Rodrick Brown
my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop?

Re: pie multiline replace

2008-06-06 Thread Richard Lee
Gunnar Hjalmarsson wrote: close $out; I was just going over this... but shouldn't it be print $out "# Add this line to the top\n"; # ??? or did I miss something? I think you are right. I'd suggest that you send a note to Brian d'Foy ([EMAIL PROTECTED]), who is maintaining the FAQ.

Re: pie multiline replace

2008-06-06 Thread Gunnar Hjalmarsson
Richard Lee wrote: Gunnar Hjalmarsson wrote: perldoc -q "insert a line" Within that basic form, add the parts that you need to insert, change, or delete lines. To prepend lines to the beginning, print those lines before you enter the loop that prints the existing lines. open my $

Re: TCP apllications

2008-06-06 Thread asmith9983
Hi Arun You didn't say what you really wanted to achieve. Do yo want to dabble and learn from that experience what using network modules is all about ? -- Andrew Edinburgh,Scotland On Fri, 6 Jun 2008, Arun wrote: Hi, This is Arun here, i am new to Perl so i was just thinking of programming

Re: Reg. Directory listing program

2008-06-06 Thread John W. Krahn
Gunwant Singh wrote: Hi, Hello, Let me thank you for your help. I think you guys are doing a great work, its really appreciative. Thanks to David and John. Now that I changed my *"perl"* code to the following, its actually working *use strict; use warnings; use File::stat; opendir (DH,

Re: any ruby programmers who are perl users?

2008-06-06 Thread yitzle
On Fri, Jun 6, 2008 at 11:32 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > zentara wrote: > > I was just listening to podcasting and I heard Chad Fowler("my job went to > india: 52 ways to save your job) talking about programming language > in general. > One of the quotes he says that I felt like it

Re: Can not get reliable output [WAS Reg. Directory listing program]

2008-06-06 Thread John W. Krahn
Michelle Konzack wrote: Hello, Hello, I have a similar problem but with "mode" which output weird permissions: [ '~/bin/.perl_test_001' ]-- #!/usr/bin/perl use strict; use warnings; use File::stat; opendir(DH, "/home/michelle.konzack/bin") || die

Reg. Directory listing program

2008-06-06 Thread Gunwant Singh
Hi, Let me thank you for your help. I think you guys are doing a great work, its really appreciative. Thanks to David and John. Now that I changed my *"perl"* code to the following, its actually working *use strict; use warnings; use File::stat; opendir (DH, "subcode") or die "$!"; chdir("C:

Re: any ruby programmers who are perl users?

2008-06-06 Thread Rob Dixon
yitzle wrote: > > 1) If you are interested in learning to program for the sake of > programming (vs getting XYZ done), Perl probably isn't the best first > choice. (Not that its the last choice or anything, but not first.) I'd > personally advocate C/C++ or maybe Java. Maybe make Perl a third > cho

Re: any ruby programmers who are perl users?

2008-06-06 Thread Richard Lee
zentara wrote: On Thu, 05 Jun 2008 21:16:42 -0400, [EMAIL PROTECTED] (Richard Lee) wrote: Most likely just out of curiosity factor, I picked up a book "Learning to program " the facets of ruby series.. See what some experienced Perl programmers say about Ruby http://perlmonks.org?node

Re: TCP apllications

2008-06-06 Thread Jeff Peng
On Fri, Jun 6, 2008 at 7:29 PM, Arun <[EMAIL PROTECTED]> wrote: > Hi, > This is Arun here, i am new to Perl so i > was just thinking of programming the TCP apllications or working. So > how do i do that, just needed guidance from you. > Licoln Stein's book "Network Programming with Perl" is great

Re: TCP apllications

2008-06-06 Thread Rob Dixon
Arun wrote: > Hi, > This is Arun here, i am new to Perl so i > was just thinking of programming the TCP apllications or working. So > how do i do that, just needed guidance from you. A lot depends on how you want to use TCP, but take a look at perldoc -f socket and perldoc Socket HTH, Ro

TCP apllications

2008-06-06 Thread Arun
Hi, This is Arun here, i am new to Perl so i was just thinking of programming the TCP apllications or working. So how do i do that, just needed guidance from you. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Testing for a condition immediately after require

2008-06-06 Thread Travis Thornhill
I want to be able to tag a module with one or more tags that can be tested for after requiring it.   require 'module';   Any ideas on the best way to accomplish this?   Thanks in advance  

Re: any ruby programmers who are perl users?

2008-06-06 Thread Octavian Rasnita
From: "Dr.Ruud" <[EMAIL PROTECTED]>> Octavian: >> Yitzle: > >>> 1) If you are interested in learning to program for the sake of >>> programming (vs getting XYZ done), Perl probably isn't the best first >>> choice. (Not that its the last choice or anything, but not first.) >>> I'd personally advoca