On 10/25/23 10:32, Josef Wolf wrote:
[...]
Basically, I want to do the same as
$data =~ s/^foo (whatever) bar$/bar $1 baz/mg;
but with a different interface (because it has to be embedded into a bigger
project), So I have come with this;
sub substitute_lines {
my ($contents,
ew
Solomon"
Cc: "Josef Wolf" ;
Sent: Thursday, October 26, 2023 12:07 AM
Subject: RE: Using qr// with substitution and group-interpolation in the
substitution part
Josef,
Inspired by Levi's “eval” idea, here is my solution:
sub substitute_lines {
my ($content
things" command on your system.
-Original Message-
From: Claude Brown via beginners
Sent: Thursday, October 26, 2023 8:07 AM
To: Levi Elias Nystad-Johansen ; Andrew Solomon
Cc: Josef Wolf ; beginners@perl.org
Subject: RE: Using qr// with substitution and group-interpolation
Josef,
Inspired by Levi's “eval” idea, here is my solution:
sub substitute_lines {
my ($contents, $regex, $subst) = @_;
eval "\$contents =~ s/$regex/$subst/g";
return $contents;
}
$data = "foo whatever bar";
$data = &substitute_lines($data, qr/^foo (whatever) bar$/m, 'bar $1 baz');
p
That's a fun question, Josef!
I don't think you can pass a replacement phrase around, so this is all I
came up with:
sub substitute_lines {
my ($contents, $subst) = @_;
$contents = $subst->($contents);
return $contents;
}
my $data = "foo whatever bar";
print(substitute_lines($data, sub { $
Hallo all,
maybe this is not exactly a beginner question, but I could not find an
appropriate mailing list (all other lists seem to be developer realted).
Basically, I want to do the same as
$data =~ s/^foo (whatever) bar$/bar $1 baz/mg;
but with a different interface (because it has to be
quot; or die($!);
>>> >
>>> > for(@array){
>>> > #print "Hi";
>>> > s/\%VERSIONS\%/$version1/g;
>>> >
>>> >
>>> > }
>>> > untie(@array);
>>> >
>>> > FILE:
>>>
e::File,"$rtf1" or die($!);
>> >
>> > for(@array){
>> > #print "Hi";
>> > s/\%VERSIONS\%/$version1/g;
>> >
>> >
>> > }
>> > untie(@array);
>> >
>> > FILE:
>> > ***
gt; > ***
> >
> > *Version *%VERSION%, Hello,HI
>
> In the substitution, you have VERSIONS but in the file, you have VERSION
>
> If the S is optional, use: s/\%VERSIONS?\%/$version1/g;
>
>
> --
> Don&
NS\%/$version1/g;
>
>
> }
> untie(@array);
>
> FILE:
> ***
>
> *Version *%VERSION%, Hello,HI
In the substitution, you have VERSIONS but in the file, you have VERSION
If the S is optional, use: s/\%VERSIONS?\%/$version1/g;
--
Don't stop where t
Hello,
I am sorry, I don't know what are you doing wrong, but this
code works for me.
use strict;
#use warnings;
use Tie::File;
my $file
= 'file.txt';
my $version1 = "JITENDRA";
tie my(@array), 'Tie::File',
$file or die "Cannot open file `$file': $!";
for(@array) {
#warn "F: ",
$_;
s/%VER
HI All,
My code is:
$version1 = "JITENDRA";
tie @array,Tie::File,"$rtf1" or die($!);
for(@array){
#print "Hi";
s/\%VERSIONS\%/$version1/g;
}
untie(@array);
FILE:
***
*Version *%VERSION%, Hello,HI
*Installation Notes*
T
On 11/30/2013 5:16 AM, Lars Noodén wrote:
On 11/30/2013 02:55 PM, Charles DeRykus wrote:
[ ..
Thanks. I see those in perlop and perlfunc. In perlfunc, it is grouped
as "Regular expressions and pattern matching" though that man page just
points to perlop.
A really clear description in perlre
On 11/30/2013 02:55 PM, Charles DeRykus wrote:
> See the substitution operator in perlop:
>
> |||<http://perldoc.perl.org/functions/s.html>| A |/e| will cause the
> replacement portion to be treated as a full-fledged Perl expression and
> evaluated right then and there. I
On 11/30/2013 4:07 AM, Lars Noodén wrote:
perlre(1) seems to be missing information about substitution evaluations
with the /e option. The functionality is present in perl:
perl -e '$_=2; s/2/1+3/e; print'
But it is not listed in the pod documentation for v5.16.3 or v5
"Lars Noodén" wrote:
>perlre(1) seems to be missing information about substitution
>evaluations
>with the /e option. The functionality is present in perl:
>
> perl -e '$_=2; s/2/1+3/e; print'
>
>But it is not listed in the pod documentation fo
perlre(1) seems to be missing information about substitution evaluations
with the /e option. The functionality is present in perl:
perl -e '$_=2; s/2/1+3/e; print'
But it is not listed in the pod documentation for v5.16.3 or v5.18.1.
The modifier /e is described in "P
On Wed, Dec 26, 2012 at 10:29 AM, Paul Johnson wrote:
> On Wed, Dec 26, 2012 at 04:10:06PM +0100, gator...@yahoo.de wrote:
>> Hi,
>>
>> I would like to store regular expressions and substitution strings in
>> a hash variable. If a given string matches any of
On 2012-12-26 19:29, Paul Johnson wrote:
> This is a situation where string eval is warranted:
>
> eval "\$s =~ s/\$rx/$r/";
... thanks a lot!
Now that I now how it works, I can't believe I couldn't
find the problem!
I had tried string eval too; the real trick that I didn't get
right is that t
On Wed, Dec 26, 2012 at 04:10:06PM +0100, gator...@yahoo.de wrote:
> Hi,
>
> I would like to store regular expressions and substitution strings in
> a hash variable. If a given string matches any of the stored patterns,
> the corresponding substitution should be applied. What or
Hi,
Please, check my comments below:
On Wed, Dec 26, 2012 at 4:10 PM, wrote:
> Hi,
>
> I would like to store regular expressions and substitution strings in
> a hash variable. If a given string matches any of the stored patterns,
> the corresponding substitution should b
Hi,
I would like to store regular expressions and substitution strings in
a hash variable. If a given string matches any of the stored patterns,
the corresponding substitution should be applied. What originally looked
trivial turned out to be quite a challenge, particularly if the
substitution
Shlomi Fish wrote:
thanks for your answer. See below for my response.
On Wed, 5 Sep 2012 09:54:11 -0400
Shawn H Corey wrote:
On Wed, 5 Sep 2012 14:33:13 +0100
jet speed wrote:
i have an regx question. i have the array contents, now i want to
remove the first 2 characters (fc) of each elem
Shlomi Fish wrote:
Replying to myself, I have a correction which Shawn inspired.
On Wed, 5 Sep 2012 16:49:42 +0300
Shlomi Fish wrote:
On Wed, 5 Sep 2012 14:33:13 +0100
jet speed wrote:
i have an regx question. i have the array contents, now i want to
remove the first 2 characters (fc) of e
Shlomi Fish wrote:
On Wed, 5 Sep 2012 14:33:13 +0100
jet speed wrote:
i have an regx question. i have the array contents, now i want to
remove the first 2 characters (fc) of each element in the array and
store it in a second array ex: @array2
@array ="fc20/1, fc30/22, fc40/3, fc20/1";
outpu
On Sep 5, 2012, at 7:02 AM, Shlomi Fish wrote:
>># remove the first 2 characters from every element of the array
>>my @array2 = map { s/^..//msx } @array1;
>>
>
> This code is wrong in two respects:
>
> 1. the map clause will return the return value of the s/// subtitution and
> will
Replying to myself, I have a correction which Shawn inspired.
On Wed, 5 Sep 2012 16:49:42 +0300
Shlomi Fish wrote:
> Hi Sj,
>
> On Wed, 5 Sep 2012 14:33:13 +0100
> jet speed wrote:
>
> > Hi All,
> >
> > i have an regx question. i have the array contents, now i want to
> > remove the first 2
Hi Shawn,
thanks for your answer. See below for my response.
On Wed, 5 Sep 2012 09:54:11 -0400
Shawn H Corey wrote:
> On Wed, 5 Sep 2012 14:33:13 +0100
> jet speed wrote:
>
> > Hi All,
> >
> > i have an regx question. i have the array contents, now i want to
> > remove the first 2 characters
On Wed, 5 Sep 2012 14:33:13 +0100
jet speed wrote:
> Hi All,
>
> i have an regx question. i have the array contents, now i want to
> remove the first 2 characters (fc) of each element in the array and
> store it in a second array ex: @array2
>
> @array ="fc20/1, fc30/22, fc40/3, fc20/1";
>
> o
Hi Sj,
On Wed, 5 Sep 2012 14:33:13 +0100
jet speed wrote:
> Hi All,
>
> i have an regx question. i have the array contents, now i want to
> remove the first 2 characters (fc) of each element in the array and
> store it in a second array ex: @array2
>
> @array ="fc20/1, fc30/22, fc40/3, fc20/1"
Hi All,
i have an regx question. i have the array contents, now i want to remove
the first 2 characters (fc) of each element in the array and store it in a
second array ex: @array2
@array ="fc20/1, fc30/22, fc40/3, fc20/1";
output
@array2 ="20/1, 30/22, 40/3, 20/1";
please advice.
Thanks
Sj
On 11-09-19 08:56 PM, Rajeev Prasad wrote:
$string="alpha number='42'"
$string=~s/.*\=// ;
$string=~s/\'//g;
to get 42 and not '42'
can these two substitutions be combined?
thank you.
It depends on what you want to extract. To extract a string inside
single quotes after an equal sign:
On 20/09/2011 02:17, Jim Gibson wrote:
On 9/19/11 Mon Sep 19, 2011 5:56 PM, "Rajeev Prasad"
scribbled:
$string="alpha number='42'"
$string=~s/.*\=// ;
$string=~s/\'//g;
to get 42 and not '42'
can these two substitutions be combined?
If you know what you want to extract, then use capturin
On 9/19/11 Mon Sep 19, 2011 5:56 PM, "Rajeev Prasad"
scribbled:
> $string="alpha number='42'"
> $string=~s/.*\=// ;
> $string=~s/\'//g;
>
> to get 42 and not '42'
>
>
> can these two substitutions be combined?
If you know what you want to extract, then use capturing:
if( $string =~ /'(\d+)
On 20/09/2011 01:56, Rajeev Prasad wrote:
$string="alpha number='42'"
$string=~s/.*\=// ;
$string=~s/\'//g;
to get 42 and not '42'
can these two substitutions be combined?
Hi Rajeev
Well they can be combined, and because it is far from obvious what your
code is doing I think it should be r
$string="alpha number='42'"
$string=~s/.*\=// ;
$string=~s/\'//g;
to get 42 and not '42'
can these two substitutions be combined?
thank you.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Beginners
Sent: Friday, August 19, 2011 2:59 AM
Subject: Re: why si this code not working (variable substitution)
Hi,
On Wed, 17 Aug 2011 16:15:18 -0400
"Uri Guttman" wrote:
> >>>>> "RP" == Rajeev Prasad writes:
>
> RP> foreach $line (@arr1){
>
ou do in a program
#!/usr/bin/perl
use strict;
use warnings;
my $expr = shift(@ARGV);
eval $expr;
Then if you allow the user of the program to input arbitrary Perl code inside
$ARGV[0], which will then be executed. So don't abuse string eval this way.
> and also what this 'ge' i
Hi,
On Wed, 17 Aug 2011 16:15:18 -0400
"Uri Guttman" wrote:
> > "RP" == Rajeev Prasad writes:
>
> RP> foreach $line (@arr1){
> RP> foreach (@arr2) {
> RP> chomp($_);
> RP> @arr3 = split(/ /,$_);
> RP> $mystringvar = eval "qq{$line}"; <--this
> RP> su
> "RP" == Rajeev Prasad writes:
RP> foreach $line (@arr1){
RP> foreach (@arr2) {
RP> chomp($_);
RP> @arr3 = split(/ /,$_);
RP> $mystringvar = eval "qq{$line}"; <--this
suggestion came from web search.
and it is a very bad idea. string eval is very dange
b. thx to all coders out there.
From: Shlomi Fish
To: Rajeev Prasad
Cc: Perl Beginners
Sent: Wednesday, August 17, 2011 10:54 AM
Subject: Re: why si this code not working (variable substitution)
Hi Rajeev,
On Tue, 16 Aug 2011 17:38:16 -0700 (PDT)
Rajeev Prasad wrote:
>
>
>
Hi Rajeev,
On Tue, 16 Aug 2011 17:38:16 -0700 (PDT)
Rajeev Prasad wrote:
>
>
> foreach $str1 (@arr1){
> foreach (@arr2) {
> @arr3 = split(/ /,"$_");
> print "array = @arr3 element0 = $arr3[0] element1 = $arr3[1]"; #this
> is just to check, it showing values 0 and 1 as correctly assigne
cc 233 sdf xyz
BUT I am getting:---SUBSTITUTION not happening
comm cc $arr3[0] sdf xyz
comm scdrf cc $arr3[0] sdf xyz
comm dddbb cc $arr3[0] sdf xyz
please help resolve. thx.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail
On 16/03/2011 15:08, Shawn H Corey wrote:
On 11-03-16 11:05 AM, John W. Krahn wrote:
Jim wrote:
$old_ip_address = "1.2.3.4";
$new_ip_address = "5.6.7.8"
$old_ip_address_regexp = $old_ip_address;
$old_ip_address_regexp =~ s/\./\\./ig;
$read_line =~ s/(\D*)$old_ip_address_regexp(\D*)/$1$new_ip_ad
/x does exactly what you think it does; It's "free form" style, where any
non-escaped whitespace is ignored. See perlretut[0], perlop[1], and
perlre[2].
(?http://perldoc.perl.org/perlretut.html
[1] http://perldoc.perl.org/perlop.html#Regexp-Quote-Like-Operators
[2] http://perldoc.perl.org/perlre.h
On 11-03-16 11:05 AM, John W. Krahn wrote:
Jim wrote:
$old_ip_address = "1.2.3.4";
$new_ip_address = "5.6.7.8"
$old_ip_address_regexp = $old_ip_address;
$old_ip_address_regexp =~ s/\./\\./ig;
$read_line =~ s/(\D*)$old_ip_address_regexp(\D*)/$1$new_ip_address$2/ig;
(\D*) won't work because it c
find any fault in it or see if I overlooked something, please? Of
particular concern is if I've considered enough by wrapping my
substitution string within (\D*)
$old_ip_address = "1.2.3.4";
$new_ip_address = "5.6.7.8"
$old_ip_address_regexp = $old_ip_address;
$old_ip_addr
On 11-03-16 10:29 AM, Jim wrote:
$old_ip_address_regexp = $old_ip_address;
$old_ip_address_regexp =~ s/\./\\./ig;
$old_ip_address_regexp = quotemeta( $old_ip_address );
See `perldoc -f quotemeta`.
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of understand
fault in it or see if I overlooked something, please? Of
particular concern is if I've considered enough by wrapping my
substitution string within (\D*)
$old_ip_address = "1.2.3.4";
$new_ip_address = "5.6.7.8"
$old_ip_address_regexp = $old_ip_address;
$old_ip_addr
,
Katya
-Original Message-
From: Richard Green [mailto:gree...@uw.edu]
Sent: Saturday, February 26, 2011 10:07 PM
To: beginners@perl.org
Subject: string substitution command question
Hi Perl users, Quick question, I have a one long string with tab delimited
values separated
d?
>> I have $ to designate the end of the row
>> $gene_id
>
> $gene_id designates $gene_id period.
>
>> > Why are you escaping the quote marks?
>> I thought it would be easier to perform substitution without them
>
> What made you think that?
>
>>
the quote marks?
I thought it would be easier to perform substitution without them
What made you think that?
> Why is there no space after 'gene_id'?
I guess there should be
You can guess as much as you like but Perl Regular Expressions don't
care what you think or
On Sat, Feb 26, 2011 at 12:56 PM, Uri Guttman wrote:
> > "PK" == Parag Kalra writes:
>
> >> why are you doing s/// against $_? by default it does that.
>
> you didn't rectify this one.
>
Oops. Missed that.
>
>
> PK> Sorry. Hope this reply is better and so as the following code:
>
> muc
> What is $gene_id?
> Are you by any chance using '$' at the beginning of your search pattern
> instead of the end?
I have $ to designate the end of the row
$gene_id
>
> Why are you escaping the quote marks?
I thought it would be easier to perform substitution witho
> "PK" == Parag Kalra writes:
>> why are you doing s/// against $_? by default it does that.
you didn't rectify this one.
PK> Sorry. Hope this reply is better and so as the following code:
much better.
PK> use strict;
PK> use warnings;
PK> while(){
PK> $_ =~ s/NM_(\d+
--
Uri Guttman -- u...@stemsystems.com http://www.sysarch.com --
- Perl Code Review , Architecture, Development, Training, Support --
- Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
On Sat, Feb 26, 2011 at 12:34 PM, Uri Guttman wrote:
> > "PK" == Parag Kalra writes:
>
> PK> use strict;
> PK> use warnings;
> PK> while(){
> PK> chomp;
>
> why are you chomping here when you add in the \n later?
>
Agreed and corrected in the example at the bottom.
> PK> if
> "PK" == Parag Kalra writes:
PK> use strict;
PK> use warnings;
PK> while(){
PK> chomp;
why are you chomping here when you add in the \n later?
PK> if ($_ =~ /NM_(\d+)/){
PK> my $found = $1;
PK> $_ =~ s/$found/$found:12345/g;
many issues there. why do
e_id "NM_001033581:12346"; transcript_id "NM_001033581:12346";
Here is the substitution command I am trying to use:
$data_string=~ s/$gene_id\"NM_173083\"\; transcript_id
\"NM_173083\"\;/\"NM_173083:12345\"\; \"NM_173083:12345\"\;/g;
$d
transcript_id "NM_001033581";
> chr1ucscexon2066701 2066786 0.00+ .
> gene_id "NM_001033581"; transcript_id "NM_001033581";
>
> I am trying to perform substitution on some values at the end of each rows,
> for example, I'm trying
3581";
chr1ucscexon2066701 2066786 0.00+ .
gene_id "NM_001033581"; transcript_id "NM_001033581";
I am trying to perform substitution on some values at the end of each rows,
for example, I'm trying to replace the above string
At 2:16 PM -0500 11/14/10, shawn wilson wrote:
so, if you've got a file, do something like:
while ($line = ) {
$line =~ m/^(.+)$/ig;
print "$1<\/s>\n";
}
If all you want to do is print each line in the file surrounded by
tags, you don't need regular expressions, and you don't need to
esca
On 14/11/2010 19:04, Zachary Brooks wrote:
What happened when I used the code --
$hello =~ s/^(.+)$/\1<\/s>/gis;
-- is that is properly marked and the beginning of the sentence and
at the end of the sentence, but then it only worked for one sentence.
Any suggestions on getting to appear at t
so, if you've got a file, do something like:
while ($line = ) {
$line =~ m/^(.+)$/ig;
print "$1<\/s>\n";
}
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman wrote:
> > "sw" == shawn wilson writes:
>
> sw> second, why not use a place holder like someone recommended yesterday?
> sw> somethin
On 14/11/2010 13:53, Zachary Brooks wrote:
Hey Rob,
Of all the feedback. yours was the one I was able to drop into my code
and make it work, no matter how rudimentary my understanding of Perl is.
Thanks.
You're welcome. I'm glad to be able to help.
As far as the XML libraries, we are suppose
What happened when I used the code --
$hello =~ s/^(.+)$/\1<\/s>/gis;
-- is that is properly marked and the beginning of the sentence and
at the end of the sentence, but then it only worked for one sentence.
Any suggestions on getting to appear at the beginning of every sentence
and to appea
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman wrote:
> > "sw" == shawn wilson writes:
>
> sw> second, why not use a place holder like someone recommended yesterday?
> sw> something like:
> sw> s/^(.+)$/\1<\/s>/g
>
> what is a placeholder? nothing like that in regexes. what you have there
>
> "sw" == shawn wilson writes:
sw> second, why not use a place holder like someone recommended yesterday?
sw> something like:
sw> s/^(.+)$/\1<\/s>/g
what is a placeholder? nothing like that in regexes. what you have there
is a backreference and used in the wrong place. \1 is meant to b
On 10-11-14 11:42 AM, Zachary Brooks wrote:
$hello = "This is some sample text.";
$hello =~ s/^..//gi;
$hello =~ s/..$/<\/s>/gi;
print "$hello\n";
*is is some sample tex*
The meta-character '.' matches every character except a newline. The
first subs
On Sun, Nov 14, 2010 at 11:42 AM, Zachary Brooks
wrote:
> Hello again,
>
> Yesterday I had a question on pattern matching. A couple of people
> responded
> with very useful information. After some finagling, I got my rudimentary
> code to work. I'm a PhD student studying computational linguistics
Hello again,
Yesterday I had a question on pattern matching. A couple of people responded
with very useful information. After some finagling, I got my rudimentary
code to work. I'm a PhD student studying computational linguistics without
any formal programming training. While there are various mod
ello =~ s/.*<\/DATELINE>//gi;
print "$hello\n";
This works until the code comes across a quotation mark ("). So then I
replace double quotation marks (") with single quotation marks ('). But then
as, I put more text under $hello, the code seems to break. For example,
I've had similar issues and the \Q \E flags didn't fix it.
One thing I've done to fix an issue where regex metacharacters are being
caught is to do a replace on all of the characters to include a \ right in
front.
Something like this:
open (my $FILE, "<", $file) or die "$!\n";
my @lines = <$FILE
On 10-11-13 01:42 PM, Zachary Brooks wrote:
1. My first approach was to use substitute to get rid of a range of things
between and. A short version looks like this.
$hello = " man at the bar order the";
$hello =~ s/.*<\/DATELINE>//gi;
print "$hello\n";
I was about to say that you should use
uot;$hello\n";
This works until the code comes across a quotation mark ("). So then I
replace double quotation marks (") with single quotation marks ('). But then
as, I put more text under $hello, the code seems to break. For example,
running the substitution against the code b
On Mon, Jun 28, 2010 at 19:48, John W. Krahn wrote:
snip
> s/\((\d+)\)/($1)/g;
snip
Since Perl 5.8.0, \d does not mean [0-9], it means any character that
is classified as a digit in Unicode. In Perl 5.12.1, there are five
hundred seventy-seven characters that will match \d. If it is your
intent
On 2010.06.28 20:39, jimston...@aol.com wrote:
>
> In a message dated 6/28/2010 7:49:47 P.M. Eastern Daylight Time,
> jwkr...@shaw.ca writes:
>
> jimston...@aol.com wrote:
>>
>> can anyone give me some help on a perl program to change a file of mine.
>> The string is:
>>
>> $_ = "from ''ala
In a message dated 6/28/2010 7:49:47 P.M. Eastern Daylight Time,
jwkr...@shaw.ca writes:
jimston...@aol.com wrote:
>
> can anyone give me some help on a perl program to change a file of mine.
> The string is:
>
> $_ = "from ''alam' (481) or possibly (in the sense of dumbness);
> solitary;
jimston...@aol.com wrote:
can anyone give me some help on a perl program to change a file of mine.
The string is:
$_ = "from ''alam' (481) or possibly (in the sense of dumbness);
solitary; Ulam, the (6155) name of two Soldiers;--Ulam."
Where each line is $_
I'm trying to substitute a hyperli
jimston...@aol.com wrote:
can anyone give me some help on a perl program to change a file of mine.
The string is:
$_ = "from ''alam' (481) or possibly (in the sense of dumbness);
solitary; Ulam, the (6155) name of two Soldiers;--Ulam."
Where each line is $_
I'm trying to substitute a hyperli
same thing with each line in a file. Should I use a substitution?
Can anyone show me some code to accomplish this. Thanks.
On May 5, 7:02 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> On Fri, Apr 30, 2010 at 10:40 PM, C.DeRykus wrote:
> > On Apr 30, 3:55 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> > > Hello everybody,
>
> > > Can we perform substitution to the ma
On May 5, 7:02 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> On Fri, Apr 30, 2010 at 10:40 PM, C.DeRykus wrote:
> > On Apr 30, 3:55 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> > > Hello everybody,
>
> > > Can we perform substitution to the ma
On Fri, Apr 30, 2010 at 10:40 PM, C.DeRykus wrote:
> On Apr 30, 3:55 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> > Hello everybody,
> >
> > Can we perform substitution to the matched pattern inside a regular
> > expression so that the modified pattern gets
On Apr 30, 3:55 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> Hello everybody,
>
> Can we perform substitution to the matched pattern inside a regular
> expression so that the modified pattern gets returned instead of earlier
> matched one ?
>
> As a reference, in the fo
Hello everybody,
Can we perform substitution to the matched pattern inside a regular
expression so that the modified pattern gets returned instead of earlier
matched one ?
As a reference, in the following code below, I want to perform the
substitution of "~" character with "_&qu
On Thu, Apr 1, 2010 at 5:58 PM, Shawn H Corey wrote:
> jet speed wrote:
>
>> Hi Chaps,
>>
>> I need bit more help with this, i slightly modified the code based on the
>> inputs, still having the same issue of $_ substitution.
>&g
jet speed wrote:
Hi Chaps,
I need bit more help with this, i slightly modified the code based on the
inputs, still having the same issue of $_ substitution.
Appreciate your help with this.
##
#!/usr/bin/perl
use strict;
use warnings;
my $base
e or directory
#
Cheers
Js
On Thu, Apr 1, 2010 at 5:24 PM, jet speed wrote:
> Hi Chaps,
>
> I need bit more help with this, i slightly modified the code based on the
> inputs, still having the same issue of $_ substitutio
Hi Chaps,
I need bit more help with this, i slightly modified the code based on the
inputs, still having the same issue of $_ substitution.
Appreciate your help with this.
##
#!/usr/bin/perl
use strict;
use warnings;
my $base = "/usr/
Hi Sarath,
I'm CCing to the list.
On Monday 29 Mar 2010 08:55:55 KKde wrote:
> HI Shlomi,
>
> > system("/usr/bin/find \"$_\" -mtime 3 -print -exec ls '{}' \;");
>
> I got confused. Can you plz explain me why $_ is surrounded by another
> double quotes? Why it isn't interpolated in the outer dou
Many Thanks Simon, John and everyone else for pointing me to the correct
direction. Cheeers !!
Js
On Fri, Mar 26, 2010 at 7:03 PM, Shlomi Fish wrote:
> On Friday 26 Mar 2010 20:51:17 John W. Krahn wrote:
> > jet speed wrote:
> > > Hi,
> >
> > Hello,
> >
> > > I have a simple code below,
> > >
>
On Saturday 27 Mar 2010 06:59:10 chintan sheth wrote:
> Hi ,
> use system "(/usr/bin/find \"$_\" -type f -mtime 3 -print -exec ls '{}'
> \;)";
>
No! That's wrong!
This is your second reply of this trend. Are you some kind of spammer or
troll?
Regards,
Shlomi Fish
--
Hi ,
use system "(/usr/bin/find \"$_\" -type f -mtime 3 -print -exec ls '{}'
\;)";
Thanks ,
Chintan
On 3/26/10, Shlomi Fish wrote:
>
> On Friday 26 Mar 2010 20:51:17 John W. Krahn wrote:
> > jet speed wrote:
> > > Hi,
> >
> > Hello,
> >
> > > I have a simple code below,
> > >
> > > #
On Friday 26 Mar 2010 20:51:17 John W. Krahn wrote:
> jet speed wrote:
> > Hi,
>
> Hello,
>
> > I have a simple code below,
> >
> > ###
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > my @list =( '/usr/data/logs' , '/usr/data1/logs');
> > forea
John W. Krahn wrote:
jet speed wrote:
I have a simple code below,
###
#!/usr/bin/perl
use strict;
use warnings;
my @list =( '/usr/data/logs' , '/usr/data1/logs');
foreach (@list)
{
print "$_ \n";
system "(/usr/bin/find "$_" -mtime 3 -print -exec ls '{}' \;)";
Hi jet speed,
On Friday 26 Mar 2010 19:17:46 jet speed wrote:
> Hi,
> I have a simple code below,
>
> ###
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @list =( '/usr/data/logs' , '/usr/data1/logs');
> foreach (@list)
> {
> print "$_ \n";
>
> system "
jet speed wrote:
Hi,
Hello,
I have a simple code below,
###
#!/usr/bin/perl
use strict;
use warnings;
my @list =( '/usr/data/logs' , '/usr/data1/logs');
foreach (@list)
{
print "$_ \n";
system "(/usr/bin/find "$_" -mtime 3 -print -exec ls '{}' \;)";
}
#
Hi,
I have a simple code below,
###
#!/usr/bin/perl
use strict;
use warnings;
my @list =( '/usr/data/logs' , '/usr/data1/logs');
foreach (@list)
{
print "$_ \n";
system "(/usr/bin/find "$_" -mtime 3 -print -exec ls '{}' \;)";
}
###
> "sk" == suresh kumar writes:
sk> I got your problem.
sk> Pass the parameters like below,
sk> &replace_txt('\$a', '$b');
sk> It will work fine.
did you test that? it has the same problem as the original code. your
other post had better answers. please refrain from answering here un
1 - 100 of 512 matches
Mail list logo