Rob Dixon пишет:
Vyacheslav Karamov wrote:
I've solved my problem with captures, but I don't understand how to get
positions of matches:
my $regex = qr
{
(?i) # Case-insensitive
(
[\x{2022}\*]* # Any number of bullet or asterisk characters
[1-9]+ # One or more digits 1-9
\s* # Any number of
On Wed, 08 Oct 2008 04:59:19 -0700, John W. Krahn wrote:
> oldyork90 wrote:
>> I am using a module having documentation saying document() is a
>> method. However, I see it used as
>>
>> $o->document;
>>
>> Can you reference a method in this way? (I takes no args). I always
>> thought
>>
>> $o
Jeff,
thanks for your response. here is the output:
--- snip ---
$ ./program.pl
done
localhost$
--- snip ---
here is how I used it:
localhost$ cat ./program.pl
#!/sw/bin/perl
use Expect;
use strict;
my @elementList;
my $elementfile = './test.pl';
eval {require $elementfile};
for my
> Message du 09/10/08 11:58
> De : "Noah"
> A : "Jeff Pang"
> Copie à : "Perl Beginners"
> Objet : Re: use variables from another file
>
> my @elementList;
>
replace the line above to:
our @elementList;
For the reasons, see pls:
http://perl.plover.com/FAQs/Namespaces.html
Regards,
Jeff.
Vyacheslav Karamov wrote:
> Rob Dixon пишет:
>>
>> foreach my $citation (@vancouverCites) {
>>
>> print qq(Text = "$citation"\n);
>>
>> while ($citation =~ /$regex/g) {
>> print qq(pos = $-[0] to $+[0]\n);
>> }
>> print "\n";
>> }
>>
>> I hope this helps,
>>
>> Rob
>>
>>
Hi all,
Jeff Pang wrote:
> Message du 09/10/08 13:36
De : "Praveena Vittal"
A : "Rob Dixon"
Copie à : "Perl Beginners" , "Jeff Pang"
Objet : Re: certification for perl
Hi All,
Thanks for your suggestion .
First of all ,i was shocked to see the list of books.
No shocking. I was
Hi All,
Thanks for your suggestion .
First of all ,i was shocked to see the list of books.
Also I got the safari resource library from where we can enrich our
knowledge.Thanks for that.
Regards,
Praveena
Rob Dixon wrote:
Jeff Pang wrote:
Message du 06/10/08 14:22 De : "Praveena Vittal
> Message du 09/10/08 13:36
> De : "Praveena Vittal"
> A : "Rob Dixon"
> Copie à : "Perl Beginners" , "Jeff Pang"
> Objet : Re: certification for perl
>
>
> Hi All,
>
> Thanks for your suggestion .
>
> First of all ,i was shocked to see the list of books.
>
No shocking. I was once seeing more Pe
I have a string of text that I want to split on the tabs:
while () {
my @array = split(/\t/, $_);
...manipulate them a little, and print them back out like so:
print "$array[0],$array[1],$array[2]"; etc.
}
I normally just print them as above, but I'm thinking there must be a
better way
Hey,
> print "$array[0],$array[1],$array[2]"; etc.
There are different ways:
1) print @array;
usually you want to see which element is at which index so
2) print join(" - ", @array);
is maybe better.
HTH
Martin
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai
On Thursday 09 October 2008, Charlie Farinella wrote:
> I have a string of text that I want to split on the tabs:
>
> while () {
> my @array = split(/\t/, $_);
>
> ...manipulate them a little, and print them back out like so:
>
> print "$array[0],$array[1],$array[2]"; etc.
> }
>
> I nor
Charlie Farinella wrote:
>
> I have a string of text that I want to split on the tabs:
>
> while () {
> my @array = split(/\t/, $_);
>
> ...manipulate them a little, and print them back out like so:
>
> print "$array[0],$array[1],$array[2]"; etc.
> }
>
> I normally just print them as ab
Charlie Farinella wrote:
I have a string of text that I want to split on the tabs:
while () {
my @array = split(/\t/, $_);
...manipulate them a little, and print them back out like so:
print "$array[0],$array[1],$array[2]"; etc.
}
I normally just print them as above, but I'm thinking
On Thu, 2008-10-09 at 16:53 -0400, Charlie Farinella wrote:
> I have a string of text that I want to split on the tabs:
>
> while () {
> my @array = split(/\t/, $_);
>
> ...manipulate them a little, and print them back out like so:
>
> print "$array[0],$array[1],$array[2]"; etc.
> }
>
>
My simple program works well in the terminal window:
#!/usr/bin/perl -w
use strict;
my $answer;
for ($a = 1; $a <= 100; $a++)
{
for ($b = 1; $b <= 100; $b++)
{
$answer = ($a-$b);
print "$a - $b\t$answer\n";
}
}
Output:
1 - 1 0
1 - 2 -1
1 - 3 -2
1 -
Try taking away the "+" in your filehandle line, so that it reads:
open
(WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt");
Dave
On Fri, 10 Oct 2008 09:31:02 +1000, David <[EMAIL PROTECTED]> wrote:
open(WRITE,"+>/Users/dave/Documents/Programming/Perl/081008mathtables
Try taking away the "+" in your filehandle line, so that it reads:
open
(WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt");
No, that didn't work. Program changed to:
#!/usr/bin/perl -w
use strict;
my $answer;
open(WRITE,">/Users/dave/Documents/Programming/Perl/081008ma
David wrote:
My simple program works well in the terminal window:
#!/usr/bin/perl -w
use strict;
my $answer;
for ($a = 1; $a <= 100; $a++)
{
for ($b = 1; $b <= 100; $b++)
{
$answer = ($a-$b);
print "$a - $b\t$answer\n";
}
}
Output:
1 - 1 0
1 - 2 -1
1
On Thu, 2008-10-09 at 19:31 -0400, David wrote:
> However, when I insert some code to write to a file it fails an odd death:
>
> #!/usr/bin/perl -w
> use strict;
use warnings;
# This is preferred over the -w in the shebang line
# use diagnostics;
# This may replace warnings and gives a long expla
Thank you, everyone who helped me. I greatly appreciate this.
-David
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
20 matches
Mail list logo