Re: $_ substitution Question

2010-04-02 Thread jet speed
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. >> >> ###

Re: $_ substitution Question

2010-04-01 Thread Shawn H Corey
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

Re: $_ substitution Question

2010-04-01 Thread jet speed
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

Re: $_ substitution Question

2010-04-01 Thread jet speed
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

Re: $_ substitution Question

2010-03-30 Thread Shlomi Fish
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

Re: $_ substitution Question

2010-03-29 Thread jet speed
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, > > > >

Re: $_ substitution Question

2010-03-27 Thread Shlomi Fish
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 --

Re: $_ substitution Question

2010-03-26 Thread chintan sheth
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, > > > > > > #

Re: $_ substitution Question

2010-03-26 Thread Shlomi Fish
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

Re: $_ substitution Question

2010-03-26 Thread John W. Krahn
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 '{}' \;)";

Re: $_ substitution Question

2010-03-26 Thread Shlomi Fish
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 "

Re: $_ substitution Question

2010-03-26 Thread John W. Krahn
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 '{}' \;)"; } #

Re: Substitution question

2009-07-01 Thread John W. Krahn
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

Re: Substitution question

2009-07-01 Thread Gurunandan R. Bhat
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

RE: Substitution question

2009-06-30 Thread sanket vaidya
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

Re: Substitution question

2009-06-30 Thread John W. Krahn
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

Re: Substitution question

2009-06-30 Thread Gurunandan R. Bhat
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