RE: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Charles K. Clarkson
Ed wrote: : my @lineArray; : while() : { : # if the line is a net localgroup line add it to the array : if( $_ =~ $s_criteria ) You probably should be testing against a regular expression. if ( $_ =~ /$s_criteria/ ) Or just: if ( /$s_criteria/ ) :

RE: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Thomas Bätzler
Ed <[EMAIL PROTECTED]> asked: [...] > I'm reading from a file and constructing an array of arrays. > Here's an example of what's in the file: > net localgroup Field Aidan /ADD [...] > I want to sort the lines in the file by the 3rd column > (Field, Internal, CM, DocAdmin) If you're not particular

sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Ed
I'm still hobbled by my thinking in C problem so I'm looking for a way to do this. I'm reading from a file and constructing an array of arrays. Here's an example of what's in the file: net localgroup Field Aidan /ADD net localgroup Internal Aidan /ADD net localgroup CM Aidan /ADD net localgroup Do

Re: Lexical analysis of log file

2006-04-17 Thread Tom Phoenix
On 4/17/06, Joshua Colson <[EMAIL PROTECTED]> wrote: > I need > to know what cpan modules people would recommend for > tokenizing these > records. Maybe Parse::RecDescent? http://search.cpan.org/~dconway/Parse-RecDescent-1.94/lib/Parse/RecDescent.pod Hope this helps! --Tom Phoenix Stonehe

Re: Setting Content-Length Header In CGI.pm

2006-04-17 Thread Mr. Shawn H. Corey
On Tue, 2006-18-04 at 01:47 +0100, Mike Martin wrote: > Does anyone know if this is possible? > > I have a pair of scripts which take in up to 6 filefields, munge them > so path info remains and get sent to shell commands. > > However after a certain amount of data I get a "Invalid > Content-Leng

Setting Content-Length Header In CGI.pm

2006-04-17 Thread Mike Martin
Does anyone know if this is possible? I have a pair of scripts which take in up to 6 filefields, munge them so path info remains and get sent to shell commands. However after a certain amount of data I get a "Invalid Content-Length" error and it bombs out. Googled to no avail. As ever any help a

Re: combine 2 "open for reading" filehandles

2006-04-17 Thread John W. Krahn
JupiterHost.Net wrote: > Howdy list :) Hello, > I'm having a bit of a time with combining 2 read filehandles. The FAQ has a good explanation about that: perldoc -q stderr John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: combine 2 "open for reading" filehandles

2006-04-17 Thread M. Kristall
JupiterHost.Net wrote: Howdy list :) I'm having a bit of a time with combining 2 read filehandles. [snip] What I'd like to do is process $read_fh and $error_fh in the order they actually happen ( which is what open3($write_fh, $read_fh, $read_fh, ... does ) but still have the error handle a

Re: Question about File Uploads

2006-04-17 Thread M. Kristall
Mike Martin wrote: Hi I have a CGI script that uses filefields to get filenames before passing to the shell and I want to disable the creation of a tempfile. After googling for a while I cant find out where to turn this behaviour off. I have found references to $use_tempfiles variable, but am hav

Re: encoding of source file

2006-04-17 Thread M. Kristall
Brano Gerzo wrote: Hi all, I have bunch of TXT files. I'd like to know theirs encoding, for Try Encode::Guess -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

combine 2 "open for reading" filehandles

2006-04-17 Thread JupiterHost.Net
Howdy list :) I'm having a bit of a time with combining 2 read filehandles. Let me explain, use strict; use warnings; use IPC::Open3; my ($write_fh, $read_fh, $error_fh); open3($write_fh, $read_fh, $error_fh, ... while(<$read_fh>) { ... } while(<$error_fh>) { ... } works fine, great.. Wh

RE: Lexical analysis of log file

2006-04-17 Thread Joshua Colson
On Mon, 2006-04-17 at 14:08 -0700, Timothy Johnson wrote: > Was this logfile made by a particular product? There might be a module > made specifically for it. No. It is a home brewed application. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Lexical analysis of log file

2006-04-17 Thread Timothy Johnson
Was this logfile made by a particular product? There might be a module made specifically for it. -Original Message- From: Joshua Colson [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:57 PM To: Perl Beginners Subject: Lexical analysis of log file I have a log file of the forma

Question about File Uploads

2006-04-17 Thread Mike Martin
Hi I have a CGI script that uses filefields to get filenames before passing to the shell and I want to disable the creation of a tempfile. After googling for a while I cant find out where to turn this behaviour off. I have found references to $use_tempfiles variable, but am having difficulties work

Lexical analysis of log file

2006-04-17 Thread Joshua Colson
I have a log file of the format: ### BEGIN LOG ### [datestamp unique-id]: [datestamp unique-id]: ( [field] => value [field2] => value [etc...] => value ) [datestamp unique-id]: ( [field9] => value [field3] => value [etc...] => value ) ### END LOG ### Each 'record' is delimited by

Re: Catching the output in file

2006-04-17 Thread JupiterHost.Net
Irfan J Sayed wrote: Hi, Hello, I am executing following command foreach $_ (@vob_list) { system "cleartool lock vob:$_"; } I want to catch the output of this system command in the file can anybody please tell me that how can i achieve that a) have the shell do it: cleartool lockk v

RE: Catching the output in file

2006-04-17 Thread Timothy Johnson
You could always use backticks (``) to capture the output in an array and then print it to a file. -Original Message- From: Irfan J Sayed [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 7:11 AM To: beginners@perl.org Subject: Catching the output in file Hi, I am executing follow

Re: Ordering Data on a web page

2006-04-17 Thread Mr. Shawn H. Corey
On Mon, 2006-17-04 at 16:03 +0100, Graeme McLaren wrote: > Hi all, I need to order some data and I'm not exactly sure how to go about > doing it. Say I have 10 records displayed on a web page and I have an "Up" > and "Down" link which allows the user to move each record up by one or down > by o

Re: Catching the output in file

2006-04-17 Thread Chas Owens
On 4/17/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: snip > I want to catch the output of this system command in the file snip TIMTOWTDI #shell redirection foreach my $vob (@vob_list) { system "cleartool lock vob:$vob >> output"; } #store in array my @output; foreach my $vob (@vob_list) {

Ordering Data on a web page

2006-04-17 Thread Graeme McLaren
Hi all, I need to order some data and I'm not exactly sure how to go about doing it. Say I have 10 records displayed on a web page and I have an "Up" and "Down" link which allows the user to move each record up by one or down by one. The problem I have is that I can't just get the current posi

Re: Catching the output in file

2006-04-17 Thread Mr. Shawn H. Corey
On Mon, 2006-17-04 at 19:40 +0530, Irfan J Sayed wrote: > Hi, > > I am executing following command > > foreach $_ (@vob_list) > { > system "cleartool lock vob:$_"; > } > > I want to catch the output of this system command in the file > > can anybody please tell me that how can i achieve that

Catching the output in file

2006-04-17 Thread Irfan J Sayed
Hi, I am executing following command foreach $_ (@vob_list) { system "cleartool lock vob:$_"; } I want to catch the output of this system command in the file can anybody please tell me that how can i achieve that Regards Irfan Sayed

Re: redirecting array to file

2006-04-17 Thread Dr.Ruud
"Dr.Ruud" schreef: > Irfan J Sayed: >> Can anybody please tell me how to redirect / write the contents of >> array to the file > > print $fh, "@ary"; Oops, I didn't mean that comma to be there: print $fh "@ary"; -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMA

encoding of source file

2006-04-17 Thread Brano Gerzo
Hi all, I have bunch of TXT files. I'd like to know theirs encoding, for example CP-1251 ISO-8859-1 ISO-8859-2 UTF-8 and so on. Exists some module for this (or something on *nix, it could be exe too) ? Thanks a lot /brano -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: redirecting array to file

2006-04-17 Thread Dr.Ruud
Irfan J Sayed schreef: > Can anybody please tell me how to redirect / write the contents of > array to the file print $fh, "@ary"; You need to tell more, like what the file is for. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Fw: redirecting array to file

2006-04-17 Thread swayam panda
Hi, @array=(1,2,3,4,5); open(FH,"> path to yourfile") or die can't open the file $!"; print FH @array; close FH; - Original Message - From: "Irfan J Sayed" <[EMAIL PROTECTED]> To: Sent: Monday, April 17, 2006 4:37 PM Subject: redirecting array to file Hi, Can anybody please tell me

redirecting array to file

2006-04-17 Thread Irfan J Sayed
Hi, Can anybody please tell me how to redirect / write the contents of array to the file Regards Irfan Sayed

Re: split function in perl

2006-04-17 Thread Dr.Ruud
Xavier Noria schreef: > split /[\W_]/ Alternatives: split /\W|_/ split /[^[:alnum:]]/ -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: split function in perl

2006-04-17 Thread Xavier Noria
On Apr 17, 2006, at 10:30, Irfan J Sayed wrote: Hi, I have a following line stored in one variable $test. deliver.Admin_Irfan_Project.20060413.212355 . I need to split this line into the words and store the output in array. words should like this. deliver admin irfan project 20060413 21235

Re: Split function help

2006-04-17 Thread M Senthil Kumar
On Mon, 17 Apr 2006, M Senthil Kumar wrote: |On Mon, 17 Apr 2006, Irfan J Sayed wrote: | | ||i want to split this line in . and store in array. ||I am using following code ||my @name = Split(/./, $test); | | |Try escaping "." with a "\". | |HTH, | |Senthil | And oh I forgot: "Split" should have b

split function in perl

2006-04-17 Thread Irfan J Sayed
Hi, I have a following line stored in one variable $test. deliver.Admin_Irfan_Project.20060413.212355 . I need to split this line into the words and store the output in array. words should like this. deliver admin irfan project 20060413 212355 I am using following code to split this line $test

Re: Split function help

2006-04-17 Thread nishanth ev
Hello, In case of linux you have to escape the . and the function name should be split and not Split. Not quite sure about windows. Regards Nishanth --- M Senthil Kumar <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Irfan J Sayed wrote: > > > |i want to split this line in . and store in ar

Re: Split function help

2006-04-17 Thread M Senthil Kumar
On Mon, 17 Apr 2006, Irfan J Sayed wrote: |i want to split this line in . and store in array. |I am using following code |my @name = Split(/./, $test); Try escaping "." with a "\". HTH, Senthil -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Split function help

2006-04-17 Thread Irfan J Sayed
Hi, I have a following line/statement stored in variable $test deliver.Admin_Irfan_Project.20060413.212355 i want to split this line in . and store in array. I am using following code my @name = Split(/./, $test); but i am getting following error Use of uninitialized value in pattern match (