perl question with socket

2011-10-10 Thread 谢成骏
I just type after but it doesn't work like the book tell me. this is the two file, and I run the server.pl in my server and run client.plwith this command: client.pl localhost:2007 when I run the client.pl, the server.pl can return a message to tell me there is a client connected. But, I type anyt

perl question

2010-05-19 Thread packet
How do you map a network with perl? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: The Perl question of the here document

2009-10-21 Thread John W. Krahn
Majian wrote: Dear list: Hello, Sorry to distrub all . When I learned Perl on the book called "Perl by example 4th Chinese Edition ", I found there was an error on this book . There had a perl script writted by this : #!/usr/bin/perl

The Perl question of the here document

2009-10-21 Thread Majian
Dear list: Sorry to distrub all . When I learned Perl on the book called "Perl by example 4th Chinese Edition ", I found there was an error on this book . There had a perl script writted by this : #!/usr/bin/perl print << 'END';

Re: perl Question

2007-03-24 Thread John W. Krahn
Craig Petty wrote: > > I got a question could i write a script that look for > a ip on a network or would that be to hard to do for a > newbie? Can you describe your quest in more detail? http://www.catb.org/~esr/faqs/smart-questions.html John -- Perl isn't a toolbox, but a small machine shop

Re: perl Question

2007-03-24 Thread Jeff Pang
yes you can. Maybe you take a look at Net::Ping on CPAN? -Original Message- >From: Craig Petty <[EMAIL PROTECTED]> >Sent: Mar 24, 2007 8:18 AM >To: beginners@perl.org >Subject: perl Question > > > >I got a question could i write a script that look for >a

perl Question

2007-03-24 Thread Craig Petty
I got a question could i write a script that look for a ip on a network or would that be to hard to do for a newbie? It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://

Re: Quick Net::SSH::Perl question

2006-10-27 Thread Rob Dixon
Michael Alipio wrote: Hi, My program looks like this: #!/usr/local/bin/perl use warnings; use strict; use Net::SSH::Perl; my $host = '192.168.1.1'; my $user = 'user'; my $pass = 'password'; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); $ssh->shell; It spawns a shell succes

Quick Net::SSH::Perl question

2006-10-27 Thread Michael Alipio
Hi, My program looks like this: #!/usr/local/bin/perl use warnings; use strict; use Net::SSH::Perl; my $host = '192.168.1.1'; my $user = 'user'; my $pass = 'password'; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); $ssh->shell; It spawns a shell successfully but takes too lon

perl question

2006-09-27 Thread elite elite
Does anyone know what tools come with perl 5.8.8? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: Newbie Perl Question

2006-07-17 Thread Peter Cornelius
On Jul 17, 2006, at 11:33 AM, Maxim wrote: But I am totally frustrated in regexp part in the script: /^DR\d+.*?(\d+).*?(\d+)(.+)/ Could you please explain it? Or maybe you have a link to intelligible guide for perl regexp? perldoc perlre is a pretty detailed description of perl's regexp.

Re: Newbie Perl Question

2006-07-17 Thread Peter Hoose
Y PASTE SCRIPT Hope this helps! ~P - Original Message - From: "Rod Burgess" <[EMAIL PROTECTED]> To: Sent: Monday, July 17, 2006 1:59 PM Subject: Newbie Perl Question I am new to the Perl world and am trying to learn it. A coworker tells me that

Re: Newbie Perl Question

2006-07-17 Thread Rob Dixon
Rod Burgess wrote: > > I am new to the Perl world and am trying to learn it. A coworker tells me > that Perl will not work for what I am trying to do however, I think Perl > would be a great tool to use and I feel this coworker is wrong. > I have a file that contains several lines all as below:

Re: Newbie Perl Question

2006-07-17 Thread Maxim
Hello Rod, I am not the author of the initial message, but thanks a lot for your reply. I am trying to adopt your script to my need, and, basically, it works for me. But I am totally frustrated in regexp part in the script: /^DR\d+.*?(\d+).*?(\d+)(.+)/ Could you please explain it? Or maybe you h

Re: Newbie Perl Question

2006-07-17 Thread Todd W
""Rod Burgess"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am new to the Perl world and am trying to learn it. A coworker tells me > that Perl will not work for what I am trying to do however, I think Perl > would be a great tool to use and I feel this coworker is wrong. > I

Re: Newbie Perl Question

2006-07-17 Thread Dr.Ruud
"Rod Burgess" schreef: Your Subject has no quality. Please come up with something like "convert data lines". > I am new to the Perl world and am trying to learn it. A coworker > tells me that Perl will not work for what I am trying to do however, > I think Perl would be a great tool to use and

Newbie Perl Question

2006-07-17 Thread Rod Burgess
I am new to the Perl world and am trying to learn it. A coworker tells me that Perl will not work for what I am trying to do however, I think Perl would be a great tool to use and I feel this coworker is wrong. I have a file that contains several lines all as below: DR03555{tab}45600062888{t

Newbie Perl Question

2006-07-17 Thread Rod Burgess
I am new to the Perl world and am trying to learn it. A coworker tells me that Perl will not work for what I am trying to do however, I think Perl would be a great tool to use and I feel this coworker is wrong. I have a file that contains several lines all as below: DR03555{tab}45600062888{t

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
my ($option) = $_ =~ s/(.*?)#/; #skip inline comments should be m//, not s// On 6/8/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote: On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: > Hi Anthony, good idea about overriding the table names. I had a feeling > there would be a conf file som

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: Hi Anthony, good idea about overriding the table names. I had a feeling there would be a conf file somewhere. As I am outputting the results of the SELECT to an HTML::Template I am already using a Conf file which is another class. This leads

Re: OO Perl question

2006-06-08 Thread Graeme McLaren
n only one is required. So how or where should I instantiate it? Cheers, G :) From: "Anthony Ettinger" <[EMAIL PROTECTED]> To: "Graeme McLaren" <[EMAIL PROTECTED]> CC: beginners@perl.org Subject: Re: OO Perl question Date: Thu, 8 Jun 2006 00

Re: OO Perl question

2006-06-08 Thread Anthony Ettinger
On 6/8/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: Hi all, this class that I have written lists the contents of a "log" table when the $log->view method is invoked. There is some hardcoded SQL in this method and all I do is pass it a number which then looks up the relevant records. This reall

OO Perl question

2006-06-08 Thread Graeme McLaren
Hi all, this class that I have written lists the contents of a "log" table when the $log->view method is invoked. There is some hardcoded SQL in this method and all I do is pass it a number which then looks up the relevant records. This really isn't a reusable class as far as I understand it

RE: perl question - unused variables

2005-06-08 Thread Ryan Frantz
ypo at mail_test line 11. If I use 'use strict;' I get a flurry of other messages ;). my $perl_experience = n00b -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 3:21 PM To: Ryan Frantz; Tro

RE: perl question - unused variables

2005-06-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 08, 2005 2:52 PM > To: 'Troy S'; beginners@perl.org > Subject: RE: perl question - unused variables > > Troy S wrote: >> How can i automatically detect unused variables in Perl? >> >> i delcrae var

RE: perl question - unused variables

2005-06-08 Thread Ryan Frantz
ssage- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 2:52 PM To: 'Troy S'; beginners@perl.org Subject: RE: perl question - unused variables Troy S wrote: > How can i automatically detect unused variables in Perl? > > i delcrae variables like: &g

RE: perl question - unused variables

2005-06-08 Thread Bob Showalter
Troy S wrote: > How can i automatically detect unused variables in Perl? > > i delcrae variables like: > my $abc; > > but don't use $abc within the subroutine. > > how can i get perl to autmatically tell me that $abc is not being used > (other than the declaration) Possibly use the output o

perl question - unused variables

2005-06-08 Thread Troy S
How can i automatically detect unused variables in Perl? i delcrae variables like: my $abc; but don't use $abc within the subroutine. how can i get perl to autmatically tell me that $abc is not being used (other than the declaration) evhorig -

RE: Could anyone please answer a simple PERL question.

2004-07-08 Thread Carol Stone
Just for this thread, I have gone to ActiveState and learned how to use their search facility to find my email address to copy and update my response to someone way back on August 31, 2000 - this was my very first perl success ;-D I have added a note regarding Windows XP at the end of it. You're

[Solved] Could anyone please answer a simple PERL question.

2004-07-08 Thread Philipp Traeder
On Thursday 08 July 2004 HH:31:20, [EMAIL PROTECTED] wrote: > A sure kill is to search for "perl*" and take note of the path. Then you > can do one of the following: > Just to let you know: The "path" variable has been the problem (as Marco wrote me off-list). Another happy customer ;-) -- To

Re: Could anyone please answer a simple PERL question.

2004-07-08 Thread William . Ampeh
A sure kill is to search for "perl*" and take note of the path. Then you can do one of the following: 1./ update your path variable, verify that you have really done that with the set command. OR 2./ call up the perl interpreter using the absolute path. I think he probabily have not inst

Re: Could anyone please answer a simple PERL question.

2004-07-08 Thread Philipp Traeder
On Thursday 08 July 2004 HH:18:19, JupiterHost.Net wrote: > Marco wrote: Hi Marco, > > and on DOS prompt when I say, perl simple.pl > > it says: > > 'perl' is not recognized as an internal or external > > command, > > > > what am I missing? an execution path or something? > > Not sure, you may ne

Re: Could anyone please answer a simple PERL question.

2004-07-08 Thread JupiterHost.Net
Marco wrote: Hi Lee, Hello, I appreciate your help. No problem, just don't forget to reply to the list so everyone can learn/help :) I double click on it but it opens the file with Notes, because that's how I created it. Then you probably don't have .pl associated with perl or its not a .pl file.

Re: Could anyone please answer a simple PERL question.

2004-07-08 Thread JupiterHost.Net
Windows automatically associates a .pl file with the Perl interpreter, so simply clicking on the "yellow icon" associated with the file (assuming you have not changed it", should do the job. The down side of this is that the resulting DOS window disappears as soon at the program terminates. A sol

Re: Could anyone please answer a simple PERL question.

2004-07-08 Thread JupiterHost.Net
Marco wrote: Hi, I always used PERL in UNIX environment, so it's my Hello first time trying to run a PERL script in Windows env and I have a simple question to ask, (I know how to do this in UNIX but not in windows). I installed PERL for Windows under: C:\Z_Perl_584\Perl\bin my below simple PERL sc

Could anyone please answer a simple PERL question.

2004-07-08 Thread Marco
Hi, I always used PERL in UNIX environment, so it's my first time trying to run a PERL script in Windows env and I have a simple question to ask, (I know how to do this in UNIX but not in windows). I installed PERL for Windows under: C:\Z_Perl_584\Perl\bin my below simple PERL script is called "si

Re: A possibly stupid 'Perl' question?

2004-06-26 Thread Damon Allen Davison
Alternative to all the other suggestions, you could get a shell account with one of a number of providers like www.freeshell.org and use Perl from there. I think there may be some restrictions on Perl at the basic membership levels, but I think it's safe to say that most such providers have P

RE: A possibly stupid 'Perl' question?

2004-06-25 Thread Bob Showalter
Ron Smith wrote: > ... I only have access to > 'Windows' machines that do not have Perl installed at all. > Is there a way to use Perl on-line from such a machine? Go to http://www.activestate.com/Products/ActivePerl/ and install ActivePerl (free). > Is Perl small enough to > be installed on a fl

Re: A possibly stupid 'Perl' question?

2004-06-25 Thread Remo Sanges
On Jun 25, 2004, at 8:50 PM, Wiggins d Anconia wrote: I'm in a situation wherein I want to brush up on my 'Perl', but have no personal computer. I'm currently reading my way through "Learning Pearl", but can't do the exercises because I only have access to 'Windows' machines that do not have Perl i

Re: A possibly stupid 'Perl' question?

2004-06-25 Thread Wiggins d Anconia
> > I'm in a situation wherein I want to brush up on my 'Perl', but have no personal computer. I'm currently reading my way through "Learning Pearl", but can't do the exercises because I only have access to 'Windows' machines that do not have Perl installed at all. Is there a way to use Perl on-li

Re: A possibly stupid 'Perl' question?

2004-06-25 Thread James Edward Gray II
On Jun 25, 2004, at 1:25 PM, u235sentinel wrote: I haven't used it myself however I understand there is "Active Perl" for Windows available. I don't have any details but perhaps you could google for it or someone here could give you directions. No need to do this as it is available from http://w

Re: A possibly stupid 'Perl' question?

2004-06-25 Thread u235sentinel
I haven't used it myself however I understand there is "Active Perl" for Windows available. I don't have any details but perhaps you could google for it or someone here could give you directions. Ron Smith wrote: I'm in a situation wherein I want to brush up on my 'Perl', but have no personal c

A possibly stupid 'Perl' question?

2004-06-25 Thread Ron Smith
I'm in a situation wherein I want to brush up on my 'Perl', but have no personal computer. I'm currently reading my way through "Learning Pearl", but can't do the exercises because I only have access to 'Windows' machines that do not have Perl installed at all. Is there a way to use Perl on-line

Re: (FOUO) PERL question ...

2004-03-31 Thread WC -Sx- Jones
Johnson, Michael wrote: CLASSIFICATION: UNCLASSIFIED SECURITY CONTROL MARKING: FOR OFFICIAL USE ONLY Who offers the very best training in PERL ? Thanks, Mike http://stonehenge.com/ http://training.perl.com/ (Seems slow?) There are MANY... I would mainly say that you should just read a lot at - ht

(FOUO) PERL question ...

2004-03-31 Thread Johnson, Michael
CLASSIFICATION: UNCLASSIFIED SECURITY CONTROL MARKING: FOR OFFICIAL USE ONLY Who offers the very best training in PERL ? Thanks, Mike Classification: UNCLASSIFIED Security Control Marking: FOR OFFICIAL USE ONLY -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Generic LDAP and Perl question

2004-02-24 Thread jeffrey_n_Dyke
I realize i'll get a slightly biased opinion from this group, but thats fine. We have LDAP Servers on multiple platforms, but they are all V3 compliant. I was starting to write some search & update code in Java, and although i'm fairly green to both, i have more confidence my knowledge of Perl sy

Re: perl question

2004-01-10 Thread Wiggins d'Anconia
Please use a more informative subject, these are all Perl questions Perl Mail User wrote: Hello all Perl Gurus - I have a question in regards to an error i receive from running a script in perl from a user on my system - the error is below - I do not get this error when I run it as root jus

perl question

2004-01-10 Thread Perl Mail User
Hello all Perl Gurus - I have a question in regards to an error i receive from running a script in perl from a user on my system - the error is below - I do not get this error when I run it as root just as a user that needs to run this program. Any Ideas. ~~ error ~ Time::HiR

Re: perl question

2003-06-22 Thread Pavle Lukic
On Sat, Jun 21, 2003 at 12:40 PM -0700, Ioana Cozmuta wrote: >>I do understand the problem, however I do not know how to put it in a perl >>script. For example, in C this could be solved using pointers. >>As I mentioned in my first e-mail, the data are tab delimited. If between >>the tabs there is

Re: perl question

2003-06-22 Thread Pavle Lukic
On Sat, Jun 21, 2003 at 12:40 PM -0700, Ioana Cozmuta wrote: >I do understand the problem, however I do not know how to put it in a perl >script. For example, in C this could be solved using pointers. >As I mentioned in my first e-mail, the data are tab delimited. If between >the tabs there is no

Re: perl question

2003-06-21 Thread Paul Johnson
On Sat, Jun 21, 2003 at 11:36:36PM +0200, Paul Johnson wrote: > On Sat, Jun 21, 2003 at 12:40:19PM -0700, Ioana Cozmuta wrote: > > [ Kept on p5p so no one else need reply, followups to perl-beginners ] > > > I did not intend to offend anybody with my message nor did I realize that > > this is a v

Re: Perl question

2002-11-12 Thread Paul
--- James Parsons <[EMAIL PROTECTED]> wrote: > Good Morning all Good morning, James. =o) > Since I'm still a Newbie when it comes to Perl , so my question may > sound fairly simple to the group but here goes.. > I need to create a file that has the localtime - 1 day and -2 days. > and then

Re: Perl question

2002-11-12 Thread Frank Wiles
.--[ James Parsons wrote (2002/11/12 at 09:22:00) ]-- | | Good Morning all | | Since I'm still a Newbie when it comes to Perl , so my question may sound | fairly simple to the group but here goes.. | | I need to create a file that has the localtime - 1 day and -2 days.

Perl question

2002-11-12 Thread James Parsons
Good Morning all Since I'm still a Newbie when it comes to Perl , so my question may sound fairly simple to the group but here goes.. I need to create a file that has the localtime - 1 day and -2 days. and then redirect this to 2 separate files. thanks in advance. James Parsons. -- To

Re: MySql - Perl question

2002-09-23 Thread Felix Geerinckx
on Sun, 22 Sep 2002 17:06:01 GMT, Mariusz wrote: > I have a "discount" table that carries percentage discounts that > should be looked up when the customer submits a discount code and > taken into calculation of the total price. My table looks something > like this: > > field names:|senior|

Re: MySql - Perl question

2002-09-22 Thread Mariusz
From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: "Mariusz" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]> Sent: Sunday, September 22, 2002 1:07 PM Subject: Re: MySql - Perl question > Often times, a separate table of valid choices exists in the data

Re: MySql - Perl question

2002-09-22 Thread Tanton Gibbs
is not found, then issue an error. HTH, Tanton - Original Message - From: "Mariusz" <[EMAIL PROTECTED]> To: "perl" <[EMAIL PROTECTED]> Sent: Sunday, September 22, 2002 1:06 PM Subject: MySql - Perl question Hi, I have a "discount" table that c

MySql - Perl question

2002-09-22 Thread Mariusz
Hi, I have a "discount" table that carries percentage discounts that should be looked up when the customer submits a discount code and taken into calculation of the total price. My table looks something like this: field names:|senior|student|... values:|0.20|0.50|... Now, when

Re: binmoding as Re: Perl Question

2002-05-24 Thread drieux
On Friday, May 24, 2002, at 11:18 , Michael Fowler wrote: > On Thu, May 23, 2002 at 05:07:38PM -0700, drieux wrote: >> On Thursday, May 23, 2002, at 04:57 , Michael Fowler wrote: >>>perl -O777pi~ -e's^/usr/local^/tmp/local^g' mybinaryfile.out >> >> that's what I was afeared of... had that co

Re: binmoding as Re: Perl Question

2002-05-23 Thread Michael Fowler
On Wed, May 22, 2002 at 05:58:59PM -0700, drieux wrote: > On Wednesday, May 22, 2002, at 01:35 , John W. Krahn wrote: > >perl -0777pi~ -e's^/usr/local^/tmp/local^' mybinaryfile.out > > way too freaky it works... but I am having > problems with the verification - since I just > ran this again

binmoding as Re: Perl Question

2002-05-22 Thread drieux
On Wednesday, May 22, 2002, at 01:35 , John W. Krahn wrote: > Paul Company wrote: >> >> I want to replace a string "/usr/local" with another >> string "/tmp/local" in a binary file. > > perl -0777pi~ -e's^/usr/local^/tmp/local^' mybinaryfile.out way too freaky it works... but I am having pr

Re: [SAGE] Perl Question

2002-05-22 Thread Ed Lyon
It seems you've made two mistakes: o strings only returns printable strings from the file. It does not return the contents of the file made printable. So, any offset in the output will not be the offset in the file. You might want to investigate the -t option to strings. o The -b

Re: [SAGE] Perl Question

2002-05-22 Thread Trey Harris
In a message dated Wed, 22 May 2002, Paul Company writes: > > I want to replace a string "/usr/local" with another > string "/tmp/local" in a binary file. > > This is what I wrote: > [...] This seems like overkill to me. If you're only doing this as a one-off, then memory shouldn't be a problem

Re: Perl Question

2002-05-22 Thread drieux
On Wednesday, May 22, 2002, at 12:59 , Paul Company wrote: > I want to replace a string "/usr/local" with another > string "/tmp/local" in a binary file. cf man patch what you want is 'patch' - it is not nice to try to patch binary files on the fly > This is what I wrote: > > #!/usr/local

Re: Perl Question

2002-05-22 Thread John W. Krahn
Paul Company wrote: > > I want to replace a string "/usr/local" with another > string "/tmp/local" in a binary file. perl -0777pi~ -e's^/usr/local^/tmp/local^' mybinaryfile.out > This is what I wrote: > > #!/usr/local/bin/perl > > $file = "./mybinaryfile.out"; > $s1 = `strings $file | grep -

Perl Question

2002-05-22 Thread Paul Company
I want to replace a string "/usr/local" with another string "/tmp/local" in a binary file. This is what I wrote: #!/usr/local/bin/perl $file = "./mybinaryfile.out"; $s1 = `strings $file | grep -b /usr/local`; # returned 2027:/usr/local/conf/ ($byteoffset, $string) = split /:/, $s1; $slen = len

Re: Really Dumb Perl Question

2002-05-10 Thread Chas Owens
On Fri, 2002-05-10 at 12:35, bob ackerman wrote: > > On Friday, May 10, 2002, at 08:09 AM, Nikola Janceski wrote: > > > tie %ANSWER "/dev/brain"; > > print %ANSWER{$question}, "\n"; > > ^D > > Most of it. > > shouldn't that be: > print $ANSWER{$question},"\n"; > > Nah, it was Perl 6 . In Pe

Re: Really Dumb Perl Question

2002-05-10 Thread bob ackerman
: drieux [mailto:[EMAIL PROTECTED]] >> Sent: Friday, May 10, 2002 11:05 AM >> To: [EMAIL PROTECTED] >> Subject: Really Dumb Perl Question >> >> >> >> volks, >> >> I broke down and bought a copy of >> >> Perl 5 Pocket Reference, Thir

Re: Really Dumb Perl Question

2002-05-10 Thread Chas Owens
On Fri, 2002-05-10 at 11:04, drieux wrote: > > volks, > > I broke down and bought a copy of > > Perl 5 Pocket Reference, Third Edition > c. 2000 > ISBN: 0-596-00032-4 > > am I just getting Old, > > Or do you Mutants really keep all of that in your heads? > > ciao > drieux >

RE: Really Dumb Perl Question

2002-05-10 Thread Nikola Janceski
tie %ANSWER "/dev/brain"; print %ANSWER{$question}, "\n"; ^D Most of it. > -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 10, 2002 11:05 AM > To: [EMAIL PROTECTED] > Subject: Really Dumb Perl Question > > >

Re: Really Dumb Perl Question

2002-05-10 Thread Stephen Potter
That's why they print these books, so we don't have to keep all that in our heads. Trust me, some of us have big enough heads as is. -spp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Really Dumb Perl Question

2002-05-10 Thread drieux
volks, I broke down and bought a copy of Perl 5 Pocket Reference, Third Edition c. 2000 ISBN: 0-596-00032-4 am I just getting Old, Or do you Mutants really keep all of that in your heads? ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Perl question

2002-02-27 Thread Elaine -HFB- Ashton
Allison Ogle [[EMAIL PROTECTED]] quoth: *> *>I am a beginner trying to write a program which will read information from a *>log file and write it to a spreadsheet for easier viewing and organization *>but I'm not sure how to do this or how to get started. ANY help would be *>appreciatd. Please r

Re: "Learning Perl" Question

2002-02-13 Thread Michael Fowler
On Wed, Feb 13, 2002 at 11:05:51AM -0500, Hanson, Robert wrote: [snip] > In chapter 2 it mentions a rule in Perl: "any time that you need a variable > in Perl, you can use an assignment instead. First, Perl does the > assignment. Then it uses the variable in whatever way you requested". > > Ok

RE: "Learning Perl" Question

2002-02-13 Thread Bob Showalter
> -Original Message- > From: Hanson, Robert [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 13, 2002 11:06 AM > To: [EMAIL PROTECTED] > Subject: "Learning Perl" Question > > > [Sorry if this isn't the place to post this, but I thought it m

"Learning Perl" Question

2002-02-13 Thread Hanson, Robert
[Sorry if this isn't the place to post this, but I thought it might be interesting. Flaming will be accepted] I'm teaching a Perl class from the Learning Perl book, and noticed an inconsistency with the way certain constructs work. In chapter 2 it mentions a rule in Perl: "any time that you nee

RE: simple perl question

2002-01-25 Thread Deen Hameed
Nope... the . loses its metaness when inside the character class... where the regexp *does* stuff up is that it allows more than one decimal point in the string... deen "yayy I know something!" hameed On Fri, 25 Jan 2002, John Edwards wrote: > Oh. One more thing. > > Your regex should have t

RE: simple perl question

2002-01-25 Thread Jeff 'japhy' Pinyan
On Jan 25, John Edwards said: >Your regex should have the . escaped. Currently it is matching on either a >number or *any character* between the a and z. Although this works, it may >bite you if you have a line like this... Regex metacharacters all lose their meaning inside a character class. [

Re: simple perl question

2002-01-25 Thread Frank
On Fri, Jan 25, 2002 at 01:58:00PM +1100, Stuart wrote: > Hi > Please help if you can. > Thanks again > Stuart Clark > > > How do I add all the number between the "a" and the "z" > My output file only gives me the instances of the matching pattern and > not the total > > # start of file test

RE: simple perl question

2002-01-25 Thread John Edwards
n the results. Here is how it should look /a([\d\.]+)z/ John -Original Message- From: John Edwards [mailto:[EMAIL PROTECTED]] Sent: 25 January 2002 09:16 To: 'Stuart Clark'; Perl List Subject: RE: simple perl question This line $total += /a([\d.]+)z/; is adding the numbe

RE: simple perl question

2002-01-25 Thread John Edwards
/; $total += $match; } HTH John -Original Message- From: Stuart Clark [mailto:[EMAIL PROTECTED]] Sent: 25 January 2002 02:58 To: Perl List Subject: simple perl question Hi Please help if you can. Thanks again Stuart Clark How do I add all the number between the "a" and

simple perl question

2002-01-25 Thread Stuart Clark
Hi Please help if you can. Thanks again Stuart Clark How do I add all the number between the "a" and the "z" My output file only gives me the instances of the matching pattern and not the total # start of file test 3034364717283459322a15.32zM042001H 3045434551648534245a243.56zM

Re: simple perl question

2002-01-24 Thread Jeff 'japhy' Pinyan
On Jan 25, Stuart Clark said: >How do I add all the number between the "a" and the "z" >My output file only gives me the instances of the matching pattern and >not the total > >$total += /a([\d.]+)z/; A regex in scalar context returns whether or not it matched. If you want to get th

simple perl question

2002-01-24 Thread Stuart Clark
Hi Please help if you can. Kind Regards Stuart Clark How do I add all the number between the "a" and the "z" My output file only gives me the instances of the matching pattern and not the total # start of file test 3034364717283459322a15.32zM042001H 3045434551648534245a243.56zM

Re: Quick Perl Question

2001-06-19 Thread Me
> Got a combination that sort of works. It returns all the required > fields but truncates any line where $usd_unit or $units_usd has more > than 1 digit before the decimal point. There can be as many as (8) > digits before and (10) digits after the decimal point in both cases. > > Here's the r

Re: Quick Perl Question

2001-06-19 Thread Jack Lauman
Got a combination that sort of works. It returns all the required fields but truncates any line where $usd_unit or $units_usd has more than 1 digit before the decimal point. There can be as many as (8) digits before and (10) digits after the decimal point in both cases. Here's the regex I'm usi

Re: Quick Perl Question

2001-06-19 Thread Me
> The second loop is executing. The TEST statement worked. Ok. > The Currency part of the email has a fixed format that is never > deviated from: > > 1-3 $cur_sym > 4 space > 5-32 $cur_desc > 33-35 (3) spaces > 36-55 d8.d10 (.00) > 56-58 (3) spaces > 59-78 d8.d10 (.

Re: Quick Perl Question

2001-06-19 Thread Jack Lauman
The second loop is executing. The TEST statement worked. > This will surely print out, which shows that the regex > didn't match. In other words: > > ($cur_sym, $cur_desc, $usd_unit, $units_usd) = > /^([A-Z]{3})( [A-Za-z])+\s+(\d+\.\d+)\s+(\d+\.\d+)\s*$/; > > Doesn't match: > > US

Re: Quick Perl Question

2001-06-19 Thread Me
> printf OUTFILE "%s\,%s\,%s\,%s\,%s\,%s\,%s\n", > $date, $time, $tz, $cur_sym, $cur_desc, $usd_unit, $units_usd; > > close(INFILE); > close(OUTFILE); > print STDERR "\n"; > > 1; You seem to be misunderstanding one particular aspect of perl. Given the following: while () { # do some

Re: Quick Perl Question

2001-06-19 Thread Jack Lauman
currency.csv contains using the code below. The date has been adjusted from 2000-12-30 00:16:19 UTC to PST. The rest of the file is still not being processed. 2000-12-29,16:16:19,PST #!/usr/bin/perl # # cur2csv.pl # use strict; use vars qw($started); use vars qw($quote_date $cur_sym $cur

Re: Quick Perl Question

2001-06-19 Thread Me
> > ($year, $month, $mday, $hour, $minute, $second, $timezone) = > > /^Rates as of (\d+).(\d+).(\d+) (\d+):(\d+):(\d+) (\w+) (.*)$/; > > > > The following code is pointless: > > > > $year = $1; > > $month = $2; > > $mday = $3; > > $hour = $4; > >

Re: Quick Perl Question

2001-06-19 Thread Jack Lauman
Me wrote: > > Analysis of the code you attached. > > $quote_date = substr($_,0,79); > > The above line is pointless. > ---> Agreed. > The next couple lines are great: > > ($year, $month, $mday, $hour, $minute, $second, $timezone) = > $quote_date = /^Rates as of (\d+).(\d+).(\d

Re: Quick Perl Question

2001-06-19 Thread Nigel Wetters
1. $filename = 'foo.txt'; open(FH,"<$filename") or die "couldn't open $filename - $!"; while ($line = ){ print "$line matches\n" if ($line =~ /^USD /); } 2. while ($line=){ chomp $line; next unless $line; next if ($line =~ /^-+?$/); next if ($line =~ /^=+?$/); # only goo

Re: Quick Perl Question

2001-06-18 Thread Me
I forgot to explain. > > 1. I want to read in a text file and match any line that begins with > > three capital letters followed by a space. i.e. "USD " > > while (<>) { <> will read from the file(s) you specify on the command line when you run your perl script, ie perl myscript.pl

Re: Quick Perl Question

2001-06-18 Thread Me
> 1. I want to read in a text file and match any line that begins with > three capital letters followed by a space. i.e. "USD " while (<>) { /^[A-Z]{3} / and dostuff; # $_ contains line } > > 2. I need to ignore any blank lines, lines containing all "---", lines > containing a

Quick Perl Question

2001-06-18 Thread Jack Lauman
1. I want to read in a text file and match any line that begins with three capital letters followed by a space. i.e. "USD " How do you do that? 2. I need to ignore any blank lines, lines containing all "---", lines containing all "===". Again, how? Thanks in advance, Jack

Re: Perl question

2001-06-18 Thread perl
You could do this: $started=0; while() { $started = 0 if($_ =~ "" && $started); $started = 1 if($_ =~ "" && !$started); print $_ if($started); ## Will print in between the 's } Ryan On Mon, 18 Jun 2001, Jack Lauman wrote: > I wrote the following to read a daily ema

Perl question

2001-06-18 Thread Jack Lauman
I wrote the following to read a daily email that is is sent in ASCII and contains currency exchange rates. I want to search the file and look for and process all of the lines that follow it until it encounters a second . The code as it stands works, put it also processes all the garbage above a

RE: simple Perl question

2001-06-12 Thread Wagner-David
al Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 12, 2001 13:09 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: simple Perl question I have a very simple question.. i want to know how can I tell my program to go back to the beginning of t

Re: simple Perl question

2001-06-12 Thread Paul
--- [EMAIL PROTECTED] wrote: > I have a very simple question.. i want to know how can I tell my > program to go back to the beginning of the program depending on the > user input? > > Candice Not homework, is it? If so, you should really say that before posting the question. Even so, here's a h

  1   2   >