Re: assigning list to hash entry

2006-01-16 Thread Anders Stegmann
Thanks for replying! Actually, I have a highly complex datastructure in which both strings, lists and hashes are values in a primary hash. e.g. $hash{$key}[0] = @list; $hash{$key}[1] = $string; $hash{$key}[2] = %hash; I need to assign these values to a specific (number)entry in the pr

Re: assigning list to hash entry

2006-01-16 Thread Xavier Noria
On Jan 16, 2006, at 9:03, Anders Stegmann wrote: Actually, I have a highly complex datastructure in which both strings, lists and hashes are values in a primary hash. e.g. $hash{$key}[0] = @list; $hash{$key}[1] = $string; $hash{$key}[2] = %hash; In Perl data estructures can only store scalar

Re: about the var's scope

2006-01-16 Thread John Doe
Shawn Corey am Montag, 16. Januar 2006 04.12: [...] > > Ok, it would be interesting to look deeper into the mess of different > > variables all named with the same name $q, exported across the modules, > > overwritten by several imports... > > > > What do you want to achieve with your code? It look

Re: about the var's scope

2006-01-16 Thread Jeff Pang
I think the only difference between the two is Stat's code do the things of sharing vars across modules really. Under mod_perl,the situation is very different from common CGI environment,and the vars sharing sometimes is useful and needed. I hope I'm correct.If not,the criticism are welcome. ---

Combine multiple lines into one line

2006-01-16 Thread Andrej Kastrin
Hi all, I have the file, which looks like: *RECORD* *ID* 001 *TITLE* Here is title number one. *ABSTRACT* First sentence of the abstract. Second sentence of the abstract... Second line of the abstract. *RECORD* *ID* 002 *TITLE* Here is title number one. *ABSTRACT* First sentence of the abstract

Re: Combine multiple lines into one line

2006-01-16 Thread Bjørge Solli
On Monday 16 January 2006 14:32, Andrej Kastrin wrote: > Hi all, Hi Andrej > I have the file, which looks like: > > *RECORD* > *ID* > 001 > *TITLE* > Here is title number one. > *ABSTRACT* > First sentence of the abstract. Second sentence of the abstract... > Second line of the abstract. > > *REC

perl-module ParseLex-2.15 install fails on make test

2006-01-16 Thread Bjørge Solli
System: Fedora Core 4 on a AMD64. I've tried using the cpan-command install Parse::Lex and the manual 'perl Makefile.pl && make && make test'(it fails on the test) Let me know if this is the wrong list, but I really am a beginner when it comes to perl. I am trying to install a Live Access Server

How to take a reference "in line"

2006-01-16 Thread Bill Gradwohl
Using the example below (partially taken from Learning PERL Objects), I can't seem to figure out how to take a reference to an array in-line. See the last 2 lines: #!/usr/bin/perl use Data::Dumper; sub check_required_items { my $who = shift; my $items = shift; my @required = qw(preserver

Re: Combine multiple lines into one line

2006-01-16 Thread John Doe
Andrej Kastrin am Montag, 16. Januar 2006 14.32: > Hi all, > > I have the file, which looks like: > > *RECORD* > *ID* > 001 > *TITLE* > Here is title number one. > *ABSTRACT* > First sentence of the abstract. Second sentence of the abstract... > Second line of the abstract. > > *RECORD* > *ID* > 00

Re: about the var's scope

2006-01-16 Thread Shawn Corey
Jeff Pang wrote: I think the only difference between the two is Stat's code do the things of sharing vars across modules really. Under mod_perl,the situation is very different from common CGI environment,and the vars sharing sometimes is useful and needed. I hope I'm correct.If not,the criticis

Re: assigning list to hash entry

2006-01-16 Thread Shawn Corey
Xavier Noria wrote: In Perl data estructures can only store scalar values. That's why references are used to emulate nested structures: $hash{$key}[0] = [EMAIL PROTECTED]; # note that @s are arrays, not lists $hash{$key}[1] = $string; $hash{$key}[2] = \%hash; There are some pages

Re: Combine multiple lines into one line

2006-01-16 Thread Bob Showalter
Andrej Kastrin wrote: Hi all, I have the file, which looks like: *RECORD* *ID* 001 *TITLE* Here is title number one. *ABSTRACT* First sentence of the abstract. Second sentence of the abstract... Second line of the abstract. *RECORD* *ID* 002 *TITLE* Here is title number one. *ABSTRACT* First s

Re: interpolation

2006-01-16 Thread Shawn Corey
John Doe wrote: The Ghost am Montag, 16. Januar 2006 06.34: I am storing text stings in a database. when I have the string: 'some perl $variable' which would print as: some perl $variable how can I force interpolation of '$variable'? one idea I thought of was: #!/usr/bin/perl my $var='var

Array of hashes

2006-01-16 Thread balan.ranganathan
Hi All Can anyone tell me whether there is any way for declaring an array of hashes similar to creating array of structure variables in C programming? Thanks Best regards Bala The information contained in this electronic message and any attachments to this message are intended for the exclu

Re: How to take a reference "in line"

2006-01-16 Thread Shawn Corey
Bill Gradwohl wrote: my $arrayPointer; # This works: @{$arrayPointer}=qw(Money preserver sunscreen); check_required_items("Mr. Howell", $arrayPointer); # These don't work: check_required_items("Mr. Howell", @{$arrayPointer}=qw(Money preserver sunscreen)); check_required_items("Mr. Howell", qw(

Re: Array of hashes

2006-01-16 Thread Shawn Corey
[EMAIL PROTECTED] wrote: Hi All Can anyone tell me whether there is any way for declaring an array of hashes similar to creating array of structure variables in C programming? There is a module, Class::Struct, that might be what you want. See `perldoc Class:Struct`. However, I would simply

RE: [Win32] Basic I/O Question

2006-01-16 Thread Timothy Johnson
The diamond operator works fine without escaping your backslashes, but I recommend putting quotes around your arguments. The following works just fine for me: c:\> while.pl "c:\documents and settings\username\desktop\file.txt" If you want to use the less-than operator (or a pipe), then yo

Re: dprofpp

2006-01-16 Thread Chris Devers
On Fri, 13 Jan 2006, Gerard Robin wrote: > And, what are exactly Elapsed Time and User+System Time ? > > If i run time ./dprof1.pl the outputs are: > > real0m0.033s > user0m0.011s > sys 0m0.002s > > If i run time ./dprof3.pl the outputs are: > > real0m0.059s > user0m0.018s

Re: interpolation

2006-01-16 Thread John Doe
Shawn Corey am Montag, 16. Januar 2006 16.55: > John Doe wrote: > > The Ghost am Montag, 16. Januar 2006 06.34: > >>I am storing text stings in a database. when I have the string: > >> > >>'some perl $variable' > >> > >>which would print as: > >> > >>some perl $variable > >> > >>how can I force in

RE: [Win32] Basic I/O Question

2006-01-16 Thread Hardly Armchair
--- Timothy Johnson <[EMAIL PROTECTED]> wrote: > The diamond operator works fine without escaping > your backslashes, but I > recommend putting quotes around your arguments. The > following works > just fine for me: > > c:\> while.pl "c:\documents and > settings\username\desktop\file.txt"

Re: perl-module ParseLex-2.15 install fails on make test

2006-01-16 Thread Tom Phoenix
On 1/16/06, Bjørge Solli <[EMAIL PROTECTED]> wrote: > install Parse::Lex > t/test1FAILED test 1 > Failed 1/1 tests, 0.00% okay I get the same as you do; all tests fail. I recommend contacting the module's author, or using a different module. Cheers! --Tom Phoenix Stonehenge Perl Trai

Re: Combine multiple lines into one line

2006-01-16 Thread Dr.Ruud
Andrej Kastrin: > I have the file, which looks like: > > *RECORD* > *ID* > 001 > *TITLE* > Here is title number one. > *ABSTRACT* > First sentence of the abstract. Second sentence of the abstract... > Second line of the abstract. > [...] > > Is there any simple way to transform this file to look

RE: [Win32] Basic I/O Question

2006-01-16 Thread Timothy Johnson
(response below) >-Original Message- >From: Hardly Armchair [mailto:[EMAIL PROTECTED] >Sent: Monday, January 16, 2006 3:19 PM >To: Timothy Johnson; beginners@perl.org >Subject: RE: [Win32] Basic I/O Question >> If you want to use the less-than operator (or a >> pipe), then you have to