Re: How to can develop a program that search in different document in the network the name of a person?

2022-07-20 Thread William Torrez Corea
The url of the page: https://www.pgr.gob.ni/PDF/2021/GACETA/GACETA_17_08_2021.pdf On 7/20/22, William Torrez Corea wrote: > Exist a page where you put info about the person but if you want to search > a name you must search this manually. So, I want to automate this process >

How to can develop a program that search in different document in the network the name of a person?

2022-07-20 Thread William Torrez Corea
Exist a page where you put info about the person but if you want to search a name you must search this manually. So, I want to automate this process with perl. -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄

Re: search and replace

2016-06-29 Thread John SJ Anderson
> On Jun 29, 2016, at 09:20, Uri Guttman wrote: > > since you are correct about modules being already there, why do you write > your own versions of > slurp_file and write_file? the module File::Slurp has those functions which > are stable, fast and debugged. Please don’t use File::Slurp. Se

Re: search and replace

2016-06-29 Thread Eric de Hont
Op 29-06-16 om 19:26 schreef Uri Guttman: On 06/29/2016 01:17 PM, Eric de Hont wrote: Op 29-06-16 om 18:20 schreef Uri Guttman: since you are correct about modules being already there, why do you write your own versions of slurp_file and write_file? the module File::Slurp has those functions w

Re: search and replace

2016-06-29 Thread Uri Guttman
On 06/29/2016 01:17 PM, Eric de Hont wrote: Op 29-06-16 om 18:20 schreef Uri Guttman: On 06/29/2016 06:03 AM, Eric de Hont wrote: sub slurp_file { my $file = shift; local $/; open my $fh, '<', $file or die "Can't open $_: $!\n"; $_ is not set anywhere. you likely meant to use $f

Re: search and replace

2016-06-29 Thread Eric de Hont
Op 29-06-16 om 18:20 schreef Uri Guttman: On 06/29/2016 06:03 AM, Eric de Hont wrote: sub slurp_file { my $file = shift; local $/; open my $fh, '<', $file or die "Can't open $_: $!\n"; $_ is not set anywhere. you likely meant to use $file O, dear. Just a bit too quick and dirty.

Re: search and replace

2016-06-29 Thread Uri Guttman
On 06/29/2016 06:03 AM, Eric de Hont wrote: Op 29-06-16 om 06:35 schreef Danny Wong: Hi Perl GURUs, I have a json file that needs parsing. Here is a typical string I’m searching for. I want to delete everything but the last 2 character “],”. ], [ "ansible",

Re: search and replace

2016-06-29 Thread Danny Wong
ers@perl.org>> Subject: Re: search and replace Op 29-06-16 om 06:35 schreef Danny Wong: Hi Perl GURUs, I have a json file that needs parsing. Here is a typical string I’m searching for. I want to delete everything but the last 2 character “],”. ], [ "a

Re: search and replace

2016-06-29 Thread Eric de Hont
Op 29-06-16 om 06:35 schreef Danny Wong: Hi Perl GURUs, I have a json file that needs parsing. Here is a typical string I’m searching for. I want to delete everything but the last 2 character “],”. ], [ "ansible", "2.1.0.0-1ppa~trusty", false ], Here is wh

Re: search and replace

2016-06-29 Thread Shlomi Fish
Hi Danny, Please reply to all recipients. See below for my reply. On Wed, 29 Jun 2016 04:35:22 + Danny Wong wrote: > Hi Perl GURUs, > I have a json file that needs parsing. > Why not use a JSON parser? See http://perl-begin.org/uses/text-parsing/ . > Here is a typical string I’m searchin

search and replace

2016-06-28 Thread Danny Wong
Hi Perl GURUs, I have a json file that needs parsing. Here is a typical string I’m searching for. I want to delete everything but the last 2 character “],”. ], [ "ansible", "2.1.0.0-1ppa~trusty", false ], Here is what I tried: I slu

Re: Internet Search

2014-03-18 Thread Lars Noodén
On 03/18/2014 12:39 PM, Anant kumar wrote: > Dear Lars Nooden, > >I am finding difficulty in > installing the Program. Can you please take a look and advice me the > solution. > > > > Sincerely yours, > Anant Kumar > B.Tech; Biotechnology >From the error

Re: Internet Search

2014-03-15 Thread Anant kumar
Dear Lars Nooden, Thanks a lot. I will write the program and let you know how it works. Sincerely yours, Anant Kumar B.Tech; Biotechnology

Re: Internet Search

2014-03-15 Thread Lars Noodén
On 03/15/2014 07:43 AM, Anant kumar wrote: > Hi Jim Gibson, > I want to write a search engine of my own. > Similar to Google but not as complex as that. Just for simple data mining > for my research work. > > Sincerely yours, > Anant Kumar &g

Re: Internet Search

2014-03-14 Thread Anant kumar
Hi Jim Gibson, I want to write a search engine of my own. Similar to Google but not as complex as that. Just for simple data mining for my research work. Sincerely yours, Anant Kumar B.Tech; Biotechnology On Fri, Mar 14, 2014 at 8:41 PM, Jim Gibson wrote

Internet Search

2014-03-14 Thread Jim Gibson
On Mar 14, 2014, at 5:28 AM, Anant kumar wrote: > Hi everyone, > I am trying to write a script to search on the > internet for different keywords (like Organism name, metabolic reactions and > Genes involved). Can anyone suggest me how to proceed. I d

Re: Search one character against one string

2014-03-13 Thread Uri Guttman
On 03/12/2014 05:14 AM, Alex Chiang wrote: Thanks for your reply. I know the built-in index function, but I just can't figure out why it gives me the answer I don't expect :D you shouldn't expect some answer without checking the documentation. index is well documented so you must be looking

Re: Search one character against one string

2014-03-13 Thread Alex Chiang
Thanks for your reply. I know the built-in index function, but I just can't figure out why it gives me the answer I don't expect :D --- Regards ! Alex Chiang

Re: Search one character against one string

2014-03-13 Thread Alex Chiang
Thanks all, and thanks Nathan for your detailed explanation. Now I know the list got flattened before passing into subroutine. Cheers. --- Regards ! Alex Chiang

Re: Search one character against one string

2014-03-12 Thread Nathan Hilterbrand
2 { my $char = shift; # Now the values to be search are in @_ foreach my $val (@_) { # note that we are searching @_ return 1 if $char eq $val; } return -1; } my @test_array = qw{ a b c d e f g}; print "Character 'z' is in the array\n"

Re: Search one character against one string

2014-03-12 Thread Jing Yu
r, $c); > 47 print $res; > > I would expect the result to be 1, but whenever the $c changes, this > subroutine always return -1. > Can anyone help me out of this? > > Btw, is there any way to search one character against sliced string? I can > only think of one way as

Re: Search one character against one string

2014-03-12 Thread Robert Wohlfarth
On Tue, Mar 11, 2014 at 11:58 PM, Alex Chiang wrote: > sub is_in_string { > 38 # @s: string array, $c: character > 39 # passing array into sub > 40 my @s = @_[0]; my $c = $_[1]; > 44 my @ar = qw(t d s); > 45 my $c = "d"; > 46 my $res = &is_in_string( @ar, $c); This is a good example of how

Re: Search one character against one string

2014-03-12 Thread Bob goolsby
for my $i (@s) { if ($c eq $i) {return 1} } > 42 return -1; > 43 } > 44 my @ar = qw(t d s); > 45 my $c = "d"; > 46 my $res = &is_in_string( @ar, $c); > 47 print $res; > > I would expect the result to be 1, but whenever the $c changes, this > subroutine always re

Search one character against one string

2014-03-12 Thread Alex Chiang
his? Btw, is there any way to search one character against sliced string? I can only think of one way as following: 1. convert string to array with "split" function 2. search one character against sliced array e.g. array[2..$#array] However, if I want to do the above task multipl

Re: Search and replace trouble with a variable

2014-02-01 Thread Shlomi Fish
Hi Omega, On Sat, 1 Feb 2014 11:36:20 -0500 Omega -1911 <1911...@gmail.com> wrote: > Good advice Shlomi. Thank you again. I should have caught that with fresh > eyes! You're welcome! ☺ Regards, Shlomi Fish -- - Shlomi Fis

Re: Search and replace trouble with a variable

2014-02-01 Thread Omega -1911
On Sat, Feb 1, 2014 at 4:57 AM, Shlomi Fish wrote: > Hi Omega, > > On Sat, 1 Feb 2014 03:40:01 -0500 > Omega -1911 <1911...@gmail.com> wrote: > > > Hello List: I am trying to go through a folder of php scripts to add a > > database prefix to lines that have a select statement. Since the database

Re: Search and replace trouble with a variable

2014-02-01 Thread Shlomi Fish
Hi Omega, On Sat, 1 Feb 2014 03:40:01 -0500 Omega -1911 <1911...@gmail.com> wrote: > Hello List: I am trying to go through a folder of php scripts to add a > database prefix to lines that have a select statement. Since the database > prefix will differ, I am simply trying to add: > > ".$database

Re: Search and replace trouble with a variable

2014-02-01 Thread Hal Wigoda
What error? (Sent from iPhone, so please accept my apologies in advance for any spelling or grammatical errors.) > On Feb 1, 2014, at 2:40 AM, Omega -1911 <1911...@gmail.com> wrote: > > Hello List: I am trying to go through a folder of php scripts to add a > database prefix to lines that have

Search and replace trouble with a variable

2014-02-01 Thread Omega -1911
Hello List: I am trying to go through a folder of php scripts to add a database prefix to lines that have a select statement. Since the database prefix will differ, I am simply trying to add: ".$database_prefix." to those lines. For example, instead of the line looking like: $sql = "SELECT * FROM

Re: help on file search

2013-11-10 Thread Shlomi Fish
Hi all, On Sun, 10 Nov 2013 19:14:22 -0500 Shawn Wilson wrote: > File::Find also see find2perl > File::Find is OK for that and is a core module, but it has some severe philosophical design limitations, and has a user-hostile interface. Here are some alternatives: http://perl-begin.org/topics

Re: help on file search

2013-11-10 Thread Shawn Wilson
File::Find also see find2perl Rahim Fakir wrote: >Iam looking for a module or a script that when running the script.pl, I >have to write the name of a file and it searches in my C: drive. >Best regards >Ray > > > > > >-- >*Nome: Rahim Gulamo Nabi Mussa Fakir* > > > > > > > > > >*Morada:Rua Gilb

help on file search

2013-11-10 Thread Rahim Fakir
Iam looking for a module or a script that when running the script.pl, I have to write the name of a file and it searches in my C: drive. Best regards Ray -- *Nome: Rahim Gulamo Nabi Mussa Fakir* *Morada:Rua Gilberto Freyre Lote 748 1º Esquerdo1950-357 Marvila-LisboaPortugalTelefone:

filter for a search on ldap

2013-01-25 Thread samuel desseaux
or die "Failed to create new Net::LDAP::Filter"; my $search = $db->search( base => $base, filter => $filter, # attrs => ['*'], ) or die "LDAP search failed to return object."; my $count = $

Re: search and replace

2012-08-18 Thread timothy adigun
Hi Irfan Sayed, Please check my comments below. On 8/18/12, Irfan Sayed wrote: > hi, > > i have string like this : > $a = '$(workspace)\convergence\trunk'; > > i need to replace $(workspace) with 'c:\p4\abc' > i wrote regex like this : > > $a =~ s/$\(workspace)/c:\\p4\\abc/; > however, the stri

Re: search and replace

2012-08-17 Thread Irfan Sayed
thanks a lot regards irfan From: Shawn H Corey To: beginners@perl.org Cc: Irfan Sayed Sent: Saturday, August 18, 2012 6:50 AM Subject: Re: search and replace On Fri, 17 Aug 2012 18:02:23 -0700 (PDT) Irfan Sayed wrote: > i have string like this : &

Re: search and replace

2012-08-17 Thread Shawn H Corey
easy way is to quote it: $a =~ s/\Q$(workspace)\E/c:\\p4\\abc/; or you could insert the escapes by hand: $a =~ s/\$\(workspace\)/c:\\p4\\abc/; And to make it more readable, use the /x switch to allow whitespace: my $base_dir = 'c:\p4\abc'; $a =~ s{ \$ \( workspace \)

search and replace

2012-08-17 Thread Irfan Sayed
hi, i have string like this : $a = '$(workspace)\convergence\trunk'; i need to replace $(workspace) with 'c:\p4\abc' i wrote regex like this : $a =~ s/$\(workspace)/c:\\p4\\abc/; however, the string which i am getting is : $(c:\p4\abc)\convergence\trunk i need output like this : c:\p4\abc\conv

Re: search and replace

2012-08-16 Thread Shawn H Corey
. The bell or alarm character is "\a". You can this in the output. It prints 'C:', then backs up one character and prints 'uild.txt', giving the result: Cuild.txt For details, see `perldoc perlop` and search for /Quote and Quote-like Operators/. On Thu, 16 Aug 2012

Re: search and replace

2012-08-16 Thread Irfan Sayed
Awesome thanks all for reply . got it regards irfan From: midhun To: Rob Coops Cc: Gergely Buday ; Irfan Sayed ; "beginners@perl.org" Sent: Thursday, August 16, 2012 2:41 PM Subject: Re: search and replace The issue is $cs_project = &qu

Re: search and replace

2012-08-16 Thread midhun
_text\n"; > > > > Notice that in order to put a literal backslash into a perl string, > > you should escape it. In your original program, you have put a \b, a > > bell character into the string. > > > > - Gergely > > > > On 16 August 2012 10:48, I

Re: search and replace

2012-08-16 Thread Rob Coops
ckslash into a perl string, > you should escape it. In your original program, you have put a \b, a > bell character into the string. > > - Gergely > > On 16 August 2012 10:48, Irfan Sayed wrote: > > hi, > > > > i have following code to search single "

Re: search and replace

2012-08-16 Thread Gergely Buday
l character into the string. - Gergely On 16 August 2012 10:48, Irfan Sayed wrote: > hi, > > i have following code to search single "\" and replace it with "\\" > but it is not doing as expected: > > $csproj_text = "C:\build.txt"; > > $csproj_tex

search and replace

2012-08-16 Thread Irfan Sayed
hi, i have following code to search single "\" and replace it with "\\" but it is not doing as expected: $csproj_text = "C:\build.txt"; $csproj_text =~ s/\\//g; print "$csproj_text\n"; the output is : "Cuild.txt" instead the output shou

Re: search scalers of an array in another file

2012-06-21 Thread John W. Krahn
Wang, Li wrote: Dear list members Hello, I am a very beginner of perl programming. Welcome to the Perl beginners mailing list. I am trying to write a script to search all scalers of one array (geneIDFile) in another file (annotationFile). If it is found and matched, output the whole

Re: search scalers of an array in another file

2012-06-21 Thread Jim Gibson
On Jun 21, 2012, at 4:47 PM, Wang, Li wrote: > Dear list members > > I am a very beginner of perl programming. > I am trying to write a script to search all scalers of one array (geneIDFile) > in another file (annotationFile). If it is found and matched, output the >

search scalers of an array in another file

2012-06-21 Thread Wang, Li
Dear list members I am a very beginner of perl programming. I am trying to write a script to search all scalers of one array (geneIDFile) in another file (annotationFile). If it is found and matched, output the whole line of the annotation file. My script is as follows. It turns out not

Re: search and replace with an array

2012-02-21 Thread Shawn H Corey
On 12-02-21 11:37 AM, Adams Paul wrote: Sent from my LG phone Is this is what is called a bum dial? -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. It's Mutual Aid, not fierce competition, that's the dom

Re: search and replace with an array

2012-02-21 Thread Adams Paul
Sent from my LG phone "John W. Krahn" wrote: >Chris Stinemetz wrote: >> I am trying ot find a way to use an array as a reference to remove >> lines from a file. >> The array @keyFields has the elements "rcsm and cdmno". My objective >> is to remove any line from the input that matches the regex

Re: search and replace with an array

2012-02-20 Thread Chris Stinemetz
Thank you everyone that replied. Your suggestions helped me with finding a solution. Take care, Chris -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: search and replace with an array

2012-02-20 Thread John W. Krahn
Chris Stinemetz wrote: I am trying ot find a way to use an array as a reference to remove lines from a file. The array @keyFields has the elements "rcsm and cdmno". My objective is to remove any line from the input that matches the regex /rcsm\d/ and cdmno\d/. AND means matching BOTH in the sam

RE: search and replace with an array

2012-02-20 Thread Ken Slater
> -Original Message- > From: Chris Stinemetz [mailto:chrisstinem...@gmail.com] > Sent: Monday, February 20, 2012 3:51 PM > To: beginners@perl.org > Subject: Re: search and replace with an array > > Looks like I was able to figure it out with the below: > >

RE: search and replace with an array

2012-02-20 Thread Wagner, David --- Sr Programmer Analyst --- CFS
>-Original Message- >From: Chris Stinemetz [mailto:chrisstinem...@gmail.com] >Sent: Monday, February 20, 2012 13:51 >To: beginners@perl.org >Subject: Re: search and replace with an array > >Looks like I was able to figure it out with the below: > >But how do I

Re: search and replace with an array

2012-02-20 Thread Chris Stinemetz
Looks like I was able to figure it out with the below: But how do I remove all the blank lines? Output: cdmno=1 rdnt_cdmno=1 cdmno=2 rcsm=801 rcsm=801 rcsm=802 #!/usr/bin/perl use warnings; use strict; my $file = "nonKeys.txt"; my $newFile = "cleanKeys.txt"; my @keyFields

search and replace with an array

2012-02-20 Thread Chris Stinemetz
I am trying ot find a way to use an array as a reference to remove lines from a file. The array @keyFields has the elements "rcsm and cdmno". My objective is to remove any line from the input that matches the regex /rcsm\d/ and cdmno\d/. I'm not sure if I'm using the best approach. I am getting t

Re: Help in search concept

2011-12-20 Thread Brandon McCaig
Hey Uri: On Tue, Dec 20, 2011 at 11:06:05AM -0500, Uri Guttman wrote: > that escape isn't needed. inside a char class . means just . > > other things change too like \b means backspace in [] but a word > boundary outside. you have to think of the stuff inside [] to be a > different minilanguage t

RE: Help in search concept

2011-12-20 Thread Ken Slater
> -Original Message- > From: Chris Stinemetz [mailto:chrisstinem...@gmail.com] > Sent: Tuesday, December 20, 2011 9:22 AM > To: Saravanan Murugaiah > Cc: beginners@perl.org > Subject: Re: Help in search concept > > > > > I am a learner in Perl and this

Re: Help in search concept

2011-12-20 Thread Uri Guttman
On 12/20/2011 10:49 AM, Brandon McCaig wrote: Hello: On Tue, Dec 20, 2011 at 08:03:56PM +0530, Saravanan Murugaiah wrote: Many thanks for all your kind suggestions on my request. I solved my issues with the command "Test [0-9.]+". Careful there: /./ matches any one character. [0-9.]+ will lik

Re: Help in search concept

2011-12-20 Thread Brandon McCaig
Hello: On Tue, Dec 20, 2011 at 08:03:56PM +0530, Saravanan Murugaiah wrote: > Many thanks for all your kind suggestions on my request. I solved my issues > with the command "Test [0-9.]+". Careful there: /./ matches any one character. [0-9.]+ will likely end up matching any string containing 'Tes

Re: Help in search concept

2011-12-20 Thread Saravanan Murugaiah
> > > I am a learner in Perl and this is my first post in this group. I need to > > search a word "Test 1.2.1" in my file. I am using "$_ =~m/Test \d+", but > it > > searched only "Test 1" not the full content. I need to check whether it >

Re: Help in search concept

2011-12-20 Thread Dermot
On 20 December 2011 13:45, Saravanan Murugaiah wrote: > Dear All, Hello > I am a learner in Perl and this is my first post in this group. I need to > search a word "Test 1.2.1" in my file. I am using "$_ =~m/Test \d+", but it > searched only "Test 1&q

Re: Help in search concept

2011-12-20 Thread Alexandre Chapoutot
Murugaiah : > Dear All, > > I am a learner in Perl and this is my first post in this group. I need to > search a word "Test 1.2.1" in my file. I am using "$_ =~m/Test \d+", but it > searched only "Test 1" not the full content. I need to check whether it is >

Re: Help in search concept

2011-12-20 Thread Chris Stinemetz
> > I am a learner in Perl and this is my first post in this group. I need to > search a word "Test 1.2.1" in my file. I am using "$_ =~m/Test \d+", but it > searched only "Test 1" not the full content. I need to check whether it is > "Test 1"

Help in search concept

2011-12-20 Thread Saravanan Murugaiah
Dear All, I am a learner in Perl and this is my first post in this group. I need to search a word "Test 1.2.1" in my file. I am using "$_ =~m/Test \d+", but it searched only "Test 1" not the full content. I need to check whether it is "Test 1" or "Test

Re: In search of a list class with unusual accessors

2011-10-21 Thread Rob Dixon
On 21/10/2011 04:11, David Christensen wrote: On 10/20/2011 06:28 PM, Rob Dixon wrote: Why are you insisting on an existing class, especially if you are intending to extend it? Laziness. Then the class that Randal has written in this thread should suffice, and does exactly what you describe

Re: In search of a list class with unusual accessors

2011-10-20 Thread David Christensen
On 10/20/2011 06:28 PM, Rob Dixon wrote: I think you should be wary of returning a simple scalar only when there is just a single item in the list. You will end up having to check to see if the return value is a reference before you know how to handle it. I didn't design the calling interface t

Re: In search of a list class with unusual accessors

2011-10-20 Thread Rob Dixon
On 21/10/2011 01:54, David Christensen wrote: On 10/19/2011 07:04 PM, David Christensen wrote: > I am looking for a class that stores zero or more items (e.g. a list) > and that provides accessors that accept and return scalar, list, > and/or array references depending upon context and object

Re: In search of a list class with unusual accessors

2011-10-20 Thread David Christensen
On 10/19/2011 07:04 PM, David Christensen wrote: > I am looking for a class that stores zero or more items (e.g. a list) > and that provides accessors that accept and return scalar, list, > and/or array references depending upon context and object content > (similar to CGI.pm, but not exactly the

Re: In search of a list class with unusual accessors

2011-10-20 Thread Randal L. Schwartz
> "David" == David Christensen writes: David> I am looking for a class that stores zero or more items (e.g. a list) and that David> provides accessors that accept and return scalar, list, and/or array David> references depending upon context and object content (similar to CGI.pm, but David>

Re: In search of a list class with unusual accessors

2011-10-19 Thread David Christensen
On 10/19/2011 07:38 PM, Alan Haggai Alavi wrote: > The `wantarray` function can be made use of. It helps in determining the context. Thank you for the reply. :-) Yes. > sub set { >my ( $self, @values ) = @_; >@$self = @values; >return; > } Your set() method doesn't appear to de

Re: In search of a list class with unusual accessors

2011-10-19 Thread David Christensen
On 10/19/2011 07:08 PM, John SJ Anderson wrote: Perhaps Set::Object will meet your needs? Thank you for the reply. :-) Unfortunately, no. I'm looking to store ordered lists, not sets, and I am looking for methods that variously accept and return sc

Re: In search of a list class with unusual accessors

2011-10-19 Thread Alan Haggai Alavi
Hello David, I am looking for a class that stores zero or more items (e.g. a list) and that provides accessors that accept and return scalar, list, and/or array references depending upon context and object content (similar to CGI.pm, but not exactly the same): The `wantarray` function can be m

Re: In search of a list class with unusual accessors

2011-10-19 Thread John SJ Anderson
On Wednesday, October 19, 2011 at 22:04 , David Christensen wrote: > Is there such an thing in standard Perl (5.10.1) or on CPAN? Perhaps Set::Object will meet your needs? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional comma

In search of a list class with unusual accessors

2011-10-19 Thread David Christensen
beginners: I am looking for a class that stores zero or more items (e.g. a list) and that provides accessors that accept and return scalar, list, and/or array references depending upon context and object content (similar to CGI.pm, but not exactly the same): use WishfulThinkingListClass;

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Uri Guttman
> "BM" == Brandon McCaig writes: BM> On Fri, Sep 16, 2011 at 2:55 PM, Paul Johnson wrote: >> map EXPR, @a is just the same as map { EXPR } @a. BM> The part that I find confusing is that EXPR is evaluated against each BM> $_, as opposed to once when map is called, passing the resulti

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Uri Guttman
> "PJ" == Paul Johnson writes: PJ> On Fri, Sep 16, 2011 at 02:27:08PM -0400, Brandon McCaig wrote: >> my @column_headers = map trim($_), split /\|/, $header_line; >> Using an EXPR with map is even more confusing to me, but it seems to >> work here so I'll leave it at that. ;D PJ>

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Fri, Sep 16, 2011 at 2:55 PM, Paul Johnson wrote: > map EXPR, @a is just the same as map { EXPR } @a. The part that I find confusing is that EXPR is evaluated against each $_, as opposed to once when map is called, passing the resulting value into map. :) Obviously it's just one of the many ma

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Paul Johnson
On Fri, Sep 16, 2011 at 02:27:08PM -0400, Brandon McCaig wrote: > my @column_headers = map trim($_), split /\|/, $header_line; > Using an EXPR with map is even more confusing to me, but it seems to > work here so I'll leave it at that. ;D map EXPR, @a is just the same as map { EXPR } @a. Some

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Jim Gibson
On 9/16/11 Fri Sep 16, 2011 11:27 AM, "Brandon McCaig" scribbled: > On Fri, Sep 16, 2011 at 11:32 AM, Brandon McCaig wrote: >>    my @column_headers = map { $_ = trim($_); $_; } >>            split /\|/, $header_line; > > Sorry, that should be: > > my @column_headers = map trim($_), split

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Fri, Sep 16, 2011 at 11:32 AM, Brandon McCaig wrote: >    my @column_headers = map { $_ = trim($_); $_; } >            split /\|/, $header_line; Sorry, that should be: my @column_headers = map trim($_), split /\|/, $header_line; I'm still relatively new to using BLOCKs within statements li

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Shlomi Fish
Hi Brandon, On Fri, 16 Sep 2011 11:32:16 -0400 Brandon McCaig wrote: > On Thu, Sep 15, 2011 at 3:48 PM, Rob wrote: > > I have a file of test results it is formatted as follows: > > > >        School |fname| lname | sub| testnum|score| grade|level > > MLK School | John | Smith | RE | Test 1| 95|

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Thu, Sep 15, 2011 at 3:48 PM, Rob wrote: > I have a file of test results it is formatted as follows: > >        School |fname| lname | sub| testnum|score| grade|level > MLK School | John | Smith | RE | Test 1| 95| A | Prof > MLK School | John | Smith | RE | Test 2| 97| A | Prof > MLK School | J

Files and Arrays - Search for values and write to the right

2011-09-16 Thread Rob
I have a file of test results it is formatted as follows: School |fname| lname | sub| testnum|score| grade|level MLK School | John | Smith | RE | Test 1| 95| A | Prof MLK School | John | Smith | RE | Test 2| 97| A | Prof MLK School | John | Smith | RE | Test 3| 93| A | Prof MLK School | Jo

Re: Search and replace w/ ignoring arbitrary characters

2011-08-10 Thread Frank Müller
in f[##o]o(ba##r) ? again, thanks for any ideas and hints, Frank On 9 Aug., 02:34, jwkr...@shaw.ca ("John W. Krahn") wrote: > Frank Müller wrote: > > dear all, > > Hello, > > > i want to make some search and replace within a string where I can > > define a s

Re: Search and replace w/ ignoring arbitrary characters

2011-08-08 Thread John W. Krahn
Frank Müller wrote: dear all, Hello, i want to make some search and replace within a string where I can define a set of characters, especially parenthesis, brackets etc., which are to be ignored. For example, I have the following string: sdjfh sdf sjkdfh sdkjfh sdjkf f[o]o(bar) hsdkjfh

Search and replace w/ ignoring arbitrary characters

2011-08-08 Thread Frank Müller
dear all, i want to make some search and replace within a string where I can define a set of characters, especially parenthesis, brackets etc., which are to be ignored. For example, I have the following string: sdjfh sdf sjkdfh sdkjfh sdjkf f[o]o(bar) hsdkjfh sdkljfhs sjfh sdkj sdjkfh sdjfh

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Brian F. Yulga
Although in my rather basic uses, the performance difference is inconsequential, and either way beats using the Windows "Search Companion". \Brian -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Brian Fraser
use File::Find::Rule; my @mp3_files = File::Find::Rule->file->name(qr/ \. mp3$ /x)->in("C:/"); Tada. The problem with this (and all previous) solutions is that, if you have filenames with non-English (bah, ascii/latin-1) characters, you'll get a bunch of garbage instead. I'm not aware if there's

Re: using Perl, How to search for files in my computer

2011-06-12 Thread shawn wilson
just adding to the variety...  I use these > one-liners if I need a quick search while playing in DOS (doesn't sort, just > prints as it gets 'em): > > perl -MFile::Find -wle "find( sub{ /\.mp3$/i and print;}, q(.));" > just curious, what's the difference

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Brian F. Yulga
et. al., At work I'm stuck on Winblows, and this is one of the ways Strawberry Perl (portable install) saves me lots of time. There's nothing wrong with the other solutions presented; I'm just adding to the variety... I use these one-liners if I need a quick search while playing i

Re: using Perl, How to search for files in my computer

2011-06-12 Thread John Delacour
At 03:40 -0700 12/06/2011, eventual wrote: I've read perldoc File::Find but I dont understand. So If I wish to search for "mp3" in d:\ and all its sub-directories, and to print it out if found, How should I write? Just put the directory in $dir: #!/usr/local/bin/perl use s

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Sayth Renshaw
> Try: > > my @Music_files = (); > > use File::Find; > find( \&want_mp3, 'd:\\' ); > print "$_\n" for sort @Music_files; > > sub want_mp3 { >  push @Music_files, $File::Find::name if $_ =~ /\.mp3$/; > } > > > -- > Just my 0.0002 million dollars worth, >  Shawn > > Confusion is the first step of

Re: using Perl, How to search for files in my computer

2011-06-12 Thread shawn wilson
On Jun 11, 2011 11:15 AM, "eventual" wrote: > > Hi, > I am using windows7. > Using Perl, how do I search for files in my computer, eg to search in c:\ and all its sub-directories. > I only know how to use glob to search from a particular location. > Thanks I haven

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Shawn H Corey
On 11-06-12 06:40 AM, eventual wrote: I've read perldoc File::Find but I dont understand. So If I wish to search for "mp3" in d:\ and all its sub-directories, and to print it out if found, How should I write? Try: my @Music_files = (); use File::Find; find( \&want_mp3, &#

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Sayth Renshaw
Actually got it working. You would need to use File::Find to search sub directories however. #!\usr\bin\perl use warnings; use strict; use diagnostics; use File::List; my $mp3; my @musiFiles; $mp3 = new File::List("C:/Users/RenshawFamily/maven/Music/Foo Fighters"); my @musicFiles = @{

Re: using Perl, How to search for files in my computer

2011-06-12 Thread Sayth Renshaw
On Sun, Jun 12, 2011 at 8:40 PM, eventual wrote: > Thanks, > I've read perldoc File::Find but I dont understand. > So If I wish to search for "mp3" in d:\ and all its sub-directories, and to > print it out if found, > How should I write? > Thanks > >

Re: using Perl, How to search for files in my computer

2011-06-12 Thread eventual
Thanks, I've read perldoc File::Find but I dont understand. So If I wish to search for "mp3" in d:\ and all its sub-directories, and to print it out if found, How should I write?  Thanks From: Shawn H Corey To: beginners@perl.org Sent: Saturday, June 11, 2011 11:31 PM Subject:

Re: using Perl, How to search for files in my computer

2011-06-11 Thread Shawn H Corey
On 11-06-11 11:14 AM, eventual wrote: Hi, I am using windows7. Using Perl, how do I search for files in my computer, eg to search in c:\ and all its sub-directories. I only know how to use glob to search from a particular location. Thanks You can use File::Find, see `perldoc File::Find`. It

using Perl, How to search for files in my computer

2011-06-11 Thread eventual
Hi, I am using windows7. Using Perl, how do I search for files in my computer, eg to search in c:\ and all its sub-directories. I only know how to use glob to search from a particular location. Thanks

Re: Regular expression: Search a pattern but starting from the end of a string?

2010-11-02 Thread C.DeRykus
On Nov 2, 3:50 am, h...@risoe.dtu.dk ("Larsen, Henning Engelbrecht") wrote: > I want to search a string for patterns but starting the search from the > _end_ instead of from the beginning, using a regular expression. > > For instance I want to find the last 'E' in

Re: Regular expression: Search a pattern but starting from the end of a string?

2010-11-02 Thread Akhthar Parvez K
On Wednesday 03 Nov 2010, Uri Guttman wrote: > > try: 'E123EEExyz' > > your \b at the end also breaks many cases. > > perl -le 'print $1 if ("EE123EExyz" =~ /.*(E)\d*\b/)' > perl -le 'print $1 if ("EE123abc" =~ /.*(E)\d*\b/)' > perl -le 'print $1 if ("EE123EExyzE" =~ /.*(E)\d*\b/)' > E > >

  1   2   3   4   5   6   7   8   9   >