On Sun, Jan 18, 2015 at 9:28 AM, Jim Gibson wrote:
>
>> On Jan 18, 2015, at 9:03 AM, Mike wrote:
>>
>> I was able to find match extraction in the perldoc.
>>
>> Here is a snippet of what I have.
>>
>> my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
>> print "$insult\n";
>>
>> But $insul
Thanks. This worked.
On 1/18/15 12:28 PM, Jim Gibson wrote:
On Jan 18, 2015, at 9:03 AM, Mike wrote:
I was able to find match extraction in the perldoc.
Here is a snippet of what I have.
my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
print "$insult\n";
But $insult is being popula
> On Jan 18, 2015, at 9:03 AM, Mike wrote:
>
> I was able to find match extraction in the perldoc.
>
> Here is a snippet of what I have.
>
> my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
> print "$insult\n";
>
> But $insult is being populated with: 1
>
> It should be populated wi
I was able to find match extraction in the perldoc.
Here is a snippet of what I have.
my $insult = ( $mech->text =~ m/Insulter\ (.*)\ Taken/ );
print "$insult\n";
But $insult is being populated with: 1
It should be populated with text. Can anyone tell me what I'm doing
wrong here?
Thanks.
On Sun, 18 Jan 2015 11:49:11 -0500
Mike wrote:
> Hey everyone, I'm trying to find information on how I can use regular
> expressions to populate a variable.
>
> I want to pull text between one set of characters and another set of
> characters and use that to populate my variable. Can anyone po
Hi
The "8.1.8" =~ /[\d $versao \s]/ will always return true because the square
parenthesis ([]) matches the string against one of the chars inside. In this
case the \d (digit) matches because you have a digit inside.
In your code you wrote "8.1.8" =~ /$version/. This takes the $version a treat
On 4/11/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
snip
if ( "8.1.8" =~ /$version/)
snip
You are using the operators incorrectly. It should look like this:
if ($version =~ /8\.1\.8/)
The form is "variable binding_operator regex". Note that the periods
need to be escaped otherwise they w
From: Rodrigo Tavares [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 9:31 AM
To: beginners@perl.org
Subject: Using regular expressions with delimitaters
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8" =~ /[\d $versao \s]/)
[ Please do not quote the whole message you are responding to, but only
what's needed to give context. Also, please type your reply *below* the
part(s) of the message you are commenting on. ]
Michael Kraus wrote:
John W. Krahn wrote:
You should *always* verify that the files were opened correctl
Michael S. E. Kraus wrote:
G'day...
Hello,
On Wed, 2004-11-24 at 23:10, FlashMX wrote:
To be able to do a grep on a file via a perl script do you have to
read the whole file in before performing the search and replace?
I've been hearing that reading the whole file in takes up
memory and if multipl
Michael S. E. Kraus wrote:
G'day...
Hello,
On Wed, 2004-11-24 at 23:00, FlashMX wrote:
Could you give an example of using grep on a array to do a replace?
grep example:
if (grep(/bazza/i, @myarray)) {
print "Bazza's home!\n";
}
OR
my @bazza_list = grep {/bazza/i} @myarray;
(Either form is
G'day...
On Wed, 2004-11-24 at 23:00, FlashMX wrote:
> Could you give an example of using grep on a array to do a replace?
grep example:
if (grep(/bazza/i, @myarray)) {
print "Bazza's home!\n";
}
OR
my @bazza_list = grep {/bazza/i} @myarray;
(Either form is fine)
However to do a repl
G'day...
On Wed, 2004-11-24 at 23:10, FlashMX wrote:
> To be able to do a grep on a file via a perl script do you have to read the
> whole file in before performing the search and replace? I've been hearing
> that reading the whole file in takes up
> memory and if multiple users are running the
To be able to do a grep on a file via a perl script do you have to read the
whole file in before performing the search and replace? I've been hearing that
reading the whole file in takes up
memory and if multiple users are running the script then you better have alot
of swap and memory.
Is thi
Could you give an example of using grep on a array to do a replace?
On Wed, 24 Nov 2004 10:05:39 +0530, Prasanna Kothari wrote:
>Hi,
>Replace
>$output = ~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
>with
>my $output =~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
>
>You can use "perl -c " which will show you such ty
Hi,
Replace
$output = ~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
with
my $output =~ s/AAA*?BBBt/AAA 111 *?222 BBB/g;
You can use "perl -c " which will show you such type of errors.
After opening the output file, it's better to check if the file is
opened successfully(as done in the case of INPUT).
I thin
Hi,
The code below opens a file and writes the contents to a temporary file. I need
to do a search and replace of certain matches in the files and I thought I
might be able to use regular
expressions.
Being new to perl and now trying expressions has almost put me over the edge.
When I run the
"John W. Krahn" wrote:
>
> Jon Hans wrote:
> >
> > #ugly
> >if ( defined $frequency{$datalist[$first]} &&
> > defined $frequency{$datalist[$first+1]} &&
> > $frequency{$datalist[$first+2]} &&
> > $frequency{$datalist[$first+3]} &&
> > $frequency{$datalist[$first+4]} &&
> > $frequency{$datalis
Jon Hans wrote:
>
> #!/usr/bin/perl
> ###
>
> I am trying to find all of the reoccurring sequences
> excluding the sub sequences.
>
> Maybe I am missing the obvious, but having a little
> perl exposure and not being an expert perl programmer
>
19 matches
Mail list logo