[6344] in Perl-Users-Digest
Perl-Users Digest, Issue: 966 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 18 03:07:29 1997
Date: Tue, 18 Feb 97 00:00:28 -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, 18 Feb 1997 Volume: 7 Number: 966
Today's topics:
Re: $ls = `ls $file`; but not in NT Perl (Brian L. Matthews)
Re: (Q) return inside a grep BLOCK (Brian L. Matthews)
Choosing Good Subject Lines [Periodic Posting] (Dean Roehrich)
Re: Date Script (brian d foy)
Re: File write permissions in Perl <JF6@sprynet.com>
Getting a HTML file from another server with PERL (Dico Reyers)
Re: Interesting problem. <metcher@no.junk.mail>
Re: mkdir / chmod weirdness (Tad McClellan)
Re: mkdir / chmod weirdness (Jeff Yoak)
Nicaragua arnoldn@sprynet.com
perl script corrupting later exe of SSI jmack@p3.net
Re: perl script corrupting later exe of SSI (David Richards)
POST request in Perl bsautter@rtd.com
Re: POST request in Perl (brian d foy)
Re: POST request in Perl (Nathan V. Patwardhan)
Program wrapper ? <ehjung@hyuee.hanyang.ac.kr>
regex and looping problem jmack@p3.net
Re: regex and looping problem (Chaim Frenkel)
Re: regexp's in XEmacs vs. Perl <cmcurtin@research.megasoft.com>
Re: Regular Expressions and Assigning to Variable (Michael Nelson)
split an array? (Claudia Ma)
Re: Using -s Perl switch in SSI (brian d foy)
Re: What does flock do? (John Boekhout)
Win32::ODBC $db->close() <boutros+@andrew.cmu.edu>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Feb 1997 17:17:58 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: $ls = `ls $file`; but not in NT Perl
Message-Id: <5eb006$puc$1@halcyon.com>
In article <E5rJvy.3n6@nonexistent.com>, Abigail <abigail@ny.fnx.com> wrote:
|On 16 Feb 1997 23:06:43 -0800, Brian L. Matthews wrote in comp.lang.perl.misc:
|++ $ls = `ls $file`, just replace it with $ls = $file
|Bzzt! $ls = $file might work if $file is a simple file which
|exists, but it won't work if $file is a directory, empty,
|contains spaces, starts with a dash, or is a nonexisting name.
Yes, quite true. On the other hand, relying on the output of ls being
the same on Unix and NT in the face of any of the above is probably
no better than just using $ls = $file. :-)
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 17 Feb 1997 17:21:19 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: (Q) return inside a grep BLOCK
Message-Id: <5eb06f$q1d$1@halcyon.com>
In article <5eajo1$qu4@gateway.grumman.com>,
John L. Allen <allen@gateway.grumman.com> wrote:
|This does work, but BIITEOTB:
|print grep {
| ;
| {
| $x=1, last if /0/;
| $x=0, last if /1/;
| $x=1 if $_ > 5;
| }
| $x
|} 0..9
Ah, a block inside a block. I should have thought of that, I use it
all the time for switches.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 18 Feb 1997 03:02:03 GMT
From: roehrich@cray.com (Dean Roehrich)
Subject: Choosing Good Subject Lines [Periodic Posting]
Message-Id: <subjects_856234921@cray.com>
NAME
subject_lines - Choosing Good Subject Lines
DESCRIPTION
The quality of your article's subject line will dictate the
quality of the responses you receive. Choose your subject
lines wisely.
GOOD SUBJECT LINES
These subject lines indicate exactly what the article will
be about and are therefore quality subject lines.
Putting Commas in a number
Can I print "~" (tilde) in a format?
Assigning to an @array and undefined value.
Printing/calling date/time using unix gmtime
How to install individual modules like CGI-Lite?
getpwnam() & Solaris's /etc/shadow file
BAD SUBJECT LINES
These subject lines say nothing about the content in the
article.
Where do I start???!! :-(
How hard would this job be?
Can YOU solve this simple problem?!
Testing.
04]?
Simple split question
These subject lines use negative-flash words. See the
section on NEGATIVE-FLASH WORDS.
Perl newbie with cgi script problem
Newbie needs help
Total Beginner Reqs. Help - Please.
Simple split question
Can YOU solve this simple problem?!
NO SUBJECT LINE
Many of the people who give high-quality responses will tend
to ignore posts which have no subject line at all.
NEGATIVE-FLASH WORDS
The following words are guaranteed to make large numbers of
people deliberately ignore your article. I call these
negative-flash words.
beginner Many people ignore articles which have these words
in their subject lines.
emergency News propagation is too slow. By the time anyone
gets to read it your condition has probably been
upgraded to catastrophic. By the time you get
their response you'll be dead. Don't waste other
people's time with this stuff.
expert See guru.
girl The people who can give you the highest-quality
responses probably aren't in the mood for this
sort of trolling.
guru The truth is that it's probably a non-guru
question. Most gurus will ignore any article that
has this word in its subject line.
help It sounds like you've given up, or, more likely,
haven't tried. Omit this word and the rest of
your subject line will probably be a high-quality
attention-getter.
newbie See beginner.
novice See beginner.
please Don't beg. It's a turn-off.
question It's too obvious, and probably answered in the
manpages or the FAQ.
sex See girl.
simple This word should tell you something--that you need
to look at the manpages a little harder. Don't
waste other people's time with this stuff.
stupid It's just plain derogatory. People don't like to
waste their time on things that are stupid. Hint:
don't tell them it's stupid, and you will get a
higher-quality response.
urgent See emergency.
woman See girl.
NEGATIVE-FLASH EFFECTS
The following effects, like the above list of negative-flash
words, are guaranteed to make large numbers of people
deliberately ignore your article.
ALL CAPITALS
Do not use all capital letters in your subject
line. Many people find the effect annoying or
equate it with newcomers. In either case they
will ignore the posting. Hint: There's nothing
wrong with being a newcomer--we all were at one
time--just don't advertise it.
Multiple bangs!!!!!
Multiple bangs (exclamation points) and multiple
question marks come across as either over-zealous
or literarily ignorant, and both effects tend to
chase away the people who can give the highest-
quality responses.
BAD, BARELY
This brings us to the next category of subject lines: Those
which are bad but could be good with only a slight
adjustment.
HELP: Perl 5.002, SunOS 5.5, gcc 2.7.2, dynamic loading
HELP: Converting text to binary
GRINCH
Dean Roehrich, July 26, 1996.
------------------------------
Date: Sun, 16 Feb 1997 23:35:09 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Date Script
Message-Id: <comdog-1602972335090001@nntp.netcruiser>
In article <jsteven-1702971342080001@blv-pm109-ip9.halcyon.com>, "James
Steven" <jsteven@sirris.com> wrote:
> Could someone please tell me where I could get a script that determines
> todays date and then displays a month file (ex. february.gif), one or two
> day files, (ex. 1, 7, for the 17th), a th (xx h) file if nessisary and then
> a year file (1997)?
well, you could write one. sounds like about 25 lines to me, not
counting any html you want to include.
#!/usr/bin/perl -Tw
#just fill in the details :)
use strict;
my @time = localtime(time); #see the perlfunc manpage or the Camel p. 185
my $month = $time[4];
my $date = $time[3]; #we'll just use one day file.
my $year = 1900 + $time[5];
my %month_as_word = ('0' => 'January'); # and so on
my %append = ('1' => 'st', '2' => 'nd', '3' => 'rd');
$date =~ /(\d)$/;
my $xx = (exists $append{$1}) ? $append{$1} : 'th';
print<<"HERE";
Content-type: text/html
<HTML>
<HEAD><!--whatever is appropriate--><HEAD>
<body>
<img src="$month_as_word{$month}.gif" alt="$month_as_word{$month}"
><img src="$date.gif" alt="$date"
><img src="$xx.gif " alt="$xx"
><img src="$year.gif" alt="$year">
</body>
HERE
__END__
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: Mon, 17 Feb 1997 20:19:23 -0500
From: Joel Frey <JF6@sprynet.com>
Subject: Re: File write permissions in Perl
Message-Id: <3309039B.307B@sprynet.com>
Ok so Im just learning perl but could you not put a *.dat file with a
list of passwords and usernames (and posible where there dir is) and
have it check to see if they have permision to uplaod a file.
Just a tought.
Joel Frey
--
"Do not compute the totality of your poultry population until
all the manifestations of incubation have been entirely completed."
-- William Jennings Bryan
------------------------------
Date: Tue, 18 Feb 1997 05:45:38 GMT
From: dico@isn.net (Dico Reyers)
Subject: Getting a HTML file from another server with PERL
Message-Id: <33094180.9944294@nntp.uunet.ca>
Hello.
I need some help please. No one has been able to help me.
I would like to write a perl script that goes to a specified URL and
gets a specified file and then takes that information and just stores
it in an array.
Any help would be greatly appreciated...
Please email me at dico@peionline.com
Thanks in advance,
Dico
------------------------------
Date: Tue, 18 Feb 1997 13:45:26 +1100
From: Jaime Metcher <metcher@no.junk.mail>
Subject: Re: Interesting problem.
Message-Id: <330917C6.91@no.junk.mail>
Just a few ideas...
If you know how long your Y axis is, and you know how high each label
is, and you know how many labels you have, you know whether or not they
are all going to fit. The max number of labels is (y axis
length)/(label height + a bit of a gap between each label)
If they don't all fit, you can display them in two columns, with the
lines leading to the labels in the second column sneaking between the
labels in the first column.
The distance from the top of one label to the top of the next is (y axis
length)/(number of labels) - assuming you want them evenly spread, and
there's only one column. So you know where to display each label.
You can prevent the lines from crossing by sorting the labels by their
y-axis points. Display all the highest ones first, and work your way
down, for example.
--
Jaime Metcher
Systems Programmer (i.e. plugger-in of printers and replacer of toner)
University of Queensland, Australia.
Real host name for email: spider.herston.uq.edu.au
------------------------------
Date: Mon, 17 Feb 1997 18:59:31 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: mkdir / chmod weirdness
Message-Id: <jtuae5.d01.ln@localhost>
Jeff Yoak (jeff@yoak.com) wrote:
: On a system running BSD, I'm running a script with the following
: lines:
: mkdir($maindir,0777) || die "Can't create directory: $maindir\nDied ";
: chmod(0777,$maindir) || die "Can't chmod directory: $maindir\nDied ";
: With only the first line, the script creates the directory with 755
: permissions. (my default) but it works as intended with both lines.
: Anyone have any ideas?
Is there a question in the above somewhere?
I don't think there is. But there _must_ be, else you wouldn't be
posting here...
Are you expecting the first line alone to create the directory
with permissions 777?
If so, and that's not what you're getting, then see below ;-)
: Also, if appropriate, if anyone has any advice on how I might have
: figured this out on my own, i.e. return values of function calls or
: something that I could have looked for, that would be very much
: appreciated.
Most excellent attitude! You are to be commended.
If mkdir() isn't giving you what you expected, then you should go
read about mkdir() in the fine perl man pages that are included with
the perl distribution:
------------
=item mkdir FILENAME,MODE
Creates the directory specified by FILENAME, with permissions specified
by MODE (as modified by umask). If it succeeds it returns 1, otherwise
it returns 0 and sets $! (errno).
------------
What's that 'as modified by umask' stuff? Sounds like that somehow
affects what the permissions are set to.
'man umask' on a Unix system, or any good Unix book should clear
that part up.
In case you have particularly cruddy man pages:
the umask is a mask (ie. it is XORed) for file permissions. So:
777 = 111111111 # what you asked for
022 = 000010010 # apply the umask, 022 is an often used umask
--------- # apply exclusive or
111101101 = 755 # what you get
Nothing 'weird' at all there. That is how it is _supposed_ to work ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Mon, 17 Feb 1997 23:09:26 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: mkdir / chmod weirdness
Message-Id: <5eb2so$mih@dfw-ixnews5.ix.netcom.com>
tadmc@flash.net (Tad McClellan) wrote:
[snip]
>------------
>=item mkdir FILENAME,MODE
>Creates the directory specified by FILENAME, with permissions specified
>by MODE (as modified by umask). If it succeeds it returns 1, otherwise
>it returns 0 and sets $! (errno).
>------------
>What's that 'as modified by umask' stuff? Sounds like that somehow
>affects what the permissions are set to.
>'man umask' on a Unix system, or any good Unix book should clear
>that part up.
That's the part I missed. I didn't realize that the MODE was going to
be modified by umask. I thought that when I told it 777 it would take
that as the permission. :) I guess the manual would have answered
that one, huh? :) Thanks for the help.
Cheers,
Jeff
Jeff Yoak jeff@yoak.com http://yoak.com/
------------------------------
Date: 13 Feb 1997 19:38:32 GMT
From: arnoldn@sprynet.com
Subject: Nicaragua
Message-Id: <5dvqjo$fb9@juliana.sprynet.com>
WOULD YOU consider helping me in my outreach to orphaned boys & girls outside Managua? I'm returning there in early March.
Consider it. Paul. (562)430-2773.
------------------------------
Date: Mon, 17 Feb 1997 20:51:13 -0600
From: jmack@p3.net
Subject: perl script corrupting later exe of SSI
Message-Id: <856233991.13158@dejanews.com>
Hello, I have a small problem with a perl script and an SSI. On my site,
I have a perl script (date.pl) to load the current date in a formatted,
european fashion. This script I pulled from the camel book and it uses
the local(time) as they describe on page 185. I load the date in the
middle of the page.
At the bottom of the page, I have an SSI to print the date the file was
last modified, it is formatted like so:
<!--#config timefmt="%D %r"--><!--#flastmod file="index.html"-->
However, I get an error for this SSI if I insert it after the date.pl
call (works fine before the date.pl call, but I need it after). If I
remove the <!--exec cgi="/cgi-bin/date.pl"--> completely from the HTML,
the SSI works fine and prints the formatted date properly. Also, if I
comment out the <!--exec cgi="/cgi-bin/date.pl"--> portion in HTML, it
still doesn't work!? The echo var=LAST_MOD works with/out the date.pl
call, but I like to format the dates as above to be a little nicer.
Why is the date.pl script messing up my SSI? It's a very simple script.
I get the error for perl 4 and perl 5.003. Is the localtime function
messing up the SSI somehow?
Thank you for any insight
John
jmack@p3.net
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 18 Feb 1997 03:31:22 GMT
From: dr@ripco.com (David Richards)
Subject: Re: perl script corrupting later exe of SSI
Message-Id: <5eb7qa$289$1@gail.ripco.com>
(Posted and e-mailed, note Followup-To)
In article <856233991.13158@dejanews.com>, <jmack@p3.net> wrote:
>Hello, I have a small problem with a perl script and an SSI. On my site,
>I have a perl script (date.pl) to load the current date in a formatted,
>european fashion. This script I pulled from the camel book and it uses
>the local(time) as they describe on page 185. I load the date in the
>middle of the page.
Why not replace the perl script with the SSI commands to print the
current date in the correct format? This will be faster...
>At the bottom of the page, I have an SSI to print the date the file was
>last modified, it is formatted like so:
>
><!--#config timefmt="%D %r"--><!--#flastmod file="index.html"-->
>
>However, I get an error for this SSI if I insert it after the date.pl
>call (works fine before the date.pl call, but I need it after). If I
>remove the <!--exec cgi="/cgi-bin/date.pl"--> completely from the HTML,
>the SSI works fine and prints the formatted date properly. Also, if I
>comment out the <!--exec cgi="/cgi-bin/date.pl"--> portion in HTML, it
>still doesn't work!? The echo var=LAST_MOD works with/out the date.pl
>call, but I like to format the dates as above to be a little nicer.
That it still causes a problem when you comment out the execution of the
perl script is a hint that the problem is most likely in the HTTPd server's
parsing of SSI files.
>Why is the date.pl script messing up my SSI? It's a very simple script.
>I get the error for perl 4 and perl 5.003. Is the localtime function
>messing up the SSI somehow?
The subshell cannot affect the environment of it's parent.
What HTTP server software and version are you running? Can you upgrade
to the most recent release?
--
David Richards Ripco, since Nineteen-Eighty-Three
My opinions are my own, Public Access in Chicago
But they are available for rental Shell/SLIP/PPP/UUCP/ISDN/Leased
dr@ripco.com (773) 665-0065 !Free Usenet/E-Mail!
------------------------------
Date: Mon, 17 Feb 1997 21:01:28 -0600
From: bsautter@rtd.com
Subject: POST request in Perl
Message-Id: <856234362.13399@dejanews.com>
Does anyone know how to preform a POST request in Perl? I want to simulate
how a web browser would do it.
Also, how would I do it on the UNIX command line? To preform a GET request
I usually type:
telnet www.server.com 80
GET /directory/file.htm HTTP/1.0
I would assume POST is similar?
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sun, 16 Feb 1997 23:13:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: POST request in Perl
Message-Id: <comdog-1602972313410001@nntp.netcruiser>
In article <856234362.13399@dejanews.com>, bsautter@rtd.com wrote:
> Does anyone know how to preform a POST request in Perl? I want to simulate
> how a web browser would do it.
you might want to read the HTTP spec, which explains it all [1]. You'll
be interested in sections 4, 5,and 9. In short, the POST data is
sent as an HTTP message body.
[1] RFC 2068 - Hypertext Transfer Protocol -- HTTP/1.1
<URL:http://www.ics.uci.edu/pub/ietf/http/rfc2068.txt> or
<URL:http://www.cis.ohio-state.edu/htbin/rfc/rfc2068.html>
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: 18 Feb 1997 03:55:37 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: POST request in Perl
Message-Id: <5eb97p$qiu@fridge-nf0.shore.net>
bsautter@rtd.com wrote:
: Does anyone know how to preform a POST request in Perl? I want to simulate
: how a web browser would do it.
Ahh, you're looking for the LWP module, available from a CPAN near you!
Try: http://www.perl.com/perl/CPAN/
LWP is a comprehensive WWW package which includes excellent documentation.
--
Nathan V. Patwardhan
nvp@shore.net
"Outshined outshined outshined!"
--Chris Cornell from Soundgarden
------------------------------
Date: Tue, 18 Feb 1997 14:53:50 +0900
From: Euihyun Jung <ehjung@hyuee.hanyang.ac.kr>
Subject: Program wrapper ?
Message-Id: <330943EE.1EF6@hyuee.hanyang.ac.kr>
Hi there.
I hava a question.
I want to make a wrapper program using perl.
As you know, wrapper program is wraaping a existing program without
modifying it while adding new facility.
First, I want to make a password wrapper.
I have many username & password to be added to /etc/password file.
but, password program issues me "enter password" twice.
If you know the solution, please let me know.
Euihyun Jung
------------------------------
Date: Mon, 17 Feb 1997 19:41:05 -0600
From: jmack@p3.net
Subject: regex and looping problem
Message-Id: <856229468.10112@dejanews.com>
Hello, I'd greatly appreciate any assistance to my problem.
I have a block of raw text to convert to HTML.
The text is a mishmash of questions and answers. Questions and answers
are seperated from each other by a line of 50 dashes. So it looks
something like this:
Q1
[ . . . ]
---(50 of em)
A1
--
Q2
--
A2
--
etc.
I'd like to replace the dashes with a <HR>, easy enough with a
s/^-{50}$/<HR>/ However, I'd also like to have a "Return to List of
Questions" internal link (I have all the questions in a <UL> at the top of
the page, linked the question below) every 10th question or so. I want
to have a for loop in my perl script that recognizes every 10th instance
of a line of 50 dashes and replace it with a string like
<A HREF="#top">Return to Top</A>
The files are sometimes long (nearly one hundred questions) so I'd like to
do a loop that iterates through a file replacing every --- line with <HR>
and every 10th with the string above until the EOF. I've tried many
things along the line of:
while (<FILE>){
for ($i=1; $i<= something; $i++){ #how to effectively configure loop?
foreach (/^-{50}$/){
if ($i divisible by 10) { # how to find 10th dashed line?
s/^-{50}$/<A HREF="#top">Return to Top</A>/
else {
s/^-{50}$/<HR>/
}}}
with no success.
Is a loop even the best way to do this? Can I read the file in as an
array
and fool around with each array element? Would that be easier? I
appreciate any ideas
Thanks
John
jmack@p3.net
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 18 Feb 1997 03:15:19 GMT
From: Chaimf@cris.com (Chaim Frenkel)
Subject: Re: regex and looping problem
Message-Id: <5eb6s7$qvg@chronicle.concentric.net>
[ poster cc'ed ]
This seems to be a simple programming problem. Have you thought
through your algorithm?
$faq_count=0; # avoid undef warning
while(<>) {
# Ignoring adding appropriate HTML to anything but the
# dashed lines.
unless (/^-{50}/) {
print;
next;
}
# Only here when the seperaters are seen
print '<A HREF="#top">Return to Top</A>',"\n"
if 0 == (++$faq_count % 10);
print "<HR>\n";
}
Many alternatives are possible.
<chaim>
jmack@p3.net (comp.lang.perl.misc <856229468.10112@dejanews.com>) wrote:
: Hello, I'd greatly appreciate any assistance to my problem.
: I have a block of raw text to convert to HTML.
: The text is a mishmash of questions and answers. Questions and answers
: are seperated from each other by a line of 50 dashes. So it looks
: something like this:
:
: Q1
: [ . . . ]
: ---(50 of em)
: A1
: --
: Q2
: --
: A2
: --
: etc.
:
: I'd like to replace the dashes with a <HR>, easy enough with a
: s/^-{50}$/<HR>/ However, I'd also like to have a "Return to List of
: Questions" internal link (I have all the questions in a <UL> at the top of
: the page, linked the question below) every 10th question or so. I want
: to have a for loop in my perl script that recognizes every 10th instance
: of a line of 50 dashes and replace it with a string like
:
: <A HREF="#top">Return to Top</A>
:
: The files are sometimes long (nearly one hundred questions) so I'd like to
: do a loop that iterates through a file replacing every --- line with <HR>
: and every 10th with the string above until the EOF. I've tried many
: things along the line of:
:
: while (<FILE>){
:
: for ($i=1; $i<= something; $i++){ #how to effectively configure loop?
: foreach (/^-{50}$/){
:
: if ($i divisible by 10) { # how to find 10th dashed line?
: s/^-{50}$/<A HREF="#top">Return to Top</A>/
: else {
: s/^-{50}$/<HR>/
:
: }}}
: with no success.
:
: Is a loop even the best way to do this? Can I read the file in as an
: array
: and fool around with each array element? Would that be easier? I
: appreciate any ideas
:
: Thanks
:
: John
: jmack@p3.net
:
: -------------------==== Posted via Deja News ====-----------------------
: http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 17 Feb 1997 20:56:41 -0500
From: C Matthew Curtin <cmcurtin@research.megasoft.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regexp's in XEmacs vs. Perl
Message-Id: <867mk6j2qu.fsf@goffette.research.megasoft.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> "EMACS belongs in <sys/errno.h>: Editor Too Big!" -me
You mean you can edit files with Emacs? :-)
--
Matt Curtin Chief Scientist Megasoft, Inc. cmcurtin@research.megasoft.com
http://www.research.megasoft.com/people/cmcurtin/ I speak only for myself
Hacker Security Firewall Crypto PGP Privacy Unix Perl Java Internet Intranet
------------------------------
Date: 18 Feb 1997 01:06:48 GMT
From: nelson@seahunt.imat.com (Michael Nelson)
Subject: Re: Regular Expressions and Assigning to Variable
Message-Id: <slrn5gi058.pi5.nelson@seahunt.imat.com>
On 17 Feb 1997 09:35:32 -0500, Jim Anderson <jander@jander.com> wrote:
>
>Something like this ought to work:
>
> $nbr = $variable =~ />(\d+)</;
I ended up doing it this way:
if (/>(\d+)</) {
print OUTPUT $1 . " ";
}
Thanks...
Michael
--
=================================================================
Michael Nelson nelson@seahunt.imat.com
San Francisco, CA michaeln@csd.sgi.com
"I don't want to achieve immortality through my work, I want
to achieve immortality by not dying." - Woody Allen
=================================================================
------------------------------
Date: 18 Feb 1997 03:44:28 GMT
From: maclaudi@cps.msu.edu (Claudia Ma)
Subject: split an array?
Message-Id: <5eb8is$d46$1@msunews.cl.msu.edu>
Hi,
Does anyone know how to split an array? Say I have an array
@array = (a
b
c);
How to make:
$a = a;
$b = b;
$c = c;
I tried ($a, $b, $c) = split (/\n/, @array) but it didn't work. :(
Thanks a lot!
Claudia
--
============================================================
Claudia Y. Ma, Computer Science Dept., MSU
Email: maclaudi@cps.msu.edu
URL: http://www.cps.msu.edu/~maclaudi
============================================================
------------------------------
Date: Sun, 16 Feb 1997 23:09:47 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using -s Perl switch in SSI
Message-Id: <comdog-1602972309470001@nntp.netcruiser>
In article <3308E2D0.665@tradecards.com>, Ben Crane
<bcrane@tradecards.com> wrote:
> I'm brand new to this newsgroup so please excuse if this is an FAQ.
not an excuse[1] :)
> I'm trying to use the -s switch in an exec SSI, but my server doesn't
> seem to understand it. Here is what I'm trying:
>
> <!--#exec cgi="-s /cgi-bin/prog.cgi -card=a10" -->
well, what are you trying to do there? the server doens't know what to
do with that.
1. have you tried putting any of those switches on the shebang
line of the script?
2. how about
<!--exec cmd="/usr/bin/perl -s /full/path/cgi-bin/prog.cgi -card=a10"-->
?
[1]
<URL:http://www.perl.com/perl/faq/perl-cgi-faq.html>
<URL:http://www.perl.com/perl/faq/idiots-guide.html>
<URL:http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml>
<URL:http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html>
<URL:http://www.apache.org/docs/mod/mod_include.html>
<URL:http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html>
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: Tue, 18 Feb 1997 01:17:51 GMT
From: boekhout@azww.com (John Boekhout)
Subject: Re: What does flock do?
Message-Id: <5eavvh$9sd@peru.it.earthlink.net>
(This is a P.S. to the question I asked in the previous
posting.)
If flock *does* solve the concurrent access to a file as I
hope it does, does flock solve the problem on servers that
have disk (or file) caching? My server, I think, is a UNIX
server running Netrscape Communications Server software.
My internet provider web support person said I should add a
4 second delay to handle the caching issue???
Thanks,
John Boekhout
boekhout@azww.com
------------------------------
Date: Tue, 18 Feb 1997 00:10:17 -0500
From: Sameh R Boutros <boutros+@andrew.cmu.edu>
Subject: Win32::ODBC $db->close()
Message-Id: <In2Hata00iWn0Lmkg0@andrew.cmu.edu>
here is the code:
use Win32::ODBC;
$db = new Win32::ODBC("cochran");
$stmt = "SQL here";
$db->sql($stmt);
$db->close();
when i run the following code, the data is inserted, BUT, the last line
[$db->close();] causes the following error:
Goto undefined subroutine &AutoLoader::AUTOLOAD at
D:\dev\perl5\lib/Win32/ODBC.pm line 861.
when i comment the last line out, it seems to run ok....but i am
supposed to close the connection
BTW this is in a CGI on WinNT4 IIS 3 and perl 5.001 (1m) on intel
any ideas?
-sam
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 966
*************************************