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 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.
>>
>> Appreciate your help with this.
>>
>> ###
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
Hi All,
Further to my previous email, if i add the fulll path of each directory the,
$_ Sustitution works with below code
#!/usr/bin/perl
use strict;
use warnings;
my @list = ( '/usr/openv/netbackup/logs/bpcd' ,
'/usr/openv/netbackup/logs/bprd' , '/usr/openv/netbackup/logs/admin' ,
'/usr/openv
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/openv/netba
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 '{}' \;)";
}
###
Gurunandan R. Bhat wrote:
On Tue, 2009-06-30 at 22:47 -0700, John W. Krahn wrote:
That should be:
$current_path =~ s|/|\\|g;
Oh!! Did not know you could use '|' as a pattern delimiter.
Yes. You can use just about any character.
John
--
Those people who think they know everything ar
On Tue, 2009-06-30 at 22:47 -0700, John W. Krahn wrote:
> That should be:
>
> $current_path =~ s|/|\\|g;
Oh!! Did not know you could use '|' as a pattern delimiter.
Regards
Thanks John. It works
Regards,
Sanket Vaidya
-Original Message-
From: John W. Krahn [mailto:jwkr...@shaw.ca]
Sent: Wednesday, July 01, 2009 11:17 AM
To: Perl Beginners
Subject: Re: Substitution question
sanket vaidya wrote:
> Hi all,
Hello,
> As a part of one program I need
sanket vaidya wrote:
Hi all,
Hello,
As a part of one program I need to get the current working directory. So I
get this using cwd(). I want to replace forward slash (/) by backslash (\)
in the path which I get because I work on windows.
You shouldn't need to do that.
Kindly look at the co
Are you sure that your substitution works?
With the pattern you have quoted, you should be getting a "Search
pattern not terminated" error.
To answer your other question, patterns to search must be enclosed
inside '/'s (forward slashes).
You can change pattern delimiters then you must precede th
Hi all,
As a part of one program I need to get the current working directory. So I
get this using cwd(). I want to replace forward slash (/) by backslash (\)
in the path which I get because I work on windows.
Kindly look at the code below:
use warnings;
use strict;
use Cwd;
my $cu
John W. Krahn wrote:
> Mathew Snyder wrote:
>> A script I've been working on will provide time spent on a work ticket in
>> H:MM
>> format. However, if the MM section is less than 10 it only shows as H:M so I
>> need to append a 0 to it. So, for instance, if the output looks like this
>> 9:7 I
Mathew Snyder wrote:
> A script I've been working on will provide time spent on a work ticket in H:MM
> format. However, if the MM section is less than 10 it only shows as H:M so I
> need to append a 0 to it. So, for instance, if the output looks like this
> 9:7 I
> need to append the 0 to the 7
A script I've been working on will provide time spent on a work ticket in H:MM
format. However, if the MM section is less than 10 it only shows as H:M so I
need to append a 0 to it. So, for instance, if the output looks like this 9:7 I
need to append the 0 to the 7 making it 9:07.
The output is
=~ is the bind operator.
see perldoc perlop.
Manav
-Original Message-
From: Harold Castro [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 12:17 PM
To: beginners@perl.org
Subject: simple substitution question
Hi,
There is something that's bothering me for so
Harold Castro [HC], on Thursday, February 17, 2005 at 22:47 (-0800
(PST)) typed:
HC> for example:
HC> here is my string:
HC> $_ = "but";
HC> s/u/a/g;
HC> print $_;
what about this:
( my $string = "but" ) =~ s/u/a/g;
--
...m8s, cu l8r, Brano.
[Old Farts don't have to be politically correct.]
old Castro [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 12:17 PM
To: beginners@perl.org
Subject: simple substitution question
Hi,
There is something that's bothering me for so long
regarding the use of $_ variable.
for example:
here is my string:
$_ = "but";
s/
Hi,
There is something that's bothering me for so long
regarding the use of $_ variable.
for example:
here is my string:
$_ = "but";
s/u/a/g;
print $_;
This will simply print "bat"
My problem is using a variable in place of $_.
how will I tell that the one i'm going to substitute
is the $strin
x27; '
Sent: 11/15/2001 12:05 PM
Subject: RE: Regulare Expressions/ Substitution Question
> -Original Message-
> From: Gibbs Tanton - tgibbs [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 12:08 PM
> To: 'Miretsky, Anya '; ''[EMAIL PROTECTE
> -Original Message-
> From: Miretsky, Anya [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 11:57 AM
> To: 'Bob Showalter'
> Subject: RE: Regulare Expressions/ Substitution Question
>
>
> I don't understand why but if I write the sub
> -Original Message-
> From: Gibbs Tanton - tgibbs [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 12:08 PM
> To: 'Miretsky, Anya '; ''[EMAIL PROTECTED]' '
> Subject: RE: Regulare Expressions/ Substitution Question
>
>
PROTECTED]'
Sent: 11/15/2001 10:37 AM
Subject: Regulare Expressions/ Substitution Question
I am trying to replace all occurences of the word St with St. without
generating St.. in the incorrect substitutions of St.
The code I have been playing with is something like:
$item = "35 Main
--On Donnerstag, 15. November 2001 11:37 -0500 "Miretsky, Anya"
<[EMAIL PROTECTED]> wrote:
> I am trying to replace all occurences of the word St with St. without
> generating St.. in the incorrect substitutions of St.
>
> The code I have been playing with is something like:
>
> $item = "35 Main
> -Original Message-
> From: Miretsky, Anya [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 11:37 AM
> To: '[EMAIL PROTECTED]'
> Subject: Regulare Expressions/ Substitution Question
>
>
> I am trying to replace all occurences of the wor
I am trying to replace all occurences of the word St with St. without
generating St.. in the incorrect substitutions of St.
The code I have been playing with is something like:
$item = "35 Main St." (it could also be "35 Main St" in which case I want
the substitution to happen)
$varS = "st";
$
42 matches
Mail list logo