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
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/
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
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';
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
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
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://
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
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
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
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.
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
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:
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
""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
"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
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
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
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
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
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
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
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
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
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
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
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
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
-
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
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
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
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
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.
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
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
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
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
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
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
>
> 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
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
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
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
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
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
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
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
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
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
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
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
--- 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
.--[ 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.
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
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|
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
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
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
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
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
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
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
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
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
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 -
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
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
: 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
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
>
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
>
>
>
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]
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
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
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
> -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
[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
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
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.
[
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
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
/;
$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
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
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
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
> 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
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
> 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 (.
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
> 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
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
> > ($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;
> >
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
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
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
> 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
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
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
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
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
--- [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 - 100 of 107 matches
Mail list logo