Thank you much for the tips! This worked great. So, once again coming from the SQL point of view - what if i have SEVERAL zip codes that i'm looking for? what if i want to say, If $ZipPlus4 has a value in ('29626', '29627', '29628', '29788') then increment $n += 1, and if it's NOT in those...
hello,
I am more of an SQL person - so what I am trying to say, I am not sure how to say in Perl. I am sure it is some sort of regular expression. Maybe YOU can help me!
I would like to say,
if ($ZipPlus4 STARTS WITH 29626) then increment n.
any hints?
thank you!
thank you for the info! another question - do you find that you use Hashes often in your perl programming? I am understanding the concept as it's presented in the book - but not sure how i will apply it in-real-life.
Hello! I am new to Perl and have been using it intermittently in a QA role. Mainly for parsing & testing tab delimited files.
I am reading through the Learning Perl book & working through Chapter 5 right now which is a chapter on hashes.
I am not sure I'm understanding a Hash on the large...
HEY! can i ask another question? So i wrote out an decoder and an encoder. But with the encoder - i want the blocks to be spaced in groups of 5. So if i wanted to say "I wrote a perl to encode and decode" - the program would return this to me:
KN4H5 CQ9C4 S5HCO 8HFCQ OFFC8 HFC
instead of this...
Hello! thank you so much for the valuable input. Forgive the slowness of my brain - this is not something I particularly EXCEL at (at least not yet - let's hope that changes). I *would* use the "tr" option - but it's only mentioned very briefly in 'Learning Perl' and I'm not sure I can really...
Hello, I am new to perl and working my way through the Learning Perl book. I'm only on page 37, so bear with me!!!
I want to take STDIN and break it into letters. It's a decoder program. Like, for example, if someone types in: LC8Q4 CBDSN XQRHD NKJXB HR into STDIN ... it will come out as BECAR...
I bet it is very similar to what was posted for kre1973 ... except that I need the "WI" or "OR" or "NE" or whatever state I need to occur in field 2 - instead of, say, the last name field or something.
hello! I have a story problem for you. I have a tab-delimited file. The 2nd field is the "state" field, and I want to pull out of this file, and write to a NEW file, only the rows that have Wisconsin as their state. 'WI' I believe I need to use "split" but not sure how. This is how far I've...
Thank you! Yes, I had posted something very similar & was still not able to do what I wanted, but this time I *believe* i've got it. I needed to "split", which I wasn't doing - so thank you for that hint.
system "rm seq2";
$ps=`ps -ef | grep java`;
print "$ps";
@pid=split /\s+/, "$ps";
print...
hello,
does perl allow/understand when i use AWK inside of a system command? I can't understand why this isn't working:
$pid=`ps -ef | grep java | egrep -v grep | awk '{print $2}'`;
print "$pid";
when i type: ps -ef | grep java | egrep -v grep | awk '{print $2}'
at the command prompt itself...
Thank you kevin! That makes perfect sense. I see it now.
do you know why this:
my $proc = `ps -ef | grep java3 | egrep -v grep | awk '{print $2}'`;
print $proc;
gives me the entire process information instead of JUST the process id?
Hi columb, well, to be honest - the main reason is because I'm very much new to this - and really only know one way of doing it. I looked in my perl book for PIPE - and it's not in there. (It's the O'Reilly Learning Perl book). Is that more of an advanced function?
Also, a question - this isn't...
cool. thx for the help - there *should* be only 1 process id that is returned. I tried to really narrow it down by grepping 'java3' - which is VERY specific to this one process and no other running process should have this in its command. Also, the egrep -v should get rid of the grep pid. So...
hello,
i would like to load a system command into a variable. The system command is: system "ps -ef | grep java3 | egrep -v grep | awk '{print $2}'";
I'm guessing the way I would do this is:
my $proc = system "ps -ef | grep java3 | egrep -v grep | awk '{print $2}'";
But i have a question...
KevinADC, OK that worked like a charm. Wow. I'm impressed. i'm not totally sure how that was constructed or how you knew to do it that way - but I am studying it, to see if I can make more sense of it.
Here's another little complication, what if I want it to be like - in the housenumber range...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.