Re: help with array within another array

2007-03-06 Thread Dr.Ruud
"John W. Krahn" schreef: > Dr.Ruud: >> John W. Krahn: >>> Dr.Ruud: Yes, "passing the bareword test" is a better phrase than only mentioning "word" characters. There are border cases though: perl -Mstrict -MData::Dumper -wle' $_ = { AB => 1, +AB => 2, -AB => 3 }

centralized variable variables

2007-03-06 Thread Bernard van de Koppel
Hi, Hi, I want to set pathnames in a centralised module (called with use or require). Is it possible to send an variable (through the env or as an argument, or ) so I can use the variable $dir from the module test.pl to set the variable $vardir in param.pl. ?? Any help greatly appreciat

Re: centralized variable variables

2007-03-06 Thread Jeff Pang
Is it possible to send an variable (through the env or as an >argument, or ) so I can use the variable $dir from the module >test.pl to set the variable $vardir in param.pl. ?? > Yes you can. You may declare the vars wanted to be shared in the module as package variable using Perl's "our"

Re: centralized variable variables

2007-03-06 Thread Beginner
On 6 Mar 2007 at 6:08, Jeff Pang wrote: > Is it possible to send an variable (through the env or as an > >argument, or ) so I can use the variable $dir from the module > >test.pl to set the variable $vardir in param.pl. ?? > > > > Yes you can. > You may declare the vars wanted to be shared

Re: centralized variable variables

2007-03-06 Thread Jeff Pang
> >Is the 1; required here? I thought it was only needed in packages. Am >I mistaken? > Yes,'1' is needed.When you requie a file in a perl script but that file return a false value,the 'require' should get failed.It would report the errors like: param.pl did not return a true value at test.pl

Re: centralized variable variables

2007-03-06 Thread Rob Dixon
Beginner wrote: > On 6 Mar 2007 at 6:08, Jeff Pang wrote: Is it possible to send an variable (through the env or as an argument, or ) so I can use the variable $dir from the module test.pl to set the variable $vardir in param.pl. ?? Yes you can. You may declare the vars wanted to be sh

Re: help with array within another array

2007-03-06 Thread Chas Owens
On 3/6/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: "John W. Krahn" schreef: > Dr.Ruud: >> John W. Krahn: >>> Dr.Ruud: Yes, "passing the bareword test" is a better phrase than only mentioning "word" characters. snip > perldoc perlop > -bareword is equivalent to "-bareword" Yes, but un

RE: Perl test tools

2007-03-06 Thread Jerry DuVal
http://pub.langworth.com/perl_test_refcard.pdf Jerry DuVal Pace Systems Group, Inc. 800.624.5999 www.Pace2020.com >-Original Message- >From: Nath, Alok (STSD) [mailto:[EMAIL PROTECTED] >Sent: Tuesday, March 06, 2007 2:29 AM >To: Jeff Pang; beginners@perl.org >Subject: RE: Perl test tools

Re: what does foreach do?

2007-03-06 Thread Chas Owens
On 3/6/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Gary wrote: snip > I'm curious about how much time it takes to do something like insert into the > middle ofan array. Is that O(1)? Yes. $ perl -le' my @array = 0 .. 20; print "@array"; splice @array, 10, 0, "X", "Y", "Z"; print "@array"; '

Re: what does foreach do?

2007-03-06 Thread Chas Owens
On 3/6/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip Here is the benchmark I used. You can play around with $k (the offset) to see it's role. snip Whoops, make that $mid rather than $k. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://lea

Re: centralized variable variables

2007-03-06 Thread Chas Owens
On 3/6/07, Beginner <[EMAIL PROTECTED]> wrote: On 6 Mar 2007 at 6:08, Jeff Pang wrote: snip > $ cat test.pl > use strict; > our ($path1,$path2); > require "param.pl"; > print("path1 $path1\n"); > print("path2 $path2\n"); > > $ cat param.pl > #!/usr/bin/perl > use strict; > my $basepath = "/var/

Re: Off-Topic: Is the Randall Schwartz of Perl Fame?

2007-03-06 Thread Chas Owens
On 3/5/07, Jesse Engel <[EMAIL PROTECTED]> wrote: well i haven't read intel's side of it, but i am very happy about this as well. congratulations! i imagine you can even vote again! jesse He never lost the ability to vote (Oregon doesn't do that). As for Intel's side of it: http://www-swiss.

Re: what does foreach do?

2007-03-06 Thread Gary
So it sounds like from what you're saying, maybe the structure is a double-linked list? That would give the behaviour you're talking about. Chas Owens <[EMAIL PROTECTED]> wrote: On 3/6/07, John W. Krahn wrote: > Gary wrote: snip > > I'm curious about how much time it takes to do something like i

Centralised variables - different issue

2007-03-06 Thread Beginner
Hi, Following on from the earlier thread about storing common code in a central file, I have hit a problem when trying to do something similar. I have been toying with SOAP. There seems to be a number of ways to create SOAP services and I opted for one of the examples at guide.soaplite.com.

Re: Centralised variables - different issue

2007-03-06 Thread Tom Phoenix
On 3/6/07, Beginner <[EMAIL PROTECTED]> wrote: use Mymodule qw($server); package Test; # Is this the problem? Probably. Imports are package-scoped. Now you're working in package Test, and imports from Mymodule aren't available here. Of course, you can use additional 'use' declarat

Re: what does foreach do?

2007-03-06 Thread Chas Owens
On 3/6/07, Gary <[EMAIL PROTECTED]> wrote: So it sounds like from what you're saying, maybe the structure is a double-linked list? That would give the behaviour you're talking about. I doubt it is that simple. Remember, random access is generally considered to be O(1) on arrays and a double-l

Re: what does foreach do?

2007-03-06 Thread Chas Owens
On 3/6/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 3/6/07, Gary <[EMAIL PROTECTED]> wrote: > So it sounds like from what you're saying, maybe the structure is a double-linked list? > That would give the behaviour you're talking about. I doubt it is that simple. Remember, random access is gene

Where can I get the Perl library modules

2007-03-06 Thread Michael Goopta
Hi I am very new to perl. I could download perl.exe for my PC. But I do not have the library modules, such as time.pm etc. For this reason, when I use any "use <>" command (eg. use Time::localtime) the module is not found. Can anybody tell me the site where I can download the essential perl libra

what does a lone percent sign mean?

2007-03-06 Thread Tony Heal
I am trying to determine how this does what it does. sub IsLeapYear { my $year = shift; return 0 if $year % 4; return 1 if $year % 100; return 0 if $year % 400; return 1; } But I do not understand, and I can not find what a single, lone % means. Anyone know? To

RE: what does a lone percent sign mean?

2007-03-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Tony Heal [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 06, 2007 10:43 > To: beginners@perl.org > Subject: what does a lone percent sign mean? > > I am trying to determine how this does what it does. > > > > sub IsLeapYear > > { > >my $year = shif

Re: what does a lone percent sign mean?

2007-03-06 Thread Adriano Ferreira
On 3/6/07, Tony Heal <[EMAIL PROTECTED]> wrote: I am trying to determine how this does what it does. sub IsLeapYear { my $year = shift; return 0 if $year % 4; return 1 if $year % 100; return 0 if $year % 400; return 1; } The binary operator % is the modulo or remainder

Re: what does a lone percent sign mean?

2007-03-06 Thread Ireneusz Pluta
Tony Heal napisaƂ(a): But I do not understand, and I can not find what a single, lone % means. This is modulo operator. For basisc see: http://en.wikipedia.org/wiki/Modulo_operation -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn

Re: Where can I get the Perl library modules

2007-03-06 Thread Chas Owens
On 3/6/07, Michael Goopta <[EMAIL PROTECTED]> wrote: Hi I am very new to perl. I could download perl.exe for my PC. But I do not have the library modules, such as time.pm etc. For this reason, when I use any "use <>" command (eg. use Time::localtime) the module is not found. Can anybody tell me

Re: Where can I get the Perl library modules

2007-03-06 Thread Chas Owens
On 3/6/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 3/6/07, Michael Goopta <[EMAIL PROTECTED]> wrote: > Hi > I am very new to perl. I could download perl.exe for my PC. But > I do not have the library modules, such as time.pm etc. > > For this reason, when I use any "use <>" command (eg. use > Ti

Re: Centralised variables - different issue

2007-03-06 Thread Jeff Pang
-Original Message- >From: Beginner <[EMAIL PROTECTED]> >Sent: Mar 6, 2007 11:53 PM >To: beginners@perl.org >Subject: Centralised variables - different issue > >Hi, > >Following on from the earlier thread about storing common code in a >central file, I have hit a problem when trying to do

what's the difference between $1 and \1?

2007-03-06 Thread Jm lists
Hello, $s="hello,test"; the 1st statement: $s=~s/^(\w+)/$1 / the 2nd statement: $s=~s/^(\w+)/\1 / What's the difference between these two statements? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: what's the difference between $1 and \1?

2007-03-06 Thread Owen Cook
On Wed, Mar 07, 2007 at 02:54:15PM +0800, Jm lists wrote: > Hello, > > $s="hello,test"; > > the 1st statement: > $s=~s/^(\w+)/$1 / > > the 2nd statement: > $s=~s/^(\w+)/\1 / > > > What's the difference between these two statements? > Thanks! What was the output of your test script