tbone654 has asked for the wisdom of the Perl Monks concerning the following question:
I can do this:
$ perl -e 'print chr(219);'
▒
but I can't seem to do this:
$ cat hitters | perl -e 'while(<>){print substr($_,index($_,chr(219)));}'
from this: hitters file
2BMartin Prado▒(R)
LFJason Kubel▒(L)
CMiguel Montero▒(L)
CFA.J. Pollock▒(R)
PPatrick Corbin▒(L)
CF▒Michael Bourn▒(L)
2B▒Jason Kipnis▒(L)
SS▒Asdrubal Cabrera▒(S)
1B▒Nick Swisher▒(S)
DH▒Carlos Santana▒(S)
can someone give me a hint please? thank you...
BTW it works if I do:
$ cat hitters | perl -e 'while(<>){print substr($_,index($_,Pollo));}'
so I can search by text, but just don't know how to search on that character...
$ perl -e 'print chr(219);'
▒
but I can't seem to do this:
$ cat hitters | perl -e 'while(<>){print substr($_,index($_,chr(219)));}'
from this: hitters file
2BMartin Prado▒(R)
LFJason Kubel▒(L)
CMiguel Montero▒(L)
CFA.J. Pollock▒(R)
PPatrick Corbin▒(L)
CF▒Michael Bourn▒(L)
2B▒Jason Kipnis▒(L)
SS▒Asdrubal Cabrera▒(S)
1B▒Nick Swisher▒(S)
DH▒Carlos Santana▒(S)
can someone give me a hint please? thank you...
BTW it works if I do:
$ cat hitters | perl -e 'while(<>){print substr($_,index($_,Pollo));}'
so I can search by text, but just don't know how to search on that character...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: search for chr() fails
by Anonymous Monk on May 21, 2013 at 00:40 UTC | |
by tbone654 (Beadle) on May 21, 2013 at 01:57 UTC | |
by Anonymous Monk on May 21, 2013 at 02:31 UTC | |
by tbone654 (Beadle) on May 21, 2013 at 02:40 UTC | |
Re: search for chr() fails
by LanX (Saint) on May 21, 2013 at 00:08 UTC | |
by tbone654 (Beadle) on May 21, 2013 at 01:30 UTC | |
by LanX (Saint) on May 21, 2013 at 01:41 UTC | |
by tbone654 (Beadle) on May 21, 2013 at 02:09 UTC |
Back to
Seekers of Perl Wisdom