Re: HoA problem

2007-07-06 Thread Jeff Pang
2007/7/6, Owen [EMAIL PROTECTED]: #!/usr/bin/perl -w use strict; my %h = (); my @one = ('abcd', 2567, 8908); my @two = ('efgh', , ); %h = ($one[0] = [EMAIL PROTECTED]); print $one[0] $h{$one[0]}-[1]\n; %h = ($two[0] =

Can't use string () as an Array ref

2007-07-06 Thread Brown, Rodrick
I'm getting the following when trying running the following code with use strict; without it, it works fine. #!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my (@data,@contents); @data = STDIN; push(@contents,map { [ split/:/,$_ ] if/^\w+/ } (sort @data) );

Re: Can't use string () as an Array ref

2007-07-06 Thread Rob Dixon
Brown, Rodrick wrote: I'm getting the following when trying running the following code with use strict; without it, it works fine. #!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my (@data,@contents); @data = STDIN; push(@contents,map { [ split/:/,$_ ] if/^\w+/ } (sort

Re: HoA problem

2007-07-06 Thread Rob Dixon
Jeff Pang wrote: 2007/7/6, Owen [EMAIL PROTECTED]: #!/usr/bin/perl -w use strict; my %h = (); my @one = ('abcd', 2567, 8908); my @two = ('efgh', , ); %h = ($one[0] = [EMAIL PROTECTED]); print $one[0] $h{$one[0]}-[1]\n; %h

Re: a question write to file!

2007-07-06 Thread herostar1981
Thanks a lot... It's my fault, a big mistake Sorry, my $sta[0] is empty Because of the variables passed by html link. but when print to screen, I pass the right parameters. so awful Thanks again. Sorry. Best Regards, xu On 7 5 , 6 43 , [EMAIL PROTECTED] (Tom Phoenix)

Re: GetOptions with dynamic set of options

2007-07-06 Thread Tom Phoenix
On 7/5/07, Ray [EMAIL PROTECTED] wrote: I want to try to construct the arguments for GetOptions, but in a dynamic way. So, instead of hard-coding my switches, like this: GetOptions ( showlog = \$MyArgs{showlog}, 'strategy=s' = \$MyArgs{strategy} ) like is shown in the

Re: Processing Arguments

2007-07-06 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: I wrote a simple perl script and execute it as follows: ./sr /tmp/* #!/usr/bin/perl print $ARGV[0]; Well, what is returned is the first filename in the directory, instead of the actual argument itself. What can I do to get the literal argument? That is a

Re: Proper way to halt a script

2007-07-06 Thread kapil.V
Chas Owens wrote: On 7/5/07, Joseph L. Casale [EMAIL PROTECTED] wrote: I am reading perldoc.perl.org and am not understanding exit and die clearly. If I have a conditional in a sub that I want to validate with, what is the correct way to do the following: 1. End the sub and return

trouble reading subdirectories and files in a directory

2007-07-06 Thread Chris Ryan
Running Perl on WinXP I would like to read the subdirectories and their respective files, that I have on my F: drive. They are arranged hierarchically, with a directory for each year, each of which contains a directory for each month, each of which contains files named for days. Like this: F:

Re: Proper way to halt a script

2007-07-06 Thread [EMAIL PROTECTED]
On Jul 6, 2:11 am, [EMAIL PROTECTED] (Joseph L. Casale) wrote: I am reading perldoc.perl.org and am not understanding exit and die clearly. If I have a conditional in a sub that I want to validate with, what is the correct way to do the following: 1. End the sub and return back to

Re: Another snippet explanation, please

2007-07-06 Thread John W. Krahn
Monty wrote: I've come across the following bit of code: print PIPE This is line number $_\n and $count++; This will only increment $count if print returned a true value. How does this differ from: print PIPE This is line number $_\n; $count++; This will always increment $count. What

Re: trouble reading subdirectories and files in a directory

2007-07-06 Thread Chris Ryan
Thanks. I was vaguely aware of modules that would do this. Doing it by hand at first is a good learning exercise for me. I can indeed check to see if the thing I'm looking at is a directory. But why does it do this? Can you help me understand why when I think I am in one directory, my script

Re: su and password in a Perl script

2007-07-06 Thread [EMAIL PROTECTED]
On Jul 5, 8:48 pm, [EMAIL PROTECTED] (Lakshmi Sailaja) wrote: Hi, I will have to login as a super user and run some commands. I want to automate the following through Perl: su - user and provide password check if the login is successful or not. Can you please let me know? I Expect you

Another snippet explanation, please

2007-07-06 Thread Monty
I've come across the following bit of code: print PIPE This is line number $_\n and $count++; How does this differ from: print PIPE This is line number $_\n; $count++; Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Dynamic page dsiplays in Mozialla/Firefox but not in IE

2007-07-06 Thread Tom Phoenix
On 7/6/07, Zielfelder, Robert [EMAIL PROTECTED] wrote: When I use Firefox to display/run the script everything works as it should. When I use IE I get a blank page. At least you didn't crash IE! print _END_OF_TEXT_ { oodles of HTML omitted } @page { still more oodles of HTML

Perl equivalent of Include

2007-07-06 Thread Ray
Hi, I would like to create module of common sub routines and corresponding global variables. I'm trying to use use and/or require but it looks like I have to do extra coding to make variables defined in my module file to be accessible to the .pl files that are using the module file. Can someone

Re: Perl equivalent of Include

2007-07-06 Thread Tom Phoenix
On 7/6/07, Ray [EMAIL PROTECTED] wrote: I would like to create module of common sub routines and corresponding global variables. That's how most modules start; you're on the right track. I'm trying to use use and/or require but it looks like I have to do extra coding to make variables