[7230] in Perl-Users-Digest
Perl-Users Digest, Issue: 855 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 12 18:07:56 1997
Date: Tue, 12 Aug 97 15:00:25 -0700
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 Aug 1997 Volume: 8 Number: 855
Today's topics:
Re: any SMTP servers require domain name (Ed Vielmetti)
Re: CGI Script that searches a web sites (Jo Ann)
Re: changes between unix and NT <petri.backstrom@icl.fi>
Comparing Text <cody@cs.unca.edu>
Re: complex argument passing <dhoover@textwise.com>
Enabling Perl on the MS Personal Web Server. (Box Holder)
Re: foreach problem (Tad McClellan)
getting variables ("Rick Bauman")
good examples of perl snmp use? <mheller@extraactive.net>
Re: Got an error in DBM (Mike Heins)
Re: How to open a file to a variable instead of an arra <petri.backstrom@icl.fi>
Re: how to use format to build strings (Mike Stok)
Re: how to use format to build strings (Ed Vielmetti)
Re: Large Data Base question (Tim Smith)
Re: Large Data Base question (Ed Vielmetti)
Re: NEWBIE help with sybperl (Matthew D. Healy)
passwords? <irz@eonet.com>
passwords? <irz@eonet.com>
Re: Perl Interface to /etc/passwd (Bob)
perl process problem <wzhou@ai.iit.nrc.ca>
Re: perl process problem (Mike Stok)
Perl <jester@francomedia.qc.ca>
Post Problem <mhawes@erols.com>
Re: Problem with 5.004_01 <rootbeer@teleport.com>
Puting pattern in a variable <vlad@teleglobe.ca>
Re: Puting pattern in a variable (Mike Stok)
Re: Puting pattern in a variable (brian d foy)
USENIX Conf on Domain-Specific Languages (DSL) - Confer (Jackson Dodd)
Re: Walking the tree <che@imsa.edu>
Re: Walking the tree <rootbeer@teleport.com>
Re: Why won't this work!?! (brian d foy)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Aug 1997 21:08:02 GMT
From: emv@umich.edu (Ed Vielmetti)
Subject: Re: any SMTP servers require domain name
Message-Id: <5sqjbi$ej4$1@hawk.branch.com>
: <serginho@alpha.hydra.com.br> wrote:
: >always's OK because I've a domain name). The internet provider send me a
: >dynamic IP. I'd like to know if it's possible to emulate a domain name for
: >the SMTP servers that require one.
: I'd suggest using the Net:SMTP module, availabe at your local CPAN
: site.
In particular, Net:SMTP will
Hello - SMTP requires that you identify yourself. This
option specifies a string to pass as your mail domain.
If not given a guess will be taken.
Most servers will take a first approximation at a domain name and go on accepting
their mail, so even if it's "wrong" you'll still get the mail through.
Ed
Edward Vielmetti
emv@fv.com
emv@umich.edu
------------------------------
Date: Tue, 12 Aug 1997 14:56:55 -0400
From: celery@bway.REMOVE.net (Jo Ann)
Subject: Re: CGI Script that searches a web sites
Message-Id: <celery-1208971456550001@dyn34.access1.nyc.i-2000.net>
You might try Selena Sol's public domain scripts at
http://www.chaos-inc.com/selena/
They have some bugs, but for the most part are easy to understand
and install.
Good Luck!
In article <01bc9c5d$a9e3c720$2956dacd@admin>, "Michael A Dustin"
<cybrghst@mail.tir.com> wrote:
> Hi,
>
> Can anyone point me to a CGI script that will search a personal
> web site and return the results.
> thanx
> --dusty
------------------------------
Date: Tue, 12 Aug 1997 20:47:36 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: changes between unix and NT
Message-Id: <33F0A1B8.752F@icl.fi>
Carine Boneh wrote:
>
> I have to make changes in a perl program written for unix platforms in
> order to make it work under Windows NT.
> I am looking for a site were it is explained wich sentences to replace
> with wich ones, or just what will not work under NT.
> I've looked in the faq of Evangelo and I couldn't find what I really
> wanted. If somebody could tell me such a site exists and were I could find
> it...
I don't know of such a site.
Just look for things with `` (back-ticks), system(), exec()
and fork() calls, run it with -w on the commmand line and
put the line "use strict;" (if it already isn't there) at
the beginning of your script, and proceed from there.
If you encounter something that doesn't appear to work,
come back with a more specific question.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Tue, 12 Aug 1997 16:19:15 -0400
From: Kelby Cody <cody@cs.unca.edu>
Subject: Comparing Text
Message-Id: <33F0C542.C7BF2D56@cs.unca.edu>
I was wondering if anyone could help me with comparing text files. I
want to write a perl script for the web that reads an existing text
file and compares it to answers people submit through a form. Any
help would be greatly appreciated.
KC
cody@cs.unca.edu.remove-this
------------------------------
Date: Tue, 12 Aug 1997 16:58:15 -0400
From: Dean Hoover <dhoover@textwise.com>
Subject: Re: complex argument passing
Message-Id: <33F0CE67.5705@textwise.com>
Tom Phoenix wrote:
>
> On Tue, 12 Aug 1997, Dean Hoover wrote:
>
> > union semun {
> > int val;
> > struct semid_ds *buf;
> > ushort *array
> > } arg;
> >
> > I need to set the "val" member of the union and pass
> > it to the semctl (perl) function. How do I do it???
>
> I think you're looking for Perl's pack function, documented in the
> perlfunc(1) manpage. Hope this helps!
I tried that, maybe its just that semctl is not implemented
properly:
die "can SETVAL[0]\n" unless defined semctl($id, 0, &SETVAL, pack("i",
$initval));
this is the way it reads in C (Stevens):
semctl_arg.val = initval;
if (semctl(id, 0, SETVAL, semctl_arg) < 0)
err_sys("can SETVAL[0]");
what is the difference?
Dean Hoover
------------------------------
Date: Tue, 12 Aug 1997 14:10:25 -0700 (PDT)
From: box16@rocketmail.com (Box Holder)
Subject: Enabling Perl on the MS Personal Web Server.
Message-Id: <19970812211026.11843.rocketmail@send1.rocketmail.com>
Does anybody know if the MS Personal Web Server can run Perl scripts,
and if so how does one enable it to do so?
_____________________________________________________________________
Sent by RocketMail. Get your free e-mail at http://www.rocketmail.com
------------------------------
Date: Tue, 12 Aug 1997 07:39:37 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: foreach problem
Message-Id: <9ilps5.8j1.ln@localhost>
Sami Sandqvist (samiss@lehtori.cc.tut.fi) wrote:
: I am having a problem with foreach. In the code I have attached there are
: two lines marked with ####HERE. The first line prints several pages of
: keys, but the second line is executed only once. What am I doing wrong?
: I did not post the file that should be processed with it because it is
: quite long.
[ snip ]
: print STDERR keys %luokat; ####HERE
: foreach $ali (keys %luokat) {
: print STDERR "!\n"; ####HERE
: $temp = $ali;
: do {
: if ( $temp =~ /\)$/ ) {
: $temp =~ s/\([^\)]+\)$//;
: }
: else {
: $temp =~ s/.$//;
: }
: $temp =~ s/\.\.\.$//;
: $temp =~ s/\.$//;
: $temp =~ s/\*$//;
: $temp =~ s/\'$//;
: if (exists ($luokat{$temp})) {
: push (@{$luokat{$temp}},$ali);
: print STDERR "Jee\n";
: last;
^^^^ ####HERE ;-)
This exits the foreach{}, not the do{}. Because do{} is not really a
loop control construct (although it can be used to control loops,
go figure...)
I suppose you could fake it by saying:
$temp = '';
instead of
last;
so that the condition below will fail, bringing you back to
the top of the foreach...
: }
: } while (length($temp) != 0);
: }
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 12 Aug 1997 09:03:39 +0000
From: rick@internetx.net ("Rick Bauman")
Subject: getting variables
Message-Id: <19970812125604.AAA29973@rick.internetx.net>
I have RTFM's and faq's and camel, but I still can't figure this one
out . . . maybe someone out there can help.
I need to read in a flatfile text database that looks similar to this
somename somerandomtext
secondlineoftext
thirdline of text
somename some random text
second line of text
thirdline of text
fourthlineof text
the records may be of different lengths, and there are about 1200
records
I need to search for a string and. . .
if it is not present return a value of "0"
if it shows up in the "somename" field return a value of "1"
if it shows up on the first line of the record, but not in the
"somename" portion return a value of "2"
if it shows up in any other line of text, in any record return a value of "3"
if it shows up more than once in any record return a value of "4"
and if it shows up in more than one record return a value of "5"
and in all cases return the "somename" of the record in which it was
found . . . . does anybody have an idea where I can find some good
info on how to do this?
thanks
Rick
rick@internetx.net
------------------------------
Date: Tue, 12 Aug 1997 16:30:59 -0400
From: Michael Heller <mheller@extraactive.net>
Subject: good examples of perl snmp use?
Message-Id: <33F0C803.73C3@extraactive.net>
hello,
i am looking for sample scripts in which the author uses snmpget
(SNMP_Session.pm actually) as i really don't know where to start with my
own script.
thanks in advance,
Michael
------------------------------
Date: 12 Aug 1997 20:19:22 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Got an error in DBM
Message-Id: <5sqgga$ada$1@vixen.cso.uiuc.edu>
Morten Simonsen (mortensi@idt.ntnu.no) wrote:
: Mike Heins <mheins@prairienet.org> wrote:
: : Morten Simonsen (mortensi@idt.ntnu.no) wrote:
:
: : It means you are trying to write more key/value data
: : than your DBM can handle. NDBM and SDBM are often limited
: : to 1024 or 4096 bytes.
:
: That explains it. I can have very many values for each key, and that makes the
: error. But does it have to be this way? Does other DB-formats support larger
: entries?
:
: : : $$databaseref{$key} = $attributelist;
: : This looks doubtful. I you have used tie(), you should
: : be able to set the tied variable directly without using a reference.
:
: Yes, I am still a newbie, but I think I will start to use the tie() and
: the other object-oriented functions of perl when I return to the work
: on this project. But would it make any difference in this particular
: problem?
DB_File and GDBM both handle larger sizes (unlimited) -- they require
rebuilding perl to use, unless you already have them. You should if you
are on Linux or BSD, likely not on others.
These one liners should tell you whether you have them:
perl -e 'require GDBM_File and print "I have GDBM.\n"'
perl -e 'require DB_File and print "I have Berkeley DB.\n"'
--
Regards,
Mike Heins
This post reflects the
opinion of my employer.
------------------------------
Date: Tue, 12 Aug 1997 21:12:18 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: How to open a file to a variable instead of an array?
Message-Id: <33F0A782.4273@icl.fi>
bz7347275@ntu.edu.sg wrote:
>
> How can i open a file to a variable instead of an array?
>
> Thks.
I'm not entirely sure I understand what you're after,
but do you mean that you want to store the contents
of a file in a scalar variable instead of an array
variable?
Or do you want to read the files line by line?
If the former, do:
local( *FILEHANDLE );
my @content_in_array;
my $content_in_scalar;
open( FILEHANDLE, 'filename' ) or
die "error opening file ($!)";
@content_in_array = <FILEHANDLE>;
$content_in_scalar = join( '', @content_in_array );
close( FILEHANDLE );
If the latter, do:
local( *FILEHANDLE );
open( FILEHANDLE, 'filename' ) or
die "error opening file ($!)";
while( <FILEHANDLE> ) {
# every line stored in special
# variable $_ with which you
# can do whatever you please
}
close( FILEHANDLE );
Search also the Perl documentation (perlvar)
for the special variable $/ in case you want
to read the file paragraph by paragraph (where
$/ is the paragraph delimiter [that you can
change, if you wish]).
I'd also suggest you take a look at the book
reviews at
http://www.perl.com/perl/critiques/index.html
and consider purchasing one (I'd recommend
"Learning Perl, 2nd Edition" and "Programming
Perl, 2nd Edition").
And if you haven't come across is yet, see
also the
http://www.perl.com/FAQ/
pages.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: 12 Aug 1997 19:01:07 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: how to use format to build strings
Message-Id: <5sqbtj$33p@news-central.tiac.net>
In article <33F0AE69.2F1C@rentwks1.golden.csc.com>,
Ian Duplisse <duplisse@rentwks1.golden.csc.com> wrote:
>In Perl5, how can one use format statements to construct a string? I
>know write() uses a filehandle, but are there any tricks to write to a
>buffer using formats? I know there is sprintf, but that doesn't provide
>the same formatting capabilities.
Does formline (see the perlfunc manual page) seem to do what you want?
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 12 Aug 1997 21:21:19 GMT
From: emv@umich.edu (Ed Vielmetti)
Subject: Re: how to use format to build strings
Message-Id: <5sqk4f$ep8$1@hawk.branch.com>
Ian Duplisse (duplisse@rentwks1.golden.csc.com) wrote:
: In Perl5, how can one use format statements to construct a string? I
: know write() uses a filehandle, but are there any tricks to write to a
: buffer using formats? I know there is sprintf, but that doesn't provide
: the same formatting capabilities.
The Camel book has the answer (p 127) which yields a subroutine
called "swrite", which exposes the secret that write() just uses
an internal routine called formline() to do its dirty work.
Ed
Edward Vielmetti
emv@umich.edu
------------------------------
Date: 12 Aug 1997 11:58:41 -0700
From: trs@azstarnet.com (Tim Smith)
Subject: Re: Large Data Base question
Message-Id: <5sqbp1$g5b@web.azstarnet.com>
[ Posted and Mailed ]
In article <33F06613.8995E057@huron.net>, Stephen Hill <buck@huron.net> wrote:
>I am going to have a large database, about 1 gig. Would perl be
>appropriate to use to search this database or would some other language
>be more appropriate?
In general, Perl is excellent for interfacing with a database package.
Perl can interface with all of the major relational databases - Oracle,
Sybase, Informix, mSQL, PostgreSQL, etc. It would be way too much work
to write a good DB package in Perl from scratch, when there are so many
available. I would say, use PostgreSQL or mSQL or something for the
database, use Perl for the wrapper program that queries the database
and handles the input and output from the user.
Tim
------------------------------
Date: 12 Aug 1997 20:41:46 GMT
From: emv@umich.edu (Ed Vielmetti)
Subject: Re: Large Data Base question
Message-Id: <5sqhqa$dl0$1@hawk.branch.com>
Stephen Hill (buck@huron.net) wrote:
: I am going to have a large database, about 1 gig. Would perl be
: appropriate to use to search this database or would some other language
: be more appropriate?
You really have a more fundamental question: is the file system
layout you have planned to store 1 gig worth of data appropriate
for every use you plan for the data, or would you be better off
storing the data in a database?
Perl is a perfectly excellent reporting language and interfaces
well with most every database system.
Ed
------------------------------
Date: Tue, 12 Aug 1997 15:21:03 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: NEWBIE help with sybperl
Message-Id: <Matthew.Healy-1208971521030001@pudding.med.yale.edu>
In article <yhfn2mnk02q.fsf@ascend.com>, Kevin Lambright
<kevinl@ascend.com> wrote:
...
> from CPAN and read through all of the instructions. We have the Sybase
> interface statically linked into our perl executable, although I believe
> you can have it so that it uses shared libraries as well.
Note: for a CGI application, you'll probably want to use a statically-
linked Sybperl executable, because the shared-library version needs
an environment variable telling it the library path, and webservers
give CGI scripts an intentionally-impoverished environment.
Some Sybase-specific variables -- such as SYBASE and DSQUERY -- are
also missing, but you can specify those in your db_login calls.
Big problem with the LD_LIBARY_PATH variable is Perl needs it ON STARTUP
to load the library BEFORE YOUR CODE GETS TO PLAY WITH THE ENV ASSOCIATIVE
ARRAY. So either you install Sybperl with STATIC linking or else you
write a little wrapper that sets the required ENV then launches the
actual script, or else you hack your webserver to provide the required
ENV information. You gotta do something with a CGI application or it
will die on the 'require sybperl' line.
Also, remember that a Sybperl program, like any OPEN-CLIENT application,
must in general have multiple loops, something like the following:
# First call db_login, db_connect, db_user, etc. to connect and
# select a database to use.
# Next, do whatever you do to generate your SQL string.
&dbcmd( $QueryText ) || die "Error in dbcmd.\n" ;
&dbsqlexec || die "Error in dbsqlexec.\n" ;
$result = &dbresults($dbproc);
while ($result == 1) #result returns 1 for success
{
while (%row = &dbnextrow($dbproc, 1)) #get the rows
{
#now you have the contents of the row as an
#array %row, keyed on fieldnames, values are
#contents. So do whatever processing you
#want to do on each row.
}
$result = &dbresults($dbproc); #try to get another results set
}
}
&dbclose($dbproc);
This is based on actual code, using the older DB_LIBRARY interface;
I've no experience with the newer CT_LIBRARY stuff.
Once you get this working, the Sybase interface part is pretty much
cut-and-dried. Most of your work will go into (1) generating the SQL
queries and (2) processing the results. In a CGI application updating
is tricky because HTTP is stateless and lacks any concept of current
connection, which makes things like session state, transactions, and
locking somewhat problematic. Cookies can help in some cases.
Pointers to some possibly-helpful resources relevant to web-database
programming can be found at
http://ycmi.med.yale.edu/~healy/cgilinks.html
--------
Matthew.Healy@yale.edu http://ycmi.med.yale.edu/~healy/
As of 7 Aug 1997, only 876 days until Y2K....
Any person with a phone line can become a town crier with a voice
that resonates farther than it could from any soapbox.
--The US Supreme Court, overturning the Communications Decency Act
------------------------------
Date: Tue, 12 Aug 1997 14:32:11 -0700
From: IRZ Consulting <irz@eonet.com>
Subject: passwords?
Message-Id: <33F0D65B.1284F96E@eonet.com>
I would like to implement a site with password protection, but unlike
most others, I want each user to go to a different page. Sort of like a
personal directory for each user. I need a password script which will
check the username and password and will then redirect the user to the
correct location, depending on their username. If anyone can help,
please mail me.
Robin Ziari
irz@eonet.com
Thanks yo.
------------------------------
Date: Tue, 12 Aug 1997 14:32:02 -0700
From: IRZ Consulting <irz@eonet.com>
Subject: passwords?
Message-Id: <33F0D651.D38B3E72@eonet.com>
I would like to implement a site with password protection, but unlike
most others, I want each user to go to a different page. Sort of like a
personal directory for each user. I need a password script which will
check the username and password and will then redirect the user to the
correct location, depending on their username. If anyone can help,
please mail me.
Robin Ziari
irz@eonet.com
------------------------------
Date: Tue, 12 Aug 1997 20:56:59 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: Perl Interface to /etc/passwd
Message-Id: <33f2cc94.96392637@netnews.voicenet.com>
Benjamin Holzman <bholzman@mail.earthlink.net> wrote:
>No. The reason the crypt algorithm uses a salt is to make "dictionary"
>attacks much harder. If you think about it, if the salt was static, you
>could just take a standard hackers' dictionary and run each entry
>through a crypt algorithm using that static salt. Then you'd be able to
>crack m crackable passwords generated by such a crippled crypt VERY
>quickly. (in O(m * log n), where n is the number of words in your
>hackers' dictionary.) By using a salt, however, a cracking algorithm has
>to run every entry in the hackers' dictionary through a crypt for each
>and every password it's trying to crack. This is quite a bit slower,
>O(m*(n/2)). The salt HAS to be in the password itself, or there'd be no
>way to check the password:
I find this stuff very interesting. If I understand you,
because the salt varies, you run crypt on every word for each account.
With a constant salt, you would run crypt on every word only once.
Assume that the crypt routine takes some significant portion on time,
this increases the amount of time to hack into one account in a list
of accounts.
I suppose this is getting off track, but how is this done in
.htpasswd? It contains just a username and encrypted text. Unless...
perhaps that encrypted text also has the salt (i.e., the first 4 (or
any number) characters are the salt, or even the username itself is
the salt)?
I guess I'll probably be told to go look it up elsewhere, huh?
:)
Bob
--
- Bob
http://www.voicenet.com/~bbell
xxbbell@voicenet.com
remove x's to reply
------------------------------
Date: Tue, 12 Aug 1997 15:04:08 -0400
From: Wei Zhou <wzhou@ai.iit.nrc.ca>
Subject: perl process problem
Message-Id: <33F0B3A8.217E@ai.iit.nrc.ca>
I'm having a problem with a perl multiprocesses program.
my perl program usually stops right at fork or wait with no error
message.
does anyone know what's wrong?
thanks in advance.
------------------------------
Date: 12 Aug 1997 20:11:29 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: perl process problem
Message-Id: <5sqg1h$6qe@news-central.tiac.net>
In article <33F0B3A8.217E@ai.iit.nrc.ca>,
Wei Zhou <wzhou@ai.iit.nrc.ca> wrote:
>my perl program usually stops right at fork or wait with no error
>message.
>
>does anyone know what's wrong?
Maybe it's doing what you told it to, and aren't clear on something. Note
that an undefined return from fork means that it failed, and that would
mean that a future wait would wait for a non existant process to
terminate. Does this work as you expect it to:
#!/usr/local/bin/perl -w
if ($pid = fork) {
print "in parent, waiting...\n";
wait;
print "in parent, past wait\n";
}
elsif (defined $pid) {
sleep 1;
print "in child, sleeping for 5 secs...\n";
sleep 5;
print "child exiting...\n";
exit 0;
}
else {
die "fork failed ($!)\n";
}
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 12 Aug 1997 17:13:20 -0400
From: Jester T Great <jester@francomedia.qc.ca>
To: tadmc@flash.net
Subject: Perl
Message-Id: <33F0D1EE.7636772A@francomedia.qc.ca>
This is a multi-part message in MIME format.
--------------8EE95E9F1890FC69581A7354
Content-Type: text/plain; charset=iso-8859-1
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Content-Transfer-Encoding: 8bit
Do you know where I can find a place to have perl... I can't find it.
--
Always remember,
I'm watching you from Heaven......
She's watching you from Hades!!!!!!
Sir |K'J. ~T~ G.I@ First Knight of the Majestic Kingdom's Army $f)s$
Majestic Kingdom Administrator
Those who live shall be forever dead
Come visit my Kingdom @: http://www.francomedia.qc.ca/~jester/
Come visit my page @: http://www.geocities.com/SiliconValley/Pines/7288/
--------------8EE95E9F1890FC69581A7354
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jean-Frangois Hubert
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Jean-Frangois Hubert
n: Hubert;Jean-Frangois
org: Home Pge Design
adr: 195 des Frjnes;;;St-Eustache;Quibec;J7R 6M1;Canada
email;internet: jester@francomedia.qc.ca
tel;work: 514 473-4876
tel;fax: none
tel;home: 514 473-3133
note: For Great HomePages, just come to my site E-Mail me and we'll discuss about it
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
end: vcard
--------------8EE95E9F1890FC69581A7354--
------------------------------
Date: 12 Aug 1997 19:46:30 GMT
From: "Rico Hawes" <mhawes@erols.com>
Subject: Post Problem
Message-Id: <01bca758$81fc7da0$6801a8c0@95load.erols.com>
I have a problem with a recursive chat script I am writing in perl. The
first few time I call it, in the location bar it will just have the url to
the script. That's what I want, but after that, each time I call the
script it puts all of the form arguments
------------------------------
Date: Tue, 12 Aug 1997 11:54:20 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Theo Van Dinter <felicity@eclectic.kluge.net>
Subject: Re: Problem with 5.004_01
Message-Id: <Pine.GSO.3.96.970812115140.19561I-100000@julie.teleport.com>
On 12 Aug 1997, Theo Van Dinter wrote:
> I just installed 5.004_01 to upgrade from 5.004, and most of my scripts
> now cause this error message from perl:
>
> perl: can't resolve symbol 'safemalloc'
Did all of the tests from 'make test' pass? Did they give any helpful
diagnostic messages? You should normally not install until you can get all
of the tests to pass. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 12 Aug 1997 15:49:54 -0400
From: Vladimir Parkhaev <vlad@teleglobe.ca>
Subject: Puting pattern in a variable
Message-Id: <33F0BE62.41C67EA6@teleglobe.ca>
Hi everybody,
I've created an array of patterns. And I need
to match a variable to find out if it matches
at least one of them.
Something like this:
foreach $regex (@List) {
if ($_ =~ $regex) {
print "OK";
}
else {
print "No match";
}
}
I've tried about everything, including eval.
Nothing seem to work. Has anybody tried this before?
------------------------------
Date: 12 Aug 1997 20:40:21 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Puting pattern in a variable
Message-Id: <5sqhnl$8du@news-central.tiac.net>
In article <33F0BE62.41C67EA6@teleglobe.ca>,
Vladimir Parkhaev <vlad@teleglobe.ca> wrote:
>Hi everybody,
>I've created an array of patterns. And I need
>to match a variable to find out if it matches
>at least one of them.
You can do that, you just need the // around the regex. If the thing
you're trying to match is in $_ then (assuming you don't have the leading
and trailing / delimiters in the variable...)
if (/$regex/) {
...
}
should work. It may not be the most effective thing if you're going to
check multiple values against your list of regexes, check out the What
Makes Perl's Regular Expressions Dynamite link at Tom Christiansen's site
under http://www.perl.com/perl/everything_to_know/ - look for match_any
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 12 Aug 1997 16:46:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Puting pattern in a variable
Message-Id: <comdog-ya02408000R1208971646380001@alice.walrus.com>
In article <33F0BE62.41C67EA6@teleglobe.ca>, Vladimir Parkhaev <vlad@teleglobe.ca> wrote:
>I've created an array of patterns. And I need
>to match a variable to find out if it matches
>at least one of them.
>
>Something like this:
>
>foreach $regex (@List) {
> if ($_ =~ $regex) {
[snip snip]
-----perhaps you wanted something like:
#!/usr/bin/perl
$thingy = 'cats and dogs';
#just the patterns, ma'am. we'll wrap the matching
#operator around these later
@List = qw(^ca* .*and bird [aeiou][a-z]* og t$);
foreach $regex (@List)
{
if ($thingy =~ m/$regex/) #notice the matching operator!
{
print "$regex: OK\n";
}
else
{
print "$regex: No match\n";
}
}
__END__
^ca*: OK
.*and: OK
bird: No match
[aeiou][a-z]*: OK
og: OK
t$: No match
-----or maybe something like:
#!/usr/bin/perl
$thingy = 'Cats and Dogs';
#the matching operator is part of the variable so you can
#do more fancy things (like using modifiers)
@List = qw(/^ca*/i /.*and/ /bird/);
foreach $regex (@List)
{
if ( eval( "\$thingy =~ $regex") ) #notice the escaped $
{
print "$regex: OK\n";
}
else
{
print "$regex: No match\n";
}
}
__END__
/^ca*/i: OK
/.*and/: OK
/bird/: No match
--
brian d foy <comdog@computerdog.com>
please forgive any posting wierdness - i've recently changed providers
and things are a bit wonky
------------------------------
Date: Tue, 12 Aug 1997 18:53:37 GMT
From: jackson@usenix.org (Jackson Dodd)
Subject: USENIX Conf on Domain-Specific Languages (DSL) - Conference Program
Message-Id: <EEtDtD.Hv0@usenix.org>
Keywords: USENIX, conference, domain-specific languages, dsl
Conference on Domain-Specific Languages (DSL 97)
October 15-17, 1997
Santa Barbara, California
Sponsored by USENIX, the Advanced Computing Systems Association
In cooperation with ACM SIGPLAN and SIGSOFT
Software engineers and programmers: Join your peers at DSL 97.
If you work with or are interested in domain-specific languages
and need the latest information, mark your calendar now and plan
to attend this workshop.
USENIX's Conference on Domain-Specific Languages offers the latest
research during two and one-half days of refereed paper presentations,
invited talks by noted experts, Birds-of-a-Feather sessions, and
opportunities to meet your peers and share solutions.
You will learn about the newest research during these refereed
paper sessions:
--Domain-Specific Language Design
--Experience Reports
--Compiler Infrastructure for Domain-Specific Languages
--Logic and Semantics
--Case Studies and Surveys
--Abstract Syntax Trees
--Embedded Languages and Abstract Data Types
Invited talk, keynote, and registration information are available
at the DSL homepage: http://www.usenix.org/events/dsl97/. You may
also send email to conference@usenix.org, call the USENIX Conference
Office at 714-588-8649, or send a fax to 714-588-9706.
Register by September 29 and save $50.
URL: http://www.usenix.org/events/dsl97/
===================================================
The USENIX Association brings together the community of engineers,
system administrators, scientists, and technicians working on the
cutting edge of computing. Its technical conferences are the essential
meeting grounds for the presentation and discussion of the most
advanced information on new developments in all aspects of advanced
computing systems.
------------------------------
Date: 12 Aug 1997 13:57:16 -0500
From: Ben Gertzfield <che@imsa.edu>
Subject: Re: Walking the tree
Message-Id: <y8sn2mnjkkz.fsf@imsa.edu>
>>>>> "Jeff" == Jeff Masiello <jmasiello@presstar.com> writes:
Jeff> We have a Unix server which needs massive cleaning. I just
Jeff> learned perl but I would like to write a program which walks
Jeff> the directory structure and catalogs files by directory
Jeff> giving their locations.
*snip*
File::Find is your friend. Run a 'perldoc File::Find' and be
amazed. :)
Basically, this is what you do:
#!/usr/bin/perl -w
use File::Find;
my @big_catalog_of_files; # All the filenames go into here
my $directory_to_search = '/'; # Start in this directory
find \&what_to_do, $directory_to_search;
sub what_to_do {
push @big_catalog_of_files, $File::Find::name;
}
Pretty simple. Pass find() a reference to a sub and a directory (or
list of directories) to search, and it calls the sub for each filename
it finds, setting $_ to the filename (without the path) and
$File::Find::name to the filename with the path prepended.
You can store other things about the file, like their sizes, or other
interesting things, using criteria in the subroutine you pass to
find(). See what you can come up with!
--
Brought to you by the letters G and H and the number 6.
"I don't want the world.. I just want your half." -- They Might Be Giants
Ben Gertzfield <http://www.imsa.edu/~wilwonka/> Finger me for my public
PGP key. I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.
------------------------------
Date: Tue, 12 Aug 1997 12:02:27 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeff Masiello <jmasiello@presstar.com>
Subject: Re: Walking the tree
Message-Id: <Pine.GSO.3.96.970812115815.19561J-100000@julie.teleport.com>
On Tue, 12 Aug 1997, Jeff Masiello wrote:
> I would like to write a program which walks the directory structure
> and catalogs files by directory giving their locations. it would be
> easy if the foreach loops read directories first but they don't.
The foreach control structure doesn't know anything about directories.
This is like complaining that your Subaru doesn't know how to drive to the
grocery store. :-)
> I'm using the -d test but how do I get it so it lists all the files
> first and then moves on to the next subdir?
Maybe you want to use File::Find, and its finddepth routine.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 12 Aug 1997 16:21:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why won't this work!?!
Message-Id: <comdog-ya02408000R1208971621000001@alice.walrus.com>
In article <33EB057B.3D4CFF57@huron.net>, Stephen Hill <buck@huron.net> wrote:
>$url = "http://www.mydomian.com/cgi-bin/search?text=ontario&offset=600";
>@lines = `lynx -source $url`;
let's see... okay... you're passing stuff to the shell. hmmmm...
>print "@lines";
>This almost works, but the "offset=600" is not passed to the lynx
>browser; is there anyway I can pass an URL(with an "&") to the lynx
>browser?
have you tried this from the command line to see what happens (possibly
using a shell with job control)? (hint: since it fails after &, is there
anything special about &? :)
is there some reason that you don't want to use the LWP module?
#!/usr/bin/perl
use LWP::Simple;
$stuff
= get('http://www.mydomian.com/cgi-bin/search?text=ontario&offset=600');
#yadda yadda yadda
__END__
--
brian d foy <comdog@computerdog.com>
please forgive any posting wierdness - i've recently changed providers
and things are a bit wonky
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
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 855
*************************************