[7453] in Perl-Users-Digest
Perl-Users Digest, Issue: 1078 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 25 12:17:59 1997
Date: Thu, 25 Sep 97 09: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 Thu, 25 Sep 1997 Volume: 8 Number: 1078
Today's topics:
Re: Can't See Pattern <Brett.W.Denner@lmtas.lmco.com>
Re: Can't See Pattern <clark@s3i.com>
Re: CGI.pm question (Mike Stok)
Changing same line in all HTML pages (Koos Pol)
Re: Ctrl-D can not works in Perl5 for Win95 <herman-law@usa.net>
Curses for Perl <robert.crooks@nortel.ca>
Re: expect lib for perl? (Matthew H. Gerlach)
Re: HELP How do I use perl <jeff@webdesigns1.com>
How Do I Search StringsOne Character at a Time? sysdev5@hotmail.com
Re: How Do I Search StringsOne Character at a Time? <seay@absyss.fr>
How does perl guess $( ? (Marek Rouchal)
Re: How does perl guess $( ? (Greg Bacon)
htpasswd crypt (David Siebert)
Re: htpasswd crypt (Greg Bacon)
Re: Indentation program (Clay Irving)
Julian Date Routine (Ben Fogarty)
Re: Julian Date Routine (Mike Stok)
Re: Need Help With Search/Replace <jefpin@bergen.org>
Re: Need Help With Search/Replace (Tom Grydeland)
oraperl subroutines <dreeves3@ford.com>
packages -head1 stuff <dennis.kowalski@daytonoh.ncr.com>
Re: Perl <=> C Server (Andrew M. Langmead)
Re: Perl and Informix-SQl (Clay Irving)
Re: perl mail on solaris (Greg Bacon)
Re: Perl Programmer in Los Angeles (Pasadena) are (Clay Irving)
Perl's pointer <sijun@nortel.ca>
Re: perl/win95/Long File Names <leberre@bandol.grenoble.hp.com>
Re: regex matching HTML comments <springm@ux0umw50.umw.lhm-net.de>
Re: regex matching HTML comments <seay@absyss.fr>
substituting special chars <perkva@itk.ntnu.no>
Re: substituting special chars (Mike Stok)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Sep 1997 09:37:40 -0500
From: Brett Denner <Brett.W.Denner@lmtas.lmco.com>
To: Steve Bowen <steveb@cottagesoft.com>
Subject: Re: Can't See Pattern
Message-Id: <342A7734.41C6@lmtas.lmco.com>
Steve Bowen wrote:
>
> I'm pulling my hair out, trying to figure why Perl can't see the following:
>
> open (IN, $ARGV[0]) or die "Can't open $ARGV[0].\n";
>
> while (<IN>) {
> if (/.+(..):(..):(..)/s) { # This is proving FALSE (with or without
> # /s), thus
> $hour = $1; #can't see
> $minute = $2; #ditto
> $second = $3; #ditto
> }
> ...more stuff that all parses without error.
>
> The line I'm trying to match is this:
>
> Sat Jun 7 14:14:53 1997
When I try this, it *does* work. Which version of Perl are you using?
Are you sure the example in your post is exactly what you're running?
Brett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brett W. Denner Lockheed Martin TAS
Brett.W.Denner@lmtas.lmco.com P.O. Box
748
(817) 935-1144 (voice) Fort Worth, TX 76101
(817) 935-1212 (fax) MZ 9333
------------------------------
Date: 25 Sep 1997 11:44:29 -0400
From: Clark Dorman <clark@s3i.com>
Subject: Re: Can't See Pattern
Message-Id: <d90wliejm.fsf@s3i.com>
steveb@cottagesoft.com (Steve Bowen) writes:
> I'm pulling my hair out, trying to figure why Perl can't see the following:
>
> open (IN, $ARGV[0]) or die "Can't open $ARGV[0].\n";
>
> while (<IN>) {
> if (/.+(..):(..):(..)/s) { # This is proving FALSE (with or without
> # /s), thus
> $hour = $1; #can't see
> $minute = $2; #ditto
> $second = $3; #ditto
> }
> ...more stuff that all parses without error.
>
> The line I'm trying to match is this:
>
> Sat Jun 7 14:14:53 1997
>
> which is almost an exact match to the example given in both man perlre, and
> Programming Perl:
> if (/Time: (..):(..):(..)/) {
>
> I need the exact time from this line, and I can't get it. This has got to
> be simple, but I just don't see it! Help please.....
Frankly, it works just fine for me, with and without the /s. And it works
with the .+ replaced with .* as well.
#!/home/dorman/bin/perl -w
#open (IN, $ARGV[0]) or die "Can't open $ARGV[0].\n";
open (IN, "test.dat") or die "Can't open test.dat";
# while ( defined($_=<IN>)) { # I like this one better. Personal preference.
while (<IN>){
if (/.+(..):(..):(..)/s) { # This is proving FALSE (with or without
$hour = $1; #can't see
$minute = $2; #ditto
$second = $3; #ditto
print " Hour:$hour, Minute:$minute, Second:$second \n";
}
else {
print " It did not match \n";
}
}
__END__
test.dat looks like:
Sat Jun 7 14:14:53 1997
The output:
elmo:~ (11:40am) 277% match.pl
Hour:14, Minute:14, Second:53
elmo:~ (11:40am) 278%
Are you _sure_ it does not work? Make a stand-alone code snippet that
actually has the error, give us the code, the file, and what your output is,
and I'm sure that we can help.
-
Clark Dorman "Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html -Francis Crick
------------------------------
Date: 25 Sep 1997 14:16:53 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: CGI.pm question
Message-Id: <60drol$oqr@news-central.tiac.net>
In article <342A6ABD.C7B6D6DD@eed.ericsson.se>,
Alexander Farber <eedalf@eed.ericsson.se> wrote:
>i am failing to use the -w switch with
>my CGI-script. Here is the error message:
>
>Ambiguous use of title => resolved to "title" => at ./absence-public.pl
>line 64.
>Ambiguous use of style => resolved to "style" => at ./absence-public.pl
>line 65.
>
>And here are those lines:
>
>print start_html(-bgcolor => 'white', -title => 'ABSENCE PLAN - PUBLIC
>HOLIDAYS',
>-author => 'eedalf@eed.ericsson.se', -script => $JAVASCRIPT, -style =>
>$CSS);
>
>Does anyone have an idea? TIA!
This is perl's autoquoting convenience feature which can have some
unexpected results. perlop's documentation says:
The => digraph is mostly just a synonym for the comma
operator. It's useful for documenting arguments that come
in pairs. As of release 5.001, it also forces any word to
the left of it to be interpreted as a string.
so the warning is just saying that there was more than one interpretation
possible for the LHS of the =>, and the warning tells you that it was
interpreted as a string rather than anything else. Consider:
#!/usr/local/bin/perl -w
%foo = (-title => 'baz');
%foo = (title => 'baz');
sub title { 1; }
%foo = (-title => 'baz');
%foo = (title => 'baz');
where you will see warnings from lines 8 and 9 but not from 3 and 4, as by
the time you get to lines 8 and 9 title could be a bare word call to the
subroutine. In general these days I avoid using autoquoting on the left
of => and use
%foo = ('-title' => 'baz');
which says what I mean and is less likely to trip up a maintainer ... but
I could just be old fashioned ;-)
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: 25 Sep 1997 15:29:16 GMT
From: koos_pol@nl.compuware.com.NO_JUNK_MAIL (Koos Pol)
Subject: Changing same line in all HTML pages
Message-Id: <60e00c$fte@news.nl.compuware.com>
Does someone have a script laying around for changing the same line in
all your HTML pages? E.g. a different footer or a specific link.
I know it's not difficult, but why go through the same if someone
already did it, right?
Thanks!
-----------------------------------------------------------------------
Koos Pol P.O Box 12933
PC Systems Admin 1100 AX Amsterdam
Compuware Europe tel: +31 20 3116122
Koos_Pol@nl.compuware.com
-----------------------------------------------------------------------
------------------------------
Date: 25 Sep 1997 14:54:42 GMT
From: "Herman" <herman-law@usa.net>
Subject: Re: Ctrl-D can not works in Perl5 for Win95
Message-Id: <01bcc9c3$3dea4420$67fc3cca@default>
Thanks to all friends who gave me advice here!!! :>
------------------------------
Date: Thu, 25 Sep 1997 10:40:31 -0500
From: Robert Crooks <robert.crooks@nortel.ca>
Subject: Curses for Perl
Message-Id: <342A85EF.EE9@nortel.ca>
Hello:
I have written a perl program on UNIX that uses the Curses module. I
was wondering if anyone knew where I could get a curses module for the
WIN32 platform.
Thanks in advance for your time.
Robert Crooks
------------------------------
Date: Thu, 25 Sep 1997 14:48:52 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: expect lib for perl?
Message-Id: <gerlachEH2JtG.9K6@netcom.com>
>
>Look for module "Comm.pl" in CPAN although I'm not sure whether
>all the power of expect is there.
>
>
>HTH,
>--
>Charles DeRykus
>
Having been frustrated by TCL/Expect, my life dramatically changed for
the better when I found Comm.pl. I haven't seen anything of this alledged
TCL/Expect power that is not in Comm.pl. On the other hand, using Comm.pl
you have the power of perl!
Matthew
------------------------------
Date: Thu, 25 Sep 1997 09:51:09 -0500
From: "Jeff Oien" <jeff@webdesigns1.com>
Subject: Re: HELP How do I use perl
Message-Id: <60dtjo$eku@newsops.execpc.com>
Hi,
Maybe my Perl Primer site for Perl/CGI beginners could help you a little.
http://www.webdesigns1.com/perl/
--
>> I have absoluely no idea how to get started on perl. I made a pl file,
>> made it executible by the chmod parameter, and then what the hell am I
>> supposed to do. I have the 1st. edition of the Ilama book, and I
>> couldn't find the answer to it. I thought I could write some CGI stuff
>> with perl, but I have no idea how it works. I tried to open the file
>> with Netscape and it treated the .pl file that I had written as a text
>> file and showed the source. What the hell am I supposed to do now?
>>
------------------------------
Date: Thu, 25 Sep 1997 09:38:37 -0600
From: sysdev5@hotmail.com
Subject: How Do I Search StringsOne Character at a Time?
Message-Id: <875197480.24329@dejanews.com>
How do I search a string character by character?
Please respond to sysdev5@hotmail.com.
Thank you.
Jerry Bradenbaugh
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 25 Sep 1997 17:17:57 +0200
From: Doug Seay <seay@absyss.fr>
To: sysdev5@hotmail.com
Subject: Re: How Do I Search StringsOne Character at a Time?
Message-Id: <342A80A5.4CD48BDC@absyss.fr>
[posted and mailed]
sysdev5@hotmail.com wrote:
>
> How do I search a string character by character?
What do you mean? Use "index" to look for substrings (of length 1 if
you like). You can use m// and play with the $`, $' and $& variables if
that suits you.
If you want something more precise, you'll need to rephrase your needs.
- doug
------------------------------
Date: 25 Sep 1997 15:40:13 +0200
From: Marek.Rouchal@-nospam-hl.siemens.de (Marek Rouchal)
Subject: How does perl guess $( ?
Message-Id: <60dpjt$dp1@buffalo.HL.Siemens.DE>
Keywords: groups, global variables
I've browsed through the perl source code, but only found occurrences
of (set|get|end)grent. Can someone please give me a hint, which part of
the code fills $( with the groups the current user is member of? I have
the 5.004 sources. TIA for your time!
Cheers,
Marek
PS. To reply by Email, kindly remove -nospam- from the mail address.
--
Marek Rouchal Phone : +49 89/636-25849
SIEMENS AG, HL CAD SYS Fax : +49 89/636-23650
Balanstr. 73 mailto:Marek.Rouchal@-nospam-hl.siemens.de
81541 Muenchen PCmail:Marek.Rouchal.PC@-nospam-hl.siemens.de
------------------------------
Date: 25 Sep 1997 15:11:29 GMT
From: gbacon@adtran.com (Greg Bacon)
To: Marek.Rouchal@-nospam-hl.siemens.de
Subject: Re: How does perl guess $( ?
Message-Id: <60duv1$gog$2@info.uah.edu>
[Posted and mailed]
In article <60dpjt$dp1@buffalo.hl.siemens.de>,
Marek.Rouchal@-nospam-hl.siemens.de (Marek Rouchal) writes:
: I've browsed through the perl source code, but only found occurrences
: of (set|get|end)grent. Can someone please give me a hint, which part of
: the code fills $( with the groups the current user is member of? I have
: the 5.004 sources. TIA for your time!
gid (or Perl_gid) is set in init_ids which you can find in perl.c.
Search for '(' (quotes included) in the functions magic_get and
magic_set in mg.c to see what happens when you read from or write
to $(.
: PS. To reply by Email, kindly remove -nospam- from the mail address.
To receive email replies, kindly put a replyable address in your
headers.
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 25 Sep 1997 14:34:31 GMT
From: dsiebert@gate.net (David Siebert)
Subject: htpasswd crypt
Message-Id: <60dspn$oae$1@news.gate.net>
does anyone have the source to a function that will take a password and crypt
it into a string that is compatable with htaccess?
------------------------------
Date: 25 Sep 1997 15:02:00 GMT
From: gbacon@adtran.com (Greg Bacon)
To: dsiebert@gate.net (David Siebert)
Subject: Re: htpasswd crypt
Message-Id: <60dud8$gog$1@info.uah.edu>
[Posted and mailed]
In article <60dspn$oae$1@news.gate.net>,
dsiebert@gate.net (David Siebert) writes:
: does anyone have the source to a function that will take a password and crypt
: it into a string that is compatable with htaccess?
This is what I use:
#!/usr/bin/perl -w
use integer;
my @salt = ( 'A' .. 'Z', 'a' .. 'z', '0' - '9', '.', '/' );
while (<>) {
chomp;
print crypt($_, $salt[rand @salt] . $salt[rand @salt]), "\n";
}
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 25 Sep 1997 10:02:11 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Indentation program
Message-Id: <60dqt3$se0@panix.com>
In <34283AB0.37B8@techapp.com> Rohit Basu <rohit@techapp.com> writes:
>Does anyone know abt existing utility that can indent
>perl scripts ...
Start at Perl Reference <http://reference.perl.com>
- Select "Style Guides"
- pb -- Freeware
http://www.arachnoid.com/lutusp/ftp/cgi/pb.txt
Perl Beautifier -- This script processes Perl scripts,
cleans up and indents, like cb does for C
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: 25 Sep 1997 15:19:57 GMT
From: bfogarty@np0337.ford.com (Ben Fogarty)
Subject: Julian Date Routine
Message-Id: <60dvet$n3a1@eccws1.dearborn.ford.com>
Any of you GURUs out there have a Julian date routine in perl?
I need it to evaluate a running log and delete prior to a certain
date. Julian date works best. I would appreciate same if you
have it, or a pointer to it's location if you know of one.
Thanks very much.
Ben Fogarty
------------------------------
Date: 25 Sep 1997 15:41:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Julian Date Routine
Message-Id: <60e0mf$t87@news-central.tiac.net>
In article <60dvet$n3a1@eccws1.dearborn.ford.com>,
Ben Fogarty <bfogarty@np0337.ford.com> wrote:
>Any of you GURUs out there have a Julian date routine in perl?
>I need it to evaluate a running log and delete prior to a certain
>date. Julian date works best. I would appreciate same if you
>have it, or a pointer to it's location if you know of one.
The Time::JulianDay module comes in the time modules:
NAME
Time::JulianDay -- Julian calendar manipulations
SYNOPSIS
use Time::JulianDay
$jd = julian_day($year, $month_1_to_12, $day)
$jd = local_julian_day($seconds_since_1970);
$jd = gm_julian_day($seconds_since_1970);
($year, $month_1_to_12, $day) = inverse_julian_day($jd)
$dow = day_of_week($jd)
It can be found on CPAN (ftp.funet.fi under /pub/languages/perl/CPAN or
browsing http://www.perl.com will get you there...) in
.../modules/by-category/06_Data_Type_Utilities/Time
Time-modules-97.092101.tar.gz seems to be the latest.
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: Thu, 25 Sep 1997 10:29:12 -0400
From: TechMaster Pinyan <jefpin@bergen.org>
To: sysdev5@hotmail.com
Subject: Re: Need Help With Search/Replace
Message-Id: <Pine.SGI.3.95.970925102600.13312B-100000@vangogh.bergen.org>
>is easy. However, if the tags have attributes such as <TABLE
>WIDTH="20"
>BORDER="3">, it becomes more difficult. Sometime the tags are broken
>by
>newline characters, leaving the begining portion on one line and the
>reamining portion on other lines. Harder still.
My guess would be:
s/
< # the opening of a tag
.+? # matching the least number of chars
> # until the FIRST closing tag
//xs; # allow whitespace and treat as a single line
----------------
| "To be a rock, and not to roll."
| - Led Zeppelin
----------------
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
** I can be found on #perl on irc.ais.net as jpinyan **
- geek code -
GCS/IT d- s>+: a--- C+>++ UAIS+>$ P+++$>++++ L E--->---- W++$
N++ !o K--? w>+ !O M>- V-- PS PE+ !Y !PGP t+ !5 X+ R tv+ b>+
DI+++ D+>++ G>++ e- h- r y?
------------------------------
Date: 25 Sep 1997 15:34:03 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Need Help With Search/Replace
Message-Id: <slrn62l13b.r7n.Tom.Grydeland@mitra.phys.uit.no>
On Thu, 25 Sep 1997 10:29:12 -0400,
TechMaster Pinyan <jefpin@bergen.org> wrote:
> My guess would be:
> s/
> < # the opening of a tag
> .+? # matching the least number of chars
> > # until the FIRST closing tag
> //xs; # allow whitespace and treat as a single line
>
<img src="foo.gif" alt="<you're wrong>">
> Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
[14 lines sig without correct delimiter snipped]
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Thu, 25 Sep 1997 09:58:17 -0400
From: Daniel M Reeves <dreeves3@ford.com>
Subject: oraperl subroutines
Message-Id: <342A6DF9.690B5536@ford.com>
we have an oraperl program that runs fine, but when we turn it into a
subroutine and try to call it (all in the same file) it won't work. Is there
a difference between perl and oraperl as far as subroutines go?
--
Daniel Reeves 313-621-6974 dreeves3@ford.com dreeves@umich.edu
http://wwwdev.dearborn.ford.com/cmims/daniel/
------------------------------
Date: Thu, 25 Sep 1997 11:45:12 -0400
From: Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com>
Subject: packages -head1 stuff
Message-Id: <342A8708.3D75@daytonoh.ncr.com>
I have written my 1st library module and it works fine but I do have a
question.
When looking at the .pm files that were installed with Perl, i see lines
that have stuff in them that looks like the following
=head1 NAME
Blah Blah
=head1 SYNOPSIS
Blah Blah
=head1 DESCRIPTION
Blah Blah
=cut
I can see that they document the code but where can I find out about
these =headX lines ?
Also, is there some software that recognizes them and prints a report or
something ??
I have all of the Perl books (Camel, llama & panther) but I can not find
any reference to these =headX lines in them.
Thank You
------------------------------
Date: Thu, 25 Sep 1997 14:45:28 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl <=> C Server
Message-Id: <EH2Jnt.7As@world.std.com>
over@the.net (dave) writes:
>>Andrew M. Langmead wrote:
>>> could be converted like this:
>>>
>>> ($name, $id) = unpack 'A32I', $data;
>>
>I'm surprised that this works for you. Exactly how does Perl know the
>last valid character in the name?
The 'A' unpack template strips trailing nuls and spaces. This
behaviour is documented in the entry on pack in the perlfunc man page.
Of course this depends on the C program zeroing out the entire name
field (if not the entire structure) before writing to it (common, but
not mandatory) and that the name field is a valid C (nul terminated)
string.
If the C program is not clearing the entire name field before writing
out the struct, (but is still writing a C string there.) I'd follow
the unpack statement with something like this:
$name =~ s/(.*?)\0.*/$1/s;
--
Andrew Langmead
------------------------------
Date: 25 Sep 1997 10:07:45 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Perl and Informix-SQl
Message-Id: <60dr7h$129@panix.com>
In <01bcc8e4$612effa0$4a7eea9e@NL0806.europe.logica.com> "Nobody" <Nobody@logica.com> writes:
>I'm using perl with isql for a CGI program. I like to know if there is a
>variable that I can use if the sql is performed correctly.
I believe you are looking for the status information returned in the SQLCA
record -- From the pod:
ACCESSING THE SQLCA RECORD
You can access the SQLCA record via either a database handle or
a statement handle.
$sqlcode = $sth->{sqlcode};
$sqlerrm = $sth->{sqlerrm};
$sqlerrp = $sth->{sqlerrp};
@sqlerrd = $sth->{sqlerrd};
@sqlwarn = $sth->{sqlwarn};
Note that the warning information is treated as an array (as in
Informix-4GL) rather than as a bunch of separate fields (as in
Informix-ESQL/C). Inspect the code in the print_sqlca() function
in InformixTest.pm for more ideas on the use of these. You
cannot set the sqlca record.
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: 25 Sep 1997 13:42:52 GMT
From: gbacon@adtran.com (Greg Bacon)
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: perl mail on solaris
Message-Id: <60dpos$ekp$1@info.uah.edu>
[Posted and mailed]
In article <8clo0mcogc.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> writes:
: >>>>> "Greg" == Greg Bacon <gbacon@adtran.com> writes:
: Greg> In article <memo.19970924062231.21497A@skep.compulink.co.uk.cix.co.uk>,
: Greg> neilb@zetnet.co.uk (Neil Briscoe) writes:
: Greg> : The quick solution to this is to use
: Greg> : open (DOMAIL, "| mail -s \"${MailSubject}\" $Mailto");
:
: Greg> That breaks when the shell peers through its beady little eyes, sees
: Greg> a shiny trinket like a $, and goes to grab it. Better to use single
: Greg> quotes:
:
: Greg> open DOMAIL, "| mail -s '${MailSubject}' $Mailto"
: Greg> or die "$0: Failed fork: $!\n";
:
: Greg> because it works with single- or multi-word subjects.
[snip]
: Please don't play around with security. Leave it to the pro's.
Note that in Neil's article, his words were "quick solution". I'm fully
aware that the intersection of quick solutions and secure solutions
is the null set, which is why I offered a better quick solution (modulo
s/'//g which would really piss Tom off--by oversight, not for fear of
the wrath of Tom :-). We're talking quick solutions, so I wasn't
"playing around with security".
Ease off the trigger there, Killer. :-)
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 25 Sep 1997 11:43:16 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Perl Programmer in Los Angeles (Pasadena) are
Message-Id: <60e0qk$kba@panix.com>
In <342A2661.3985@ours.com> Diran Afarian <Ray@ours.com> writes:
> I am looking for a perl programmer in the Pasadena are that can do
>some programming. If anyone is available please let me know. Also let me
>know how you charge.
...and if anyone wants to work in a great environment near the beach
(Manhattan Beach), drop me a message -- We're gearing up to do lotsa
CGI stuff.
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: Thu, 25 Sep 1997 11:44:54 -0400
From: Sijun Zeng <sijun@nortel.ca>
Subject: Perl's pointer
Message-Id: <342A86F6.7137@nortel.ca>
Hi,
Is there any "pointer" in Perl. Like
$a= $b;
$b=1;
print "$a";
I'm expecting $a become 1, how I can do this?
Thanks
Sijun
********************************************************************
My love is my world. The world is my love *
********************************************************************
------------------------------
Date: Thu, 25 Sep 1997 17:42:33 +0200
From: Philippe Le Berre <leberre@bandol.grenoble.hp.com>
To: Eric <pojo@gte.net.nospam>
Subject: Re: perl/win95/Long File Names
Message-Id: <342A8669.F8F0A1CB@bandol.grenoble.hp.com>
Hi,
There's an undocummented function GetShortName that may solve your
problem. Look at <http://www.inforoute.cgs.fr/leberre1/> in the misc
part for a doc on it.
Bye.
--
Philippe Le Berre
SSG - CSBU R&D
Advance Technology Lab, Europe
----------------------------------------------------------------
Hewlett-Packard <leberre@bandol.grenoble.hp.com>
5 av Raymond Chanas Tel : 33 4 76 14 66 05
38053 Grenoble Cedex 9, France Fax : 33 4 76 14 14 65
------------------------------
Date: 25 Sep 1997 13:13:45 +0200
From: Markus Spring <springm@ux0umw50.umw.lhm-net.de>
Subject: Re: regex matching HTML comments
Message-Id: <r4en6dejdi.fsf@ux0umw50.umw.lhm-net.de>
Randals solution leaded me to the question:
How to read the file content into one scalar?
What I do now is to read it into an Array and then join this with "\n"'s,
but I think there's another, better way to do this.
markus
--
spring@umw.cube.net Markus W. Spring
Tel. 0049-89-23323597
FAX 0049-89-23323442
------------------------------
Date: Thu, 25 Sep 1997 17:28:45 +0200
From: Doug Seay <seay@absyss.fr>
To: Markus Spring <springm@ux0umw50.umw.lhm-net.de>
Subject: Re: regex matching HTML comments
Message-Id: <342A832D.181C304B@absyss.fr>
[posted and mailed]
Markus Spring wrote:
>
> Randals solution leaded me to the question:
>
> How to read the file content into one scalar?
>
> What I do now is to read it into an Array and then join this with "\n"'s,
> but I think there's another, better way to do this.
Look up $/ in perlvar. Pay attention to the undef bit.
{
local $/ = undef;
$scalar = <FILE>;
}
It is in a dummy block with a localized $/ so that other parts of the
program are not forced to read entire files. At the end of the block,
the local $/ is destroyed and the older one is reactivated. local() has
mostly been replaced by my(), but it is still usefull from time-to-time.
- doug
------------------------------
Date: Thu, 25 Sep 1997 17:37:43 +0200
From: Per Fredrik Kvarme <perkva@itk.ntnu.no>
Subject: substituting special chars
Message-Id: <Pine.GSO.3.95.970925172906.25574A-100000@brutus>
I've been sitting here for hours trying to figure it out, but since I'm
stuck, I might as well get some suggestions in here:
I want to translate paths and file names from a PC NFS system, for
use on UNIX. Part of that means I have to substitute all the MS-DOS "\"
chars with the UNIX "/". I've tried $string =~ s/\\/\//g and lots of other
ways to do so, but that doesn't make for any change at all in a teststing
like e.g. "c:\user\files\", etc.
If the reason why seems obvious to you, then please let me know as well,
this is really starting to bug me :)
Regards,
- Per Fredrik Kvarme
------------------------------
Date: 25 Sep 1997 15:52:32 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: substituting special chars
Message-Id: <60e1c0$gc@news-central.tiac.net>
In article <Pine.GSO.3.95.970925172906.25574A-100000@brutus>,
Per Fredrik Kvarme <perkva@itk.ntnu.no> wrote:
>
>
> I've been sitting here for hours trying to figure it out, but since I'm
>stuck, I might as well get some suggestions in here:
>
> I want to translate paths and file names from a PC NFS system, for
>use on UNIX. Part of that means I have to substitute all the MS-DOS "\"
>chars with the UNIX "/". I've tried $string =~ s/\\/\//g and lots of other
>ways to do so, but that doesn't make for any change at all in a teststing
>like e.g. "c:\user\files\", etc.
>
>If the reason why seems obvious to you, then please let me know as well,
>this is really starting to bug me :)
You can use s or tr e.g.
$string =~ tr[\\][/];
will work ... however, if you're doing assignments like
$string = "c:\user\files\x";
then watch out for \ escape sequences e.g.
DB<10> $string = "c:\user\files\x"
DB<11> X string
$string = "c:Ser\cLiles\c@"
\us in double quote context upper cases the s, \f is a form feed etc. you
might want to say
$string = 'c:\\user\\files\\x';
to avoid double quotish interpolation, and by doubling up the \ uou can
make sure that any trailing \ doesn't escape the closing '
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: 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 1078
**************************************