Re: printing grep results in Perl

2010-08-02 Thread John W. Krahn
Erik Witkop wrote: There is one more task that I am unable to solve. If $_ was something like FYUY or fO76, I would like to remove the first ^[Ff].But keep the last 3 character. Find and Replace does not work obviously as I would lose those last 3 characters that I want. I researched the map f

Re: printing grep results in Perl

2010-08-02 Thread Brian Fraser
If you don't mind a newbie trying to help... Since you want to replace something, using bare //'s won't do, since that's an alias for m//; m, as in match. You want a substitution, s///. The regex you are looking for should look something like this (Untested code): > s/ > \b #Word boundary

Re: printing grep results in Perl

2010-08-02 Thread Erik Witkop
On Jul 27, 11:34 pm, u...@stemsystems.com ("Uri Guttman") wrote: > > "EW" == Erik Witkop writes: > >   EW> I have spent half the day looking at map and I still don't get it. > > it is easier than you think. > >   EW> I don't get the EXPR versus BLOCK and how I can treat them differently. > > t

Re: has and non unique keys

2010-08-02 Thread Uri Guttman
> "CD" == C DeRykus writes: CD> DB_FILE's module implements a 'hash-like' type BTREE CD> based on the Berkeley DB API which can store/retrieve CD> duplicate keys. CD> $h{'Wall'} = 'Larry' ; CD> $h{'Wall'} = 'Brick' ; # Note the duplicate key CD> $h{'Wall'} = 'Brick' ;

Re: has and non unique keys

2010-08-02 Thread C.DeRykus
On Aug 2, 3:13 am, sharan.basa...@gmail.com (Sharan Basappa) wrote: > On Mon, Aug 2, 2010 at 3:36 PM, Uri Guttman wrote: > >> "SB" == Sharan Basappa writes: > UG> >  SB> Is there any restriction that the keys in perl should be unique? UG> >  SB> If not, are there any special considerations t

Re: has and non unique keys

2010-08-02 Thread Shlomi Fish
Hi Sharan, On Monday 02 August 2010 14:11:32 Sharan Basappa wrote: > Shlomi, > > I am not trying to be critical of perl or anything (if that is what you > felt). That's not how I felt. > I am only trying to see if a certain feature exists or not. > The current problem I am working on has dupli

Re: has and non unique keys

2010-08-02 Thread Philip Potter
On 2 August 2010 12:11, Sharan Basappa wrote: > I am not trying to be critical of perl or anything (if that is what you felt). I didn't think you were; it didn't come across as criticism. > I am only trying to see if a certain feature exists or not. > The current problem I am working on has dupl

Re: has and non unique keys

2010-08-02 Thread Sharan Basappa
Shlomi, I am not trying to be critical of perl or anything (if that is what you felt). I am only trying to see if a certain feature exists or not. The current problem I am working on has duplicate key values and hence the question. The STL multipmap library explanation is below: http://www.cplusp

Re: has and non unique keys

2010-08-02 Thread Shlomi Fish
Hi Sharan, On Monday 02 August 2010 13:13:19 Sharan Basappa wrote: > Hello Uri, > > Thanks for the explanation. I figured this out once I ran the code > where I got this doubt. > The reason why I raised this question is that languages like C++ do > allow hashes arrays Please don't call hashes "h

Re: has and non unique keys

2010-08-02 Thread Sharan Basappa
Hello Uri, Thanks for the explanation. I figured this out once I ran the code where I got this doubt. The reason why I raised this question is that languages like C++ do allow hashes arrays that can have different values but same key. Thats the reason for the second part of my question. Regards,

Re: has and non unique keys

2010-08-02 Thread Uri Guttman
> "SB" == Sharan Basappa writes: SB> Is there any restriction that the keys in perl should be unique? SB> If not, are there any special considerations that need to be kept SB> in mind while accessing the elements? well, think about it first. what would happen if a hash allowed duplicat

has and non unique keys

2010-08-02 Thread Sharan Basappa
Folks, Is there any restriction that the keys in perl should be unique? If not, are there any special considerations that need to be kept in mind while accessing the elements? Regards, Sharan -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h.