[11028] in Perl-Users-Digest
Perl-Users Digest, Issue: 4628 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 12 11:38:05 1999
Date: Tue, 12 Jan 99 06:00:17 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 12 Jan 1999 Volume: 8 Number: 4628
Today's topics:
Re: "Email this page to a friend" script <pdcawley@bofh.org.uk>
[INSTALL]Crypt-SSLeay and SSLeay on NT4 <stephen@boom.com>
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: CGI.pm tables dave@mag-sol.com
Re: CGI.pm Warnings dave@mag-sol.com
Re: CGI.pm Warnings austin@mathworks.com
Re: Database to database copy using DBI (Brian Macauley)
Re: help needed to find the size of a file using perl dave@mag-sol.com
Re: Making perl do tasks at specific times.. dave@mag-sol.com
Re: Making perl do tasks at specific times.. <pixel_@geocities.com>
Re: Newbie desperation <gmj@netaxis.com>
Re: perl cgi (win95) doesn't work with CGI.pm <clay@panix.com>
Re: perl cgi (win95) doesn't work with CGI.pm dave@mag-sol.com
Problem reading files from a remote server <mickaelk@milcse.cig.mot.com>
Problem with PerlScript on PWS <mat3q@erwin.phys.virginia.edu>
Sprite 3.21 flat file database problem <j@galaxystar-nospam.com>
Re: Trying to find day of week from date dave@mag-sol.com
Re: URGENT: Array of arrays... dave@mag-sol.com
Vexing Regex problem? <ifcl@chevron.com>
Re: Vexing Regex problem? <stuart@dune-concept.com>
Re: Vexing Regex problem? <partha@mihy.mot.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Jan 1999 11:53:20 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: "Email this page to a friend" script
Message-Id: <s7p4spwr9lb.fsf@windrush.elsevier.co.uk>
kirbyk@best.com (K. Krueger) writes:
> In article <77dafu$q00$3@client3.news.psi.net>,
> Abigail <abigail@fnx.com> wrote:
> >Christopher Schulte (usenet@schulte.org) wrote on MCMLVII September
> >MCMXCIII in <URL:news:369dbce8.258308513@news.schulte.org>:
> >:: Does anyone know of a script that will allow a website user to:
> >::
> >:: 1) be viewing a specific html file
> >:: 2) click on a link that says "email this page to a friend"
> >:: 3) enter their address, the friend's, and possibly a message
> >:: 4) have the page be sent to the specified person, with a static
> >:: message added to the end of the email
> >
> ><blink>Download Netscape Now</blink>
> >
> IE also has this capability - under File->Send->Page by Email.
>
> This is really not the kind of thing you should spend your coding time
> reinventing.
Unless you're after capturing a whole bunch of email addresses. But I
can't think why you'd want to do such a thing.
--
Piers
------------------------------
Date: Tue, 12 Jan 1999 21:03:18 +0800
From: Stephen <stephen@boom.com>
Subject: [INSTALL]Crypt-SSLeay and SSLeay on NT4
Message-Id: <369B4816.9E509470@boom.com>
Hi all,
I am looking for the solution on how to install "SSLeay-0.6.6b" onto my
system successfully. Here is my configuration:
MS-WIN NT4 SP3
MSVC5
Perl 5.00502
I followed the instruction described in "MICROSOFT" and "README" which
are come with the package. I got SSLeay compiled but the output program
failed on the test. The error messages given are as follows:
testpem
test crl ..\test\testcrl.pem
..\test\testcrl.pem and pem.out are different
0D 0A <<
diff at char 25 of 954
problems.....
Any suggestion would be greatly appreciated.
Regards,
Stephen
------------------------------
Date: Tue, 12 Jan 1999 11:24:19 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage916140241.2680@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 12 Jan 1999 11:31:59 GMT
From: dave@mag-sol.com
Subject: Re: CGI.pm tables
Message-Id: <77fbrf$kep$1@nnrp1.dejanews.com>
In article <77dehm$vns$1@nnrp1.dejanews.com>,
shaundoolan@my-dejanews.com wrote:
> When using CGI.pm to print my html, I'm having trouble printing values of
> variables inside the code for printing the table cell. I can't get it to
> evaluate these variables with the way I currently have it.....any suggestions?
>
> I'm trying to do the following:
>
> print Tr([td({-colspan=>'2'},
> ['Description:<br><i>$description</i><br>'])]);
Your string is in single quotes and single quotes don't interpolate variable
values. Best put any strings with variables in them in double quotes.
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 12 Jan 1999 12:16:09 GMT
From: dave@mag-sol.com
Subject: Re: CGI.pm Warnings
Message-Id: <77fee8$mcq$1@nnrp1.dejanews.com>
In article <77elqk$kid$1@eve.enteract.com>,
"Neil Edmondson" <neiled@enteract.com> wrote:
> I'm trying to clean up my error logs, I get a lot of this warning, why?
>
> [Mon Jan 11 22:46:40 1999] member_v1.pl: Ambiguous use of values => resolved
> to "values" => at member_v1.pl line 862.
> [Mon Jan 11 22:46:40 1999] member_v1.pl: Ambiguous use of values => resolved
> to "values" => at member_v1.pl line 865.
> [Mon Jan 11 22:46:40 1999] member_v1.pl: Ambiguous use of values => resolved
> to "values" => at member_v1.pl line 890.
>
> Here's some of the code
>
> sub Validate_Customer {
> my ($CGI,$customerdb,$update) = @_;
> # $update = false means this is an "add" so check for pre-existence
> of user
> my @error;
> my $nc = $CGI->param('first');
> my $uc = "\u$nc";
> $CGI->param(-name=>'first', -values=>$uc); #<<<<LINE # 862
> $nc = $CGI->param('last');
> $uc = "\u$nc";
> $CGI->param(-name=>'last', -values=>$uc); #<<<<LINE # 865
>
> push (@error, "First name required") if (!$CGI->param('first'));
> push (@error, "Last name required") if (!$CGI->param('last'));
>
> etc. etc
>
> I'm also using
>
> unshift(@INC, "../CommonModules/CGI.pm-2.43");
values is the name of a Perl function. You're using it as a hash key. Perl
has to work out what's going on. In this case it guesses correctly, but it
outputs a warning to let you know that it's not 100% sure that it got it
right.
To get round it, put values in single quotes when using it as a hash key.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jan 1999 13:59:11 GMT
From: austin@mathworks.com
Subject: Re: CGI.pm Warnings
Message-Id: <77fkff$q26$1@turing.mathworks.com>
In comp.lang.perl.modules dave@mag-sol.com wrote:
> To get round it, put values in single quotes when using it as a hash key.
Or use -value instead of -values .
- Austin
------------------------------
Date: Tue, 12 Jan 1999 12:51:20 GMT
From: bmacaula@nortelnetworks.com (Brian Macauley)
Subject: Re: Database to database copy using DBI
Message-Id: <369b4441.2687460@47.192.4.19>
Does anyone have an example script, to copy data from one database to
another database using DBI?
I am trying to write a simple database warehousing application, but
I'm a novice when it comes to Perl and DBI
Regards, Brian
------------------------------
Date: Tue, 12 Jan 1999 11:51:35 GMT
From: dave@mag-sol.com
Subject: Re: help needed to find the size of a file using perl
Message-Id: <77fd07$lbd$1@nnrp1.dejanews.com>
In article <369A4F4C.E132A53B@remarq.com>,
amit@remarq.com wrote:
> I need to know the size of a file. How can I do so using perl ?
> Please, help me with some sample code.
> Appreciate your help.
perldoc -f stat
=item stat FILEHANDLE
=item stat EXPR
=item stat
Returns a 13-element array giving the status info for a file, either the
file opened via FILEHANDLE, or named by EXPR. If EXPR is omitted, it
stats $_. Returns a null list if the stat fails. Typically used as
follows:
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 12 Jan 1999 12:20:44 GMT
From: dave@mag-sol.com
Subject: Re: Making perl do tasks at specific times..
Message-Id: <77femq$mna$1@nnrp1.dejanews.com>
In article <19990112005133.07277.00011762@ng113.aol.com>,
firstagyg@aol.com (FirstAGYG) wrote:
> Hello, im fairly new to the group and Perl itself. I have 2 perl books, and i
> cant seem to find any info on how to schedual perl to do things at specific
> times, without any intervention from me or a user. Does anyone know of the
> tecnique? Thanks a bunch.
Not really a Perl question. Probably more to do with your OS. If you're using
Unix (or Linux) then look for information on crontab. If you're on some sort
of Windows, then get a real OS.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jan 1999 13:57:33 +0100
From: Pascal Rigaux <pixel_@geocities.com>
Subject: Re: Making perl do tasks at specific times..
Message-Id: <4wk8ysodhe.fsf@dre2.polytechnique.fr>
> job - of course, you need to have admin. privileges. If you don't, try running
> the script in an infinite-loop and check for the time (`date` or the time(),
> localtime() cmds of PERL)
>
Please, no infinite-loop, it would eat the whole CPU :((
Just use sleep with the number of seconds you want to wait.
Pixel.
------------------------------
Date: Tue, 12 Jan 1999 11:01:23 +0000
From: "Geir Magnusson Jr." <gmj@netaxis.com>
Subject: Re: Newbie desperation
Message-Id: <369B2B83.F38796CD@netaxis.com>
Thomas Klinger wrote:
>
> I'm really desperated!
> I already read "Learning Perl" twice but I can't get into this stuff.
> As help I also bought "Programming Perl" and "The Perl Cookbook" but
> this language is still secret to me.
> I tried to program those examples to understand the syntax but maybe
> I'm to stupid for PERL.
> Maybe I give up.
Don't give up! Start with a small problem that you have to solve. I
don't know what you do, but anything would be a good start. Just a
small simple problem that you have to do, and would normally do with a
shell script. Then, give it a try in perl. If you are having problems,
consult the books you bought (they are great...), consult the FAQ's
(they are great...) and then if all else fails, ask here.
geir
[courtesy cc to t.klinger@mobilkom.at]
--
Geir Magnusson Jr. gmj@netaxis.com
Any technology sufficiently advanced is | Zen of mac development: "be
indistinguishable from a Perl script. | at peace while rebooting"
------------------------------
Date: Tue, 12 Jan 1999 03:32:55 -0800
From: Clay Irving <clay@panix.com>
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <369B32E7.B892E168@panix.com>
Edwin Litterst wrote:
>>> A small demo perl script works nice if called from the command line
>>> but doesn't return anything if CGI.pm is included:
>>>
>>> use Cgi;
>>> print "Content-Type: text/plain\n\n";
>>> print "Hello, World!\n";
>>>
>>> The directory which contains the libs is part of the @INC.
>>> I read the CGI FAQ as well as the Win32 FAQ but nothing seems to
>>> apply.
>>
>>use Cgi;
>>OR
>>use CGI;
>
> I tried both - and also other modules (just to see whether loading
> them would change anything, but only CGI shows this behavior).
Only one is correct -- That's `use CGI;'
>>Why are you wanting to use the CGI.pm, when you already have have the
>>Content-type for a simple print test?
>
> Because this is more or less the smalles example to show this strange
> behavior.
> Of course I want to do more (developing some of my CGI scripts under
> win).
Oh, the pain -- Perl on Windows 95... Nonetheless, this is the version I
have:
C:\tmp>\perl\bin\perl -v
This is perl, version 5.004_02
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.
This is example program using CGI.pm:
C:\tmp>more foo.pl
#!/usr/local/bin/perl -w
use CGI qw(:standard);
$time = localtime;
print header,
start_html(-title=>'Time Page', -author=>'clay@panix.com'),
"time is $time",
end_html();
It prints this:
C:\tmp>\perl\bin\perl foo.pl
Ambiguous use of title => resolved to "title" => at foo.pl line 8.
(offline mode: enter name=value pairs on standard input)
Content-type: text/html
(press CTRL-Z)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>Time Page</TITLE>
<LINK REV=MADE HREF="mailto:clay@panix.com">
</HEAD><BODY>time is Tue Jan 12 03:25:41 1999</BODY></HTML>
C:\tmp>
Give it a try on your system.
--
Clay Irving
clay@panix.com
------------------------------
Date: Tue, 12 Jan 1999 11:57:07 GMT
From: dave@mag-sol.com
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <77fdai$lfq$1@nnrp1.dejanews.com>
In article <369a6b07.2599230@news>,
el@fiz-karlsruhe.de (Edwin Litterst) wrote:
> A small demo perl script works nice if called from the command line
> but doesn't return anything if CGI.pm is included:
>
> use Cgi;
> print "Content-Type: text/plain\n\n";
> print "Hello, World!\n";
>
> The directory which contains the libs is part of the @INC.
> I read the CGI FAQ as well as the Win32 FAQ but nothing seems to
> apply.
Curse Bill Gates for teaching a generation of users that case doesn't matter!
Try:
use CGI;
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 12 Jan 1999 14:33:18 +0200
From: Mickael Khalfa <mickaelk@milcse.cig.mot.com>
Subject: Problem reading files from a remote server
Message-Id: <369B410E.5867E35C@milcse.cig.mot.com>
This is a multi-part message in MIME format.
--------------AC5114DAAE4691D397D60648
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I'm a new perl user in Windows NT, and I have some problems to write a program
that can read files from a UNIX server which is defined in Network Neighborhood.
I would like to use " chdir " to read files from the following path:
\\Nebula\projects.
(The server's name is Nebula)
By writing, for example:
$path = " \\Nebula\projects " ;
if (chdir $path)
{ ...
...
}
But the function chdir doesn't recognize the path as it's written above.
Any one got any idea to make my program recognize the right path ?
--------------AC5114DAAE4691D397D60648
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Mickael Khalfa
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Mickael Khalfa
n: Khalfa;Mickael
org: Motorola Israel Ltd. Cellular Infrastruture Group
email;internet: mickaelk@milcse.cig.mot.com
title: Systems Engineer
tel;work: +972-3-565-96-95
tel;home: +972-9-882-07-31
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------AC5114DAAE4691D397D60648--
------------------------------
Date: Tue, 12 Jan 1999 07:18:32 -0500
From: Mike Timmins <mat3q@erwin.phys.virginia.edu>
Subject: Problem with PerlScript on PWS
Message-Id: <369B3D98.2825FFDF@erwin.phys.virginia.edu>
Hi,
I'm using PerlScript in active server pages and running them with MS
Personal Web Server as a development platform. Problem is, the scripts
only run correctly the first time through and then won't run again until
I restart the server. This problem seems to mainly affect the
Date::Manip module. Any suggestions?
Thanks
--
***********************************************************
Mike Timmins voice: (804) 924-6800
Department of Physics fax: (804) 924-4576
University of Virginia email: mat3q@virginia.edu
Mailing Address:
Jesse Beams Laboratory
382 McCormick Rd.
Charlottesville, VA 22903
***********************************************************
------------------------------
Date: 12 Jan 1999 13:01:37 GMT
From: "Joe" <j@galaxystar-nospam.com>
Subject: Sprite 3.21 flat file database problem
Message-Id: <01be3e29$fd7d9680$c5cb9895@brignola-jm.southernct.edu>
I've upgraded to the 3.21 version of Sprite.pm and I'm having a problem
with the select clause with a where statement. It seems if your field name
starts with 'LE' like in a field name 'LEASE' and you use it in a where
statement, the select clause never works. I'm wondering if anyone ran into
this problem? I think it is related to the translation of 'LE' to '<=' but
don't know how to fix?
Any help would be appreciated.
Joe....
--
----
------------------------------
Date: Tue, 12 Jan 1999 11:45:34 GMT
From: dave@mag-sol.com
Subject: Re: Trying to find day of week from date
Message-Id: <77fcku$kva$1@nnrp1.dejanews.com>
In article <369A4035.41561C2@antispam.com>,
Thomas Merlin <antispam@antispam.com> wrote:
> Hello,
>
> I'm trying to find which day matches a date.
> Example : I have 01/07 in a text file I'm parsing, I'd like to get the
> information that that date is a Thursday.
>
> I only know how to get the current date's day, not the day of a date I
> give as an argument.
>
> I know this has to do with timelocal and/or localtime but I'm lost.
It's probably easier if you use something like the Date::Manip module from
CPAN, but if you're stuck with standard Perl then the following will work.
#!/usr/local/bin/perl -w
use strict;
use Time::Local;
my @days = qw/Sun Mon Tues Wednes Thurs Fri Satur/;
my $date = '01/07/1999';
my ($d, $m, $y) = split(/\//, $date);
my $day = (localtime(timelocal(0,0,0,$d,$m-1,$y-1900)))[6];
print "$days[$day]day\n";
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 12 Jan 1999 12:07:37 GMT
From: dave@mag-sol.com
Subject: Re: URGENT: Array of arrays...
Message-Id: <77fdu8$lul$1@nnrp1.dejanews.com>
In article <3699f2e9.37866128@news.ukonline.co.uk>,
corruptor@terry.org.uk wrote:
> Please Help! I'm getting desperate...
>
> I'm trying to create an array of arrays, and can't figure out the
> syntax to do so.
>
> If I have a (say) three element array ($row[0],$row[1],$row[2]) how do
> I assign this array to (say) $parent_array[0]?
>
> I ideally want to index $parent_array[0] to pull out the $row array at
> a later date.
You'll find everything you need to know in the docs that came with Perl.
Try
perldoc perlref
perldoc perllol
perldoc perldsc
for a start.
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 11 Jan 1999 17:53:09 -0800
From: "Ian Clark" <ifcl@chevron.com>
Subject: Vexing Regex problem?
Message-Id: <77e9ug$39l@hsun27.chevron.com>
I am attempting to parse an address line which contains the following:
Ian+Clark$%%Chevron+Information+Technology$%%CA+94583
where + is actually chr(32)
$ is chr(10) and
% is chr(9)
Can some kind peson enlighten me how I can pick out the "Ian Clark" as (say)
address 1..."Chevron Information Technology" as address 2 and so on...
Thanks.
Ian.
------------------------------
Date: Tue, 12 Jan 1999 13:33:48 +0100
From: "Stuart Thorn" <stuart@dune-concept.com>
Subject: Re: Vexing Regex problem?
Message-Id: <77ffef$qvg$1@buggy.easynet.fr>
A simple split() should do the trick, non?
1: $_ = q'Ian+Clark$%%Chevron+Information+Technology$%%CA+94583';
2: $_ =~ s/\+/ /g;
3: my @fields = split( /\$%%/, $_ );
4: my $index = 0;
5: foreach( @fields ) {
6: print "Field " . $index++ . "> " . $_ . "\n";
7: }
Line 2 might not be the right option for you, but gets to the result
mentioned in post. Notice the q'' to stop interpolation that "" or
qq'' would infer.
HTH,
Stuart Thorn
Dune Concept, Paris, France
----------
Ian Clark a icrit dans le message <77e9ug$39l@hsun27.chevron.com>...
>I am attempting to parse an address line which contains the following:
>
>Ian+Clark$%%Chevron+Information+Technology$%%CA+94583
>
>where + is actually chr(32)
> $ is chr(10) and
> % is chr(9)
>
>Can some kind peson enlighten me how I can pick out the "Ian Clark" as
(say)
>address 1..."Chevron Information Technology" as address 2 and so on...
>
>Thanks.
>Ian.
>
>
>
------------------------------
Date: Tue, 12 Jan 1999 18:28:23 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Ian Clark <ifcl@chevron.com>
Subject: Re: Vexing Regex problem?
Message-Id: <369B46EF.9997620A@mihy.mot.com>
Hi,
If you are very sure that these characters always occur, you may try something
like
> Ian+Clark$%%Chevron+Information+Technology$%%CA+94583
/(.*?)\x09{2}(.*?)\x09{2}(.*?)/
> where + is actually chr(32)
> $ is chr(10) and
> % is chr(9)
> Can some kind peson enlighten me how I can pick out the "Ian Clark" as (say)
> address 1..."Chevron Information Technology" as address 2 and so on...
$address1 = $1; # "Ian Clark"
$address2 = $2; # "Chevron Information Technology"
I think you need not worry about the 'chr(32)' character - its the space
character which you want anyway.
HTH
-Partha
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4628
**************************************