[11397] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4994 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 26 16:17:56 1999

Date: Fri, 26 Feb 99 13:11:41 -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           Fri, 26 Feb 1999     Volume: 8 Number: 4994

Today's topics:
        perlcc and .pm modules vgusv@yahoo.com
        perlembed, env , and sockets question (Vladimir Gabrielescu)
        PFR: TZname_to_TZoffset and TZoffset_to_TZname (Larry Rosler)
        Pick up e-mail @ without asking for it ? <David.Rosset@insa-lyon.fr>
    Re: Pick up e-mail @ without asking for it ? <Philip.Newton@datenrevision.de>
    Re: Pick up e-mail @ without asking for it ? (I R A Aggie)
    Re: Pick up e-mail @ without asking for it ? <gsx97@usa.net>
    Re: Pick up e-mail @ without asking for it ? (Larry Rosler)
    Re: Pick up e-mail @ without asking for it ? <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Pick up e-mail @ without asking for it ? <tchrist@mox.perl.com>
    Re: Pick up e-mail @ without asking for it ? <David.Rosset@insa-lyon.fr>
    Re: Pick up e-mail @ without asking for it ? <wmwilson1@go.com>
        Plotting a graph using this data. <ava@softclub.net>
    Re: Plotting a graph using this data. <droby@copyright.com>
        PLS help with regex! <kims@tip.net.au>
    Re: PLS help with regex! (Tad McClellan)
    Re: PLS help with regex! (Ronald J Kimball)
        POD and expanding variables (Jari Aalto+mail.emacs)
        precompiled version mduwjd@maersk.com
    Re: precompiled version (Tad McClellan)
    Re: precompiled version <tchrist@mox.perl.com>
        Premature End of Script Headers (Charles E. Heidal)
    Re: Premature End of Script Headers (Clinton Pierce)
    Re: Premature End of Script Headers <jeromeo@atrieva.com>
    Re: Premature End of Script Headers <fossati@REMOVE.idea.it>
        print in specific frame <lehlal@afuu.fr>
    Re: print in specific frame <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Printing all environment variables (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 21 Feb 1999 20:47:54 GMT
From: vgusv@yahoo.com
Subject: perlcc and .pm modules
Message-Id: <7aprdo$fmh$1@nnrp1.dejanews.com>

Hello everybody,

I am trying to call a .pm module compiled with perlcc from a cgi perl program

How exactly I have to do that

Thank you

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: 25 Feb 1999 09:57:03 -0500
From: vgabriel@lochaber.rutgers.edu (Vladimir Gabrielescu)
Subject: perlembed, env , and sockets question
Message-Id: <7b3obv$a4n$1@lochaber.rutgers.edu>

Hi all,

I find myself in the following scenario. I have a C program which I do 
not which to modify, which provides a perl hook which I do want to 
modify. The perl hook is called via  perl_call_argv or perl_call_pv, 
and I do know that at the time the C programs calls it, it also has a 
socket opened. 

How can I figure out what this socket is?? I would like to do an ident
lookup upon it, but is it anywhere in my env or can I in anyway find it?
Alternatively what information do I need passed from the C program to 
be able to reconstruct that socket and how would I go about it?

Any help appreciated.

Vlad


------------------------------

Date: Thu, 25 Feb 1999 00:45:39 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: PFR: TZname_to_TZoffset and TZoffset_to_TZname
Message-Id: <MPG.113ead8b29a894f4989687@nntp.hpl.hp.com>

Here are a couple of functions for the Perl Function Repository, dealing 
with timezone names and offsets.  Their primary contribution is an up-
to-date, standards-conforming list of timezone names and offsets, which 
is far more complete and accurate than the lists in the module 
Time::Timezone.  (The authors of the module are of course free to steal 
what they want from here. :-)

The Perl code is rather trivial.  The list is preprocessed (when the 
function is loaded) into three hashes for efficient lookup.

Comments and suggestions are welcomed.




#!/usr/local/bin/perl -w
use strict;

# This list follows the conventions of the Unix TZ environment variable
# (see /usr/lib/tztab).  It has two uses:
# 1.  To derive a UTC offset from a specified timezone abbreviation.
# The order of the list favors the North American entries (CST, CDT and
# EST) over the Chinese and Australian.
# 2.  To derive a timezone abbreviation from a specified UTC offset.
# The order of the list favors the most populous name.
# These orderings may be changed locally.
#
# The primary source is ftp://elsie.nci.nih.gov/pub/tzdata1998c.tar.gz .
# The detailed names are descriptive comments only, and are not used.

my @data = qw{
LINT-14          Line Islands (Kiribati)
PHOT-13          Phoenix Islands (Kiribati)
TOT-13           Tonga
CHAST-12:45CHADT Chatham Island (New Zealand)
WFT-12           Wallis & Futuna
WAKT-12          Wake
TVT-12           Tuvalu
NRT-12           Nauru
MHT-12           Marshall Islands
KOST-12          Kosrae (Micronesia)
GILT-12          Gilbert Islands (Kiribati)
FJT-12           Fiji
NZST-12NZDT      New Zealand
NFT-11:30        Norfolk (Australia)
SBT-11           Solomon Islands
PONT-11          Ponape (Micronesia)
NCT-11NCST       New Caledonia
VUT-11VUST       Vanuatu
LHST-10:30LHST   Lord Howe Island (Australia)
YAPT-10          Yap (Micronesia)
TRUT-10          Truk (Micronesia)
PGT-10           Papua New Guinea
MPT-10           Mariana Islands
EST-10           Eastern Australia
CST-9:30         Central Australia
PWT-9            Palau
KST-9            Korea
JAYT-9           Jayapura (Indonesia)
JST-9            Japan
WST-8            Western Australia
ULAT-8ULAST      Ulan Bator (Mongolia)
SGT-8            Singapore
PHT-8PHST        Philippines
MYT-8            Malaysia
BNT-8            Brunei
BORT-8           Borneo (Indonesia)
CST-8CDT         China
CXT-7            Christmas Island (Australia)
JAVT-7           Java (Indonesia)
ICT-7            Indochina
CCT-6:30         Cocos (Australia)
MMT-6:30         Myanmar (formerly Burma)
LKT-6            Sri Lanka
BTT-6            Bhutan
ALMT-6ALMST      Alma-Ata (Kazakhstan)
BDT-6            Bangladesh
NPT-5:45         Nepal
IST-5:30         India
UZT-5            Uzbekistan
TMT-5            Turkmenistan
TJT-5            Tajikistan
MVT-5            Maldives
KGT-5KGST        Kyrghyzstan
IOT-5            British Indian Ocean Territory
GET-5            Georgia
AQTT-5AQTST      Aqtobe (Kazakhstan)
PKT-5            Pakistan
AFT-4:30         Afghanistan
SCT-4            Seychelles
RET-4            Reunion
AZT-4AZST        Azerbaijan
AMT-4AMST        Armenia
GST-4            Gulf
IRT-3:30IRST     Iran
EAT-3            Eastern Africa
AST-3ADT         Arabia
MSK-3MSD         Moscow
SAST-2           South Africa
EET-2EEST        Eastern Europe
CAT-2            Central Africa
IST-2IDT         Israel
WAT-1WAST        Western Africa
MEZ-1MESZ        Germany
CET-1CEST        Central Europe
UTC0             Universal Coordinated
WET0WEST         Western Europe
GMT0BST          Greenwich Mean/British Summer
EGT1EGST         Eastern Greenland
AZOT1AZODT       Azores (Portugal)
FST2FDT          Fernando de Noronha (Brazil)
WGT3WGST         Western Greenland
ART3ARST         Argentina
NST3:30NDT       Newfoundland
AST4ADT          Atlantic
HNE5HAE          Quebec
EST5EDT          Eastern
CST6CDT          Central
MST7MDT          Mountain
PST8PDT          Pacific
PNT8:30          Pitcairn
GAMT9            Gambier Islands (French Polynesia)
AKST9AKDT        Alaska
MART9:30         Marquesas Islands (French Polynesia)
CKT10CKHST       Cook Islands (New Zealand)
TKT10            Tokelau
TAHT10           Tahiti (French Polynesia)
GST10            Guam
HAST10HADT       Hawaii-Aleutians
HST10            Hawaii
WST11            Western Samoa
NUT11            Niue
SST11            American Samoa
};

# Preprocess the data to convert minutes to fractions of hours and to
# eliminate the comments.  The result is three hashes.
my (%tz_name, %tz_std, %tz_dst);
for (@data) {
    next unless /^([A-Z]+)(-?\d+):?(\d*)([A-Z]*)/;
    my $off = 0 - ($2 . ($3 && '.' . $3 * 100 / 60));
    $tz_name{$1} = $off;
    $tz_std{$off} = $1;
    next unless $4;
    $tz_name{$4} = ++$off;
    $tz_dst{$off} = $4;
}

sub TZname_to_TZoffset {
    defined $_[0] && $_[0] =~ /([A-Za-z]{3,})/ ?
        $tz_name{uc $1} : undef
}

sub TZoffset_to_TZname {
    defined $_[0] && $_[0] =~ /([+-]?(?:\d+\.?\d*|\.\d+))/ ?
        $_[1] ? $tz_dst{$1} : $tz_std{$1} : undef
}

# TZname_to_TZoffset: Convert timezone abbreviation to offset from UTC.
# TZoffset_to_TZname: Convert offset from UTC to timezone abbreviation.
# Larry Rosler, 25 February 1999
#
# TZname_to_TZoffset returns the offset from UTC (in hours) of the
#     first apparent timezone abbreviation in its argument, or undef
#     if the argument is invalid or the timezone abbreviation is
#     not defined.  Upper- and lower-case distinctions are ignored.
#
# TZoffset_to_TZname returns the timezone abbreviation corresponding
#     to the first apparent offset from UTC (in hours) in its argument,
#     or undef if the argument is invalid or a timezone with that
#     offset is not defined.  If the optional second argument has a
#     TRUE value, the offset is interpreted as if Daylight Savings Time
#     (Summer Time) is in effect.
__END__

Here are a few tests and their results:

for ('', 'cst', 'cdt', 'nst', 'NDT', 0, 'gmt', 'BST', 'foo') {
    my $name = TZname_to_TZoffset($_);
    print "$_: ", defined $name ? $name : 'undef', "\n";
}
print "\n";
for ([], [9], [-3.5], [-2.5, 'yes'], [0],
        [1, 1], [1,0], [-9,1], [1.1], ['foo']) {
    my $name = TZoffset_to_TZname(@$_);
    print "@$_: ", defined $name ? $name : 'undef', "\n";
}


: undef
cst: -6
cdt: -5
nst: -3.5
NDT: -2.5
0: undef
gmt: 0
BST: 1
foo: undef

: undef
9: JST
-3.5: NST
-2.5 yes: NDT
0: GMT
1 1: BST
1 0: CET
-9 1: HADT
1.1: undef
foo: undef

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Wed, 24 Feb 1999 11:28:50 +0100
From: David ROSSET <David.Rosset@insa-lyon.fr>
Subject: Pick up e-mail @ without asking for it ?
Message-Id: <36D3D461.D73A8D50@insa-lyon.fr>


Hi !

Is it possible to pick up e-mail adress of a person who submit a form to
a Perl script, but without entering it in any field of the form  ?
I think about something like in CGI.pm to get HTTP session variables.

Is there anything to do this ?

Thanks

David


------------------------------

Date: Wed, 24 Feb 1999 15:07:14 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <36D40792.C991322C@datenrevision.de>

David ROSSET wrote:
> 
> Is it possible to pick up e-mail adress of a person who submit a form to
> a Perl script, but without entering it in any field of the form  ?

AFAIK, not reliably, since (a) not all browsers transmit the e-mail
address, and (b) whatever they transmit is not guaranteed to be correct,
anyway.

As far as reading HTTP session variables in a CGI program is concerned,
that should be possible.

Cheers,
Philip


------------------------------

Date: 24 Feb 1999 15:50:00 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <slrn7d8823.9t5.fl_aggie@enso.coaps.fsu.edu>

On Wed, 24 Feb 1999 11:28:50 +0100, David ROSSET
<David.Rosset@insa-lyon.fr> wrote:

+ Is it possible to pick up e-mail adress of a person who submit a form to
+ a Perl script, but without entering it in any field of the form  ?

Not with any reliability. And browser makers know better, 'cause their
users would hunt them down and make them watch re-runs of the Smurfs
for days at a time.

If I want you to have my email address, I'll give it to. If I don't,
I won't.

James


------------------------------

Date: Wed, 24 Feb 1999 11:02:57 -0500
From: "J. Parsons" <gsx97@usa.net>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <7b17rl$3v9@news1.snet.net>

I would say that you should concentrate your search for this function on one
of the many physic services often advertised during late night television.

Actually, if they're such good physics, they'll know you want them to help
you, and should be calling you soon.

Other than that.....no -- you can't.


David ROSSET wrote in message <36D3D461.D73A8D50@insa-lyon.fr>...
>
>Hi !
>
>Is it possible to pick up e-mail adress of a person who submit a form to
>a Perl script, but without entering it in any field of the form  ?
>I think about something like in CGI.pm to get HTTP session variables.
>
>Is there anything to do this ?
>
>Thanks
>
>David




------------------------------

Date: Wed, 24 Feb 1999 11:43:58 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <MPG.113df6544a52b98c989683@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7b17rl$3v9@news1.snet.net> on Wed, 24 Feb 1999 11:02:57 -
0500, J. Parsons <gsx97@usa.net> says...
> I would say that you should concentrate your search for this function on one
> of the many physic services often advertised during late night television.
> 
> Actually, if they're such good physics, they'll know you want them to help
> you, and should be calling you soon.
> 
> Other than that.....no -- you can't.

physic:  ... a medicinal agent or preparation; esp: a medicine that 
purges.

ITYM 'psychic'.  Or perhaps not.  :-)

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 24 Feb 1999 20:59:43 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <83btij1sk0.fsf@vcpc.univie.ac.at>

Re: Pick up e-mail @ without asking for it ?,
Larry <lr@hpl.hp.com> said:

Larry> ITYM 'psychic'.  Or perhaps not.  :-)

I knew you'd post that.

(Sorry.)
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


------------------------------

Date: 24 Feb 1999 14:24:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <36d46df9@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, David.Rosset@insa-lyon.fr writes:
:Is it possible to pick up e-mail adress of a person who submit a form to
:a Perl script, but without entering it in any field of the form  ?
:I think about something like in CGI.pm to get HTTP session variables.
:
:Is there anything to do this ?

No.  That would be evil and wrong.  Moreover, you can't even check
for the validity in real time.

You would have to pre-arrange a login/passwd combo and use
REMOTE_USER to index into a server-side database by that login to 
find out who they were implicitly.

--tom
-- 
Perl itself is usually pretty good about telling you what you shouldn't do. :-)
        --Larry Wall in <11091@jpl-devvax.JPL.NASA.GOV>


------------------------------

Date: Thu, 25 Feb 1999 01:29:45 +0100
From: David ROSSET <David.Rosset@insa-lyon.fr>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <36D49979.2A43451A@insa-lyon.fr>


Just some more words, it's not my intention to do bad things picking up
e-mail address without telling and asking for the authorization to the
user.

It's just to know, if it's possible with reliability or not.

If I need e-mail address of someone, I ask him if he wants to write it
by himself into a field in the form.

Thank you for your answers ! And sorry for possible misunderstanding...

--
David


------------------------------

Date: Thu, 25 Feb 1999 14:36:35 GMT
From: wil <wmwilson1@go.com>
Subject: Re: Pick up e-mail @ without asking for it ?
Message-Id: <7b3n5i$saq$1@nnrp1.dejanews.com>

In article <36D3D461.D73A8D50@insa-lyon.fr>,
  David.Rosset@insa-lyon.fr wrote:
>
> Hi !
>
> Is it possible to pick up e-mail adress of a person who submit a form to
> a Perl script, but without entering it in any field of the form  ?
> I think about something like in CGI.pm to get HTTP session variables.
>
> Is there anything to do this ?
>
> Thanks
>
> David
>

There's no way to do this, possibly the only real way to get close is to have
them enter it one time and set a cookie with the email address as a value,
but that may not make sense for what you're doing.  We really shouldn't be
stealing people's email addresses without them giving them to you anyway.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Fri, 26 Feb 1999 12:35:46 +0300
From: "Alexei Alexandrov" <ava@softclub.net>
Subject: Plotting a graph using this data.
Message-Id: <7b5pod$1nin$1@storm.comstar.ru>

Hello everyone,

I hava to write a script that would plot 3 graphs using a data file whic is
generated avery 5 minutes.

Here is the data i collect:

10:15 26/02/99,54.3,544.2,1039.9
10:20 26/02/99,45.9,201.3,625.3
10:25 26/02/99,41.1,219.4,374.4
10:30 26/02/99,41.7,129.6,358.7
10:35 26/02/99,3713.6,7097.0,10912.9
10:40 26/02/99,180.7,307.0,665.1
10:45 26/02/99,38.4,166.1,413.1
10:50 26/02/99,51.6,145.5,301.7
10:55 26/02/99,40.8,238.5,543.5
11:00 26/02/99,86.8,1214.4,3193.0
11:05 26/02/99,51.6,142.7,314.9
11:10 26/02/99,276.7,950.1,1700.0
11:15 26/02/99,52.1,213.6,465.3
11:20 26/02/99,36.9,91.3,189.1
11:25 26/02/99,47.6,200.6,391.9
11:30 26/02/99,40.0,195.5,696.1
11:35 26/02/99,44.6,164.9,532.9
11:40 26/02/99,265.6,1355.9,2703.9
11:45 26/02/99,238.3,858.6,2068.7
11:50 26/02/99,38.5,268.3,982.0
11:55 26/02/99,68.0,403.1,681.4
12:00 26/02/99,123.1,387.9,640.7
12:05 26/02/99,50.5,210.8,559.6
12:10 26/02/99,51.8,106.3,163.8
12:15 26/02/99,45.3,393.4,1150.8
12:20 26/02/99,142.1,1430.8,3314.6
12:25 26/02/99,162.1,4308.6,9737.4
12:30 26/02/99,186.6,599.5,1182.8
12:35 26/02/99,302.3,781.7,1457.0
12:40 26/02/99,516.1,817.9,1709.0
-----------------------------------------------------
This is a ping statistics to our isp.
As u can see it`s collected every 5 minutes. The question is: How can i use
GD or GIFgraph packages for perl to plot nice graphs like MRTG?
If anyone has some piece of code i can analyze i would be very greatful.

P.S: Sorry for my terrible english.

Best regards,
Alexei Alexandrov.
ava@weblink.ru




------------------------------

Date: Fri, 26 Feb 1999 14:23:40 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: Plotting a graph using this data.
Message-Id: <7b6ap2$6hp$1@nnrp1.dejanews.com>

In article <7b5pod$1nin$1@storm.comstar.ru>,
  "Alexei Alexandrov" <ava@softclub.net> wrote:
> Hello everyone,
>
> I hava to write a script that would plot 3 graphs using a data file whic is
> generated avery 5 minutes.
>
<snip data>
> -----------------------------------------------------
> This is a ping statistics to our isp.
> As u can see it`s collected every 5 minutes. The question is: How can i use
> GD or GIFgraph packages for perl to plot nice graphs like MRTG?
> If anyone has some piece of code i can analyze i would be very greatful.
>

If you already have MRTG, you might want to use it to collect and graph these
stats.  Take a look at the contrib/ping-probe subdirectory of your MRTG
distribution.

MRTG uses GD, but not from a Perl program.  I haven't used it from Perl
either, so I'll let someone else deal with helping you on that.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 22 Feb 1999 16:44:59 +1100
From: Kim Saunders <kims@tip.net.au>
Subject: PLS help with regex!
Message-Id: <36D0EEDB.9D84D380@tip.net.au>

Heya all again,

I have posted pleas for regex help here before, I am kind of getting the
hang of it now, thanks for all who have helped me out along the way.

I have a problem. Can some kind soul please give me an example of how to
check that a variable does NOT contain a certain set of characters (and,
therefore OLNY contains a certain set of characters). My exact
application? Pls, give me an example of how to check that a string
contains ONLY A-Z, a-z, 0-9, " " (space), and "-" (hyphen)??? How would
I do the same, but broaden it to allow, say, a "." or ",", or "_"

Thanks, I'm sure if you point me in the right direction with those
examples I will be able to sort myself out.

Please reply via email to kims@tip.net.au if possible, my dodgy MS
Outlook Express in Win98 is screwed up at the moment, and won't read any
new news headers, and hence to read news, I have to do it the hard way
on another box, or telnet, etc, so please email if possible.

Kind thanks,

KimS



------------------------------

Date: Wed, 24 Feb 1999 03:07:47 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: PLS help with regex!
Message-Id: <j0c0b7.uj8.ln@magna.metronet.com>


[posted, mailed]


Kim Saunders (kims@tip.net.au) wrote:

: I have a problem. Can some kind soul please give me an example of how to
: check that a variable does NOT contain a certain set of characters (and,
: therefore OLNY contains a certain set of characters). My exact
: application? Pls, give me an example of how to check that a string
: contains ONLY A-Z, a-z, 0-9, " " (space), and "-" (hyphen)??? 


   if ( $string =~ /^[A-Za-z0-9 -]+$/ )
      { print "good string\n" }
   else
      { print "bad string\n" }


: How would
: I do the same, but broaden it to allow, say, a "." or ",", or "_"

   if ( $string =~ /^[A-Za-z0-9 .-]+$/ )  # dot
   if ( $string =~ /^[A-Za-z0-9 ,-]+$/ )  # comma
   if ( $string =~ /^[\w .,-]+$/ )        # dot, comma, and underscore

   \w is the same as [A-Za-z0-9_]


: to read news, I have to do it the hard way
: on another box, or telnet, etc, so please email if possible.


   You can follow the thread from a WWW browser at:

      http://www.dejanews.com


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 25 Feb 1999 00:23:20 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: PLS help with regex!
Message-Id: <1dnr8ve.xnai1d197echsN@bay1-206.quincy.ziplink.net>

Tad McClellan <tadmc@metronet.com> wrote:

>    if ( $string =~ /^[A-Za-z0-9 -]+$/ )
>       { print "good string\n" }
>    else
>       { print "bad string\n" }
>    if ( $string =~ /^[A-Za-z0-9 .-]+$/ )  # dot
>    if ( $string =~ /^[A-Za-z0-9 ,-]+$/ )  # comma
>    if ( $string =~ /^[\w .,-]+$/ )        # dot, comma, and underscore

All of those examples permit a newline at the end of the string, which
may or may not be important.


These examples avoid that possible problem entirely:

if ( $string !~ /[^A-Za-z0-9 -]/ ) {
    print "good string\n";
} else {
    print "bad string\n";
}

if ( $string !~ /[^A-Za-z0-9 .-]/ )
if ( $string !~ /[^A-Za-z0-9 ,-]/ )
if ( $string !~ /[^\w .,-]/ )

-- 
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
    perl -e 'for(sort keys%main::){print if /[^\S]/}
        ' -s  -- -' Just' -' another ' -'Perl ' -'hacker 
' http://www.ziplink.net/~rjk/  [rjk@linguist.dartmouth.edu]


------------------------------

Date: 23 Feb 1999 09:39:31 +0200
From: jari.aalto@poboxes.com (Jari Aalto+mail.emacs)
Subject: POD and expanding variables
Message-Id: <ptraey5a7rg.fsf@sinivuokko.i-have-a-misconfigured-system-so-shoot-me>



	Is it possible to make Perl expand variables in POD?

		=pod

		=head VERSION

		$VERSION

		=cut

	jari		


------------------------------

Date: Wed, 24 Feb 1999 14:02:49 GMT
From: mduwjd@maersk.com
Subject: precompiled version
Message-Id: <7b10q4$ju3$1@nnrp1.dejanews.com>

Anyone know where I can download a latest pre-compiled version of Perl ?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Wed, 24 Feb 1999 04:34:32 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: precompiled version
Message-Id: <83h0b7.4ia.ln@magna.metronet.com>

mduwjd@maersk.com wrote:
: Anyone know where I can download a latest pre-compiled version of Perl ?


   Uhhh, if you insist on pre-compiled you should probably
   mention what architecture/OS you need it for...


   Perl FAQ, part 2:

---------------------------
=head2 What machines support Perl?  Where do I get it?

The standard release of Perl (the one maintained by the perl
development team) is distributed only in source code form.  You
can find this at http://www.perl.com/CPAN/src/latest.tar.gz, which
in standard Internet format (a gzipped archive in POSIX tar format).

Perl builds and runs on a bewildering number of platforms.  Virtually
all known and current Unix derivatives are supported (Perl's native
platform), as are proprietary systems like VMS, DOS, OS/2, Windows,
QNX, BeOS, and the Amiga.  There are also the beginnings of support
for MPE/iX.

Binary distributions for some proprietary platforms, including
Apple systems can be found http://www.perl.com/CPAN/ports/ directory.
Because these are not part of the standard distribution, they may
and in fact do differ from the base Perl port in a variety of ways.
You'll have to check their respective release notes to see just
what the differences are.  These differences can be either positive
(e.g. extensions for the features of the particular platform that
are not supported in the source release of perl) or negative (e.g.
might be based upon a less current source release of perl).

A useful FAQ for Win32 Perl users is
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
---------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 24 Feb 1999 10:33:08 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: precompiled version
Message-Id: <36d437d4@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    tadmc@metronet.com (Tad McClellan) writes:
:A useful FAQ for Win32 Perl users is
:http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

Except that he -- and hit site -- have mysteriously vaporized.

--tom
-- 
"I believe OS/2 is destined to be the most important operating
system, and possibly program, of all time" - Bill Gates, Nov, 1987.


------------------------------

Date: Wed, 24 Feb 1999 13:02:20 -0800
From: Charlie.heidal@romad.com (Charles E. Heidal)
Subject: Premature End of Script Headers
Message-Id: <MPG.113e08b3d6528dae989681@192.168.0.1>

Although a novice to Perl Im a very good programmer and this particular 
error is giving me fits.  What EXACTLY does it mean.  None of the books 
Ive bought on Perl and CGI tell me anything useful other that "Its an 
Error message"   Any help you can give would be appreciated.

Charles Heidal

charles.heidal@romad.com


------------------------------

Date: Wed, 24 Feb 1999 21:32:06 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: Premature End of Script Headers
Message-Id: <36d46e95.797068651@news.ford.com>

On Wed, 24 Feb 1999 13:02:20 -0800, Charlie.heidal@romad.com (Charles
E. Heidal) wrote:

>Although a novice to Perl Im a very good programmer and this particular 
>error is giving me fits.  What EXACTLY does it mean.  None of the books 
>Ive bought on Perl and CGI tell me anything useful other that "Its an 
>Error message"   Any help you can give would be appreciated.

If the CGI book really gives no help with this: then you bought a
lousy CGI book.  Write the author, tell him it sucks, ask for your
money back.

Look for the "Please-don't-be-offended-by-the-name Idiot's Guide to
Solving Perl/CGI Problems" on the Web or the Perl Cookbook for an
explanation.  

Hint: this is NOT a Perl question.  It's a CGI question.  Check your
server error logs.  If you don't know where they are, then check the
Idiot's Guide.

-- 
 Clinton A. Pierce    "If you rush a Miracle Man, you get rotten
 cpierce1@ford.com        miracles" --Miracle Max, The Princess Bride
clintp@geeksalad.org   http://www.geeksalad.org


------------------------------

Date: Wed, 24 Feb 1999 14:11:41 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: "Charles E. Heidal" <Charlie.heidal@romad.com>
Subject: Re: Premature End of Script Headers
Message-Id: <36D4791D.C705949@atrieva.com>

Charles E. Heidal wrote:
> 
> Although a novice to Perl Im a very good programmer and this particular
> error is giving me fits.  What EXACTLY does it mean. 

Just exactly what it says.  Your script has prematurely terminated
before headers were complete.

> None of the books
> Ive bought on Perl and CGI tell me anything useful other that "Its an
> Error message"   Any help you can give would be appreciated.

Because it has nothing to do with perl, and more to do with your
particular web server.  You would get the same error message if you
wrote in COBOL.  For more exciting detail on HTTP, headers, and return
codes, read RFC 2068, or ask in one of the many newsgroups dedicated to
CGI, HTTP and other things webish.

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


------------------------------

Date: Thu, 25 Feb 1999 00:09:44 +0100
From: "Alberto Fossati" <fossati@REMOVE.idea.it>
Subject: Re: Premature End of Script Headers
Message-Id: <7b1vc7$9fb@news.global-one.it>


>Although a novice to Perl

Me too.

Yesterday I had the same problem. and I've fixed it paying more attention at
the the first line on output, the ones concerning the header...

print "Content-type: text/html \n\n" ;

I had used the string delimiter ' instead of " and the cariage return seems
not to be translated correctly...
It seems to me that in some type of perl script you must end with "\r\n\r\n"
rather than the simpler "\n\n"

Hope some else can be more helpful than me.

Alberto Fossati
[fossati@singular.spamustdie.it]




------------------------------

Date: Thu, 25 Feb 1999 18:48:27 +0100
From: Lehlal Hanifi <lehlal@afuu.fr>
Subject: print in specific frame
Message-Id: <36D58CEA.D31F27C3@afuu.fr>

Hello world !

Does anybody can tell me how can i print a sub routine in a dpecific
frame ,  other than <A HRE=...
Sorry for for the synthax.

merci.



------------------------------

Date: 25 Feb 1999 20:04:52 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: print in specific frame
Message-Id: <83678qb8yz.fsf@vcpc.univie.ac.at>

Re: print in specific frame, Lehlal <lehlal@afuu.fr>
said:

Lehlal> Hello world !  Does anybody can tell me how
Lehlal> can i print a sub routine in a dpecific
Lehlal> frame , other than <A HRE=...  Sorry for for
Lehlal> the synthax.

frame?  This is a CGI question in disguise isn't it?

Yes, you can tell perl to output anything.

See perldoc CGI for how to address HTML frames.

(This isn't really a perl quesrtion is it?  It's CGI
and HTML.  Independent of server-side implementation.)

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


------------------------------

Date: Sun, 21 Feb 1999 17:28:15 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Printing all environment variables
Message-Id: <MPG.113a527ca40aba0c989a68@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <alecler-2102991218180001@dialup-619.hip.cam.org> on Sun, 21 
Feb 1999 12:18:18 -0500, Andre L. <alecler@cam.org> says...
 ...
> > > >print map{"$_\t$ENV{$_}\n"} (sort keys %ENV);
 ...
> Second point, as Jonathan stated, map() is not being used in a void
> context here, since the result of the map is used by print(). However, it
> is not very appropriate to produce a list of strings like that before
> printing it.

Why not?  Invoking 'print' once with a list of strings is probably 
optimal in performance for reasonably-sized lists.

> Now, this one below is a use of map() in a void context:
> 
>    map { print } ( some_list );
> 
> This particular example is not really a sin, though, because print() does
> not return any value, so the list returned by map() is empty.

Not at all.  'print' returns TRUE or FALSE depending on whether the 
operation succeeded (for example, it could fail if printing to a file 
when there is no space left in the file system).  But very few 
programmers bother to check it, perhaps because it is usually in a loop, 
or perhaps for sheer laziness.

>       IMO, this is
> the one exception where using map solely for its side-effect may be
> considered legitimate by a pragmatic programmer. 

The use of
   map { print } ( some_list );
instead of
   for ( some_list ) { print }
or (in 5.005)
   print for some_list;
in the above is the opposite of 'legitimate' -- more like 'grotesque' 
IMO.  But I would do it in the way proposed first -- with 'map' and a 
single 'print' statement.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4994
**************************************

home help back first fref pref prev next nref lref last post