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
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/
-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
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
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
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
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
> -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
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
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
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
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
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
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.
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
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.
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/
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
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";
'
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
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
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
>
>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
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
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"
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
"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 }
27 matches
Mail list logo