[10309] in Perl-Users-Digest
Perl-Users Digest, Issue: 3901 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 6 12:07:29 1998
Date: Tue, 6 Oct 98 09:00:35 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 6 Oct 1998 Volume: 8 Number: 3901
Today's topics:
"restoring" hard references pcbel@my-dejanews.com
Re: Accessing Access97 using ADO DB... <tbornhol@nospamprioritytech.com>
Re: Accessing Access97 using ADO DB... (Paul Murray)
ANNOUNCE: DBD::DB2 version .70 released ()
ANNOUNCE: Apache::ParseLog module <akira@discover-net.net>
Announce: Convert::Context <schwartz@cs.tu-berlin.de>
ANNOUNCE: HTMLView - creating web GUIs to DBI database (Hakan Ardo)
ANNOUNCE: HTMLView - creating web GUIs to DBI database (Hakan Ardo)
Announce: Squeeze.pm - Compress English text to Pagers/ (Jari Aalto+mail.perl)
ANNOUNCE: Watchdog-0.04 paul@miraclefish.com
Apache-ASP script troubles... <horst.k@netway.at>
Re: Are there any "perl.newbie" group or forum? <barnett@houston.Geco-Prakla.slb.com>
Re: Are there any "perl.newbie" group or forum? <ludlow@us.ibm.com>
Re: CGI.pm objects <jdporter@min.net>
Chart 0.99 on CPAN dbonner@cs.bu.edu
Re: Common prefix for an array of strings <jdporter@min.net>
comp.lang.perl.win32?? thom_co@my-dejanews.com
Compile <commitman@digitalnet.com.br>
Re: Compile <commitman@digitalnet.com.br>
Compress::Zlib and zip files <froeming@quikpage.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 06 Oct 1998 14:49:16 GMT
From: pcbel@my-dejanews.com
Subject: "restoring" hard references
Message-Id: <6vdalc$oah$1@nnrp1.dejanews.com>
Hi,
Is it possible to do something like this?
---
$hashref=\%somehash;
# do something with %somehash
#
# Restore the hash
#
# This doesn't work obviously:
\%somehash=$hashref;
---
This is not an option:
$somehash=$hashref;
%$somehash{somekey}="some value";
Thanks!
Peter Bel
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 6 Oct 1998 08:53:01 -0500
From: "Tim Bornholtz" <tbornhol@nospamprioritytech.com>
Subject: Re: Accessing Access97 using ADO DB...
Message-Id: <dgpS1.945$A6.223953@newscene.newscene.com>
The full set of documentation for ADO is available at
http://www.microsoft.com/data/reference/ado2.htm
Tim Bornholtz
haller wrote in message <3618D6BF.4E79DC6E@broadnet.ascom.ch>...
>1. How or where can I find descriptions of the available methods of a
>recordset-object?
>thanks for all help.
------------------------------
Date: 6 Oct 1998 14:31:45 GMT
From: murray-paul@usa.net (Paul Murray)
Subject: Re: Accessing Access97 using ADO DB...
Message-Id: <slrn71kaeh.jg2.murray-paul@unix3.netaxs.com>
On Tue, 06 Oct 1998 13:48:38 +0200, haller <stefan.haller@ascom.ch> wrote:
>use OLE;
>$cnDB = CreateObject OLE 'ADODB.Connection' or
>&DisplayErrorMsg(5,"ADODB.Connection"); #die "CreateObject: $!";
>$cnDB->Open('Test');
>$sql = "SELECT * FROM TestTable;";
>$rsData = $cnDB->Execute($sql);
>while ( !$rsData->EOF ) {
> print $rsData->Fields('Name')->Value;
> $rsData->MoveNext;
>}
>$rsData->MoveLast;
>print $rsData->RecordCount;
>$rsData->Close();
>$cnDB->Close();
I don't have the packages installed to test this, so it is only a
guess, but from the ADO manpage for Execute:
"The returned Recordset object is always a read-only, forward-only
cursor. If you need a Recordset object with more functionality, first
create a Recordset object with the desired property settings, then use
the Recordset object's Open method to execute the query and return the
desired cursor type."
And from the page for Recordset:
"You can use the MoveFirst, MoveLast, MoveNext, and MovePrevious
methods, as well as the Move method, and the AbsolutePosition,
AbsolutePage, and Filter properties to reposition the current record,
assuming the provider supports the relevant functionality. Forward-only
Recordset objects support only the MoveNext method."
Try opening the recordset separately, as they suggest.
This seems to be non-perl related, so should be moved to an MS newsgroup.
(Btw, why not open the table directly, rather than doing a select *?)
-Paul Murray
------------------------------
Date: 6 Oct 1998 15:24:51 GMT
From: mhm@ausmail.austin.ibm.com ()
Subject: ANNOUNCE: DBD::DB2 version .70 released
Message-Id: <6vdco3$cg3$1@news.neta.com>
DBD::DB2 version 0.70 has been release to CPAN by
IBM Toronto. This is the first release to have official
support from IBM.
Currently, available from CPAN as DBD-DB2-0.70.tar.gz
--
#include <Standard_Disclaimer> -----IBM office: 512-823-7883 or tl 793
Michael H. Moran | Pager: 800-SKY-ibm1 PIN: 8825437
mhm@austin.ibm.com | Email2Pager: 8825437@skymail.com
IBM Corporation, Austin, Texas | Home Off: 512-259-9386 or tl 450-9743
------------------------------
Date: 6 Oct 1998 15:26:13 GMT
From: Akira Hangai <akira@discover-net.net>
Subject: ANNOUNCE: Apache::ParseLog module
Message-Id: <6vdcql$cnv$1@news.neta.com>
Apache::ParseLog Module
Object-oriented Perl extension for parsing Apache log files
Apache::ParseLog provides an easy way to parse the Apache log files,
using an object-oriented constructs. The data obtained using this module
are generic enough that it is flexible to use the data for your own
applications, such as CGI, simple text-only report generater, feeding
RDBMS, data for Perl/Tk-based GUI application, etc.
Feature:
1) Easy and portable log-parsing methods
2) Support for LogFormat/CustomLog introduced by Apache 1.3.x
(dynamically constructed regex)
Synopsis:
use Apache::ParseLog;
$base = new Apache::ParseLog($path_to_httpd_conf);
$transferlog = $base->getTransferLog();
%bytebydate = $transferlog->bytebydate();
foreach (sort keys %bytebydate) {
# print, "date: bytes", e.g., "09/25/1998: 123456 bytes"
print "$_:\t$bytebydate{$_} bytes\n"
}
I'll really appreciate comments, suggestions, opnions, etc.
URL (for now): http://206.30.13.158/perl
Should be available at CPAN shortly
(CPAN/by-module/Apache/Apache-ParseLog-1.00.tar.gz)
--
Akira Hangai <akira@discover-net.net>
1024/0F504319/60 F4 08 43 CD 08 2C 73 80 16 77 B2 A5 C7 E4 30
------------------------------
Date: 6 Oct 1998 15:21:32 GMT
From: Martin Schwartz <schwartz@cs.tu-berlin.de>
Subject: Announce: Convert::Context
Message-Id: <6vdchs$bl0$1@news.neta.com>
Hi,
As part of a larger work I wrote a module dealing with Attributed Strings.
It adapts perl's string commands, so the usage should flow easily into
your mind. I called it Convert::Context. Convert, because I assumed it to
be the typical environment where this module will be used. Context, because
it deals with connotated Texts.
Ok, the name is negotiable. ;)
The module might be interesting for all persons dealing with texts having
format tags or other stuff mixed among. Think of HTML, XML, WordPerfect.
Current state might be characterized as "working but not optimized".
So here comes Convert::Context. An excerpt of the man page follows below.
The distribution file is called:
Convert-Context-0.500.tar.gz
I just put it into my CPAN directory. You can get it also directly from:
http://wwwwbs.cs.tu-berlin.de/~schwartz/perl/
Have fun,
Martin
=== schnipp
NAME
Convert::Context - an Attributed Text data type
- ALPHA - release
SYNOPSIS
See below.
DESCRIPTION
Convert::Context maintains attributed strings. It allows
you to access those strings similar to perl's normal
strings.
An attributed string is a string to that attributes are
connected at certain string positions. An attribute can be
everything scalar: numbers, strings, references are
welcome. Attributes are not part of the string. Semantics
of the attributes have to be done by the applying code.
What does this mean?
A basic work for a text system is to localize a certain
text part. This is trivial if you have only plain text to
look at. It is no longer trivial, if you have attributes
or entries among your text like: bold, italic, bookmarks
and so on. One has two strategies to mingle attributes
with a string:
1. You can enrich the text by inserting control codes.
E.g., if you have a line with two bold words:
(A) "The word bold is always bold"
it would look (here with HTML controls) like:
(B) "The word <b>bold</b> is always <b>bold</b>"
If you would look for the text "bold is" in (B) with
perls m// operator, you'd fail. You would have to
strip the HTML control sequences first. This is an ok
method, but not used here.
2. You can maintain separate lists, holding at which
position of the text which control codes are stored.
This is, what Convert::Context does. The example from
above would look like:
offset 0---------1---------2-------
text The word bold is always bold
attrib (0 1 0 1 )
[...]
new
$Ct = Convert::Context -> new (
[$cs]
)
$Ct = Convert::Context -> new (
[$cs,] \$txt [,[@a], [@o]]
)
$Ct = Convert::Context -> new (
[$cs,] [\$txt [,[@a], [@o]]], [...], ...
)
Returns a new Context string. It can be initialized
three ways: (1) Without parameters, (2) with a
reference to a text string, an attrib list reference
and an offset list reference, or (3) with a list of
references of (2).
Optionally it can be initialized with a leading
parameter $cs. This stands for "character length" and
specifies the byte size of one character. One needs
this when using e.g. UTF16 (Unicode) characters.
Example:
(1)
$Empty = Convert::Context -> new;
(2)
$Plain = Convert::Context -> new (\("Plain text\n"));
$Bold = Convert::Context -> new (\("Attribute 1 text"), [1]);
(3)
Special (but useful) case:
$Mixed = Convert::Context -> new (
[\("This is an "), [0] ],
[\("all bold"), [122] ],
[\(", short and sometimes ") ],
[\("italic"), ["Strange text attribute"] ],
[\(" text." ]
;
Attribute 0 and Offset 0 is used as default value, if
none is explicitly given. The meaning of all
attributes (here 0, 122 and "Strange text attribute")
has to be defined 100% by the applying code. In this
example one would assume, that a text processor was
connoting the attributes 0, 122 and "Strange text
attribute" to the semantics: plain, bold and italic.
replace
$n = $Ct -> replace ($pattern, $replace, egimosx)
Replaces one or all occurrances matching to $pattern
with $replace. Returns the number of replacements, or
false if pattern is not found. Implemented mainly via
perls replace operator:
s/$pattern/$replace/egimosx
$replace here can be a string, a Context or a code
reference. In the latter case this routine will be
called at each match, passing the matched string as
parameter. The matched text will then be replaced with
the return value of the routine.
$n = $Ct -> replace ([@pattern], [@replace], egimosx)
You can call replace with list references holding
corresponding sets of patterns and replacements.
pattern and replace can be strings or Contexts, and
replace additionally code references. The patterns
will be glued together to a single pattern match,
using pattern match or operator |.
Examples:
(1) $Ct -> replace ("krims", "kram", "g")
Option g says, that not only one, but all occurrances
of string "krims" shall be substituted by string
"kram". "kram" will get the attributes of "krims"
(see method "substr"). If you want to have more
control about the attributes of "kram", you can pass
the replacement string as a Context.
(2) $Ct -> replace ("krims", $Ct, "g")
Replaces all occurrances of string "krims" with the
Context $Ct. This is useful, if you want to have $Ct
special attributes.
(3) $Ct -> replace (" asta tu ", " AStA TU ", "ig")
Option i says, that the characters case shall be
ignored. So example (3) would replace " asta tu ", "
ASTA TU ", " Asta Tu " ... with " AStA TU ". (AStA
stands for Allgemeiner Studierendenausschuss. Students
governments are called like this in Germany and quite
cool).
(4) $Ct -> replace ("\02", \&footnote, "g")
This would call a function "footnote". The function
will be called with three parameters:
&function($match, $Ct, $pos)
1. The matched string (here "\02")
2. The Context (here $Ct)
3. The match position
(5) $Ct -> replace ("krims", sub {allow (@_, "kram")}, "ig")
This notation would call a function "allow" for each
match, quite like (4). But further more here the
string "kram" would be passed as additional parameter.
(6) $Ct -> replace (["a", "o"], ["o", "a"], "g")
Substitutes a's with o's and o's with a's.
[...]
substr
$Ct2 = $Ct1 -> substr ($o1, $l1)
Returns a partial Context of Ct1 as new Context Ct2.
Ct2 will be copied from Ct1 starting at position o1
and with the length l1.
$Ct = $Ct -> substr ($o1, $l1, $str [,$o2, $l2])
If a string is given as argument, the partial Context
starting at offset o1 with length l1 is substituted by
string. String gets the attributes of the partial
Context. If e.g. the string to be replaced would be
"<0>di<1>n<2>g<0>s", after the replacement it might
look like "<0>bu<1>m<2>s".
$Ct1 = $Ct1 -> substr ($o1, $l1, $Ct2 [,$o2, $l2])
The partial Context of Ct1 starting at offset o1 with
length l2 is substituted by Context Ct2.
If o<n> is undef, o<n> is set to 0.
If l<n> is undef, l<n> is set according to end of
Ct<n>
[...]
=== schnapp
--
// Le degre zero de l'ecriture? Zero probleme!
------------------------------
Date: 6 Oct 1998 15:24:12 GMT
From: hakan@hobbe.lub.lu.se (Hakan Ardo)
Subject: ANNOUNCE: HTMLView - creating web GUIs to DBI databases
Message-Id: <6vdcms$c9c$1@news.neta.com>
Hi,
I would like to announce that version 0.1 of DBIx::HTMLView now is
availibe at CPAN as:
authors/id/H/HA/HAKANARDO/DBIx-HTMLView-0.1.tar.gz
This is a general propose module to simplify the creation of web
userinterfaces to a DBI database, currently it can list, view, add,
edit and delete entries in the databse using either <input ...> or
<textarea> to gather the info.
It can also edit N2N relations between two tabels using a third table
to represent the connections.
It's actions is highy customizable by using a database definition
where most things are specified and by beeing designed to easily
allow subclassing in order to change it's behaviour.
It is constructed as a set of objects that could be considered
editors or viewers. Those objects can either be used as they are
or be subclassed if they can be customized enough for your needs.
See the View.cgi example for the simples posible use that gields a
quite powerfull cgi based editor.
--
---------------------------------------------------------------
Name: Hakan Ardo
E-Mail: hakan@debian.org
WWW: http://www.ub2.lu.se/~hakan/sig.html
Public Key: Try "finger hakan@master.debian.org"
Fingerprint: E9 81 FD 90 53 5C E9 3E 3D ED 57 15 1B 7E 29 F3
Interests: WWW, Programming, 3D graphics
Thought for the day: As long as one understands, the
spelling does not matter :-)
---------------------------------------------------------------
------------------------------
Date: 6 Oct 1998 15:22:47 GMT
From: hakan@hobbe.lub.lu.se (Hakan Ardo)
Subject: ANNOUNCE: HTMLView - creating web GUIs to DBI databases
Message-Id: <6vdck7$bvb$1@news.neta.com>
Hi,
I would like to announce that version 0.1 of DBIx::HTMLView now is
availibe at CPAN as:
authors/id/H/HA/HAKANARDO/DBIx-HTMLView-0.1.tar.gz
This is a general propose module to simplify the creation of web
userinterfaces to a DBI database, currently it can list, view, add,
edit and delete entries in the databse using either <input ...> or
<textarea> to gather the info.
It can also edit N2N relations between two tabels using a third table
to represent the connections.
It's actions is highy customizable by using a database definition
where most things are specified and by beeing designed to easily
allow subclassing in order to change it's behaviour.
It is constructed as a set of objects that could be considered
editors or viewers. Those objects can either be used as they are
or be subclassed if they can be customized enough for your needs.
See the View.cgi example for the simples posible use that gields a
quite powerfull cgi based editor.
--
---------------------------------------------------------------
Name: Hakan Ardo
E-Mail: hakan@debian.org
WWW: http://www.ub2.lu.se/~hakan/sig.html
Public Key: Try "finger hakan@master.debian.org"
Fingerprint: E9 81 FD 90 53 5C E9 3E 3D ED 57 15 1B 7E 29 F3
Interests: WWW, Programming, 3D graphics
Thought for the day: As long as one understands, the
spelling does not matter :-)
---------------------------------------------------------------
------------------------------
Date: 6 Oct 1998 15:28:47 GMT
From: jari.aalto@poboxes.com (Jari Aalto+mail.perl)
Subject: Announce: Squeeze.pm - Compress English text to Pagers/GSM phones
Message-Id: <6vdcvf$cu5$1@news.neta.com>
This is first release of
Lingua::EN::Squeeze.pm
A module that I use to compress text from email before it is
sent to my Cellular phone. If you have a pager, you know how
tight the space is and every extra characters saver is a plus.
A shortened POD page follows. The Module's Interface functions
and interface variables are not included in this announcement.
Uploaded to CPAN today, but also available via email. The version
number is based on ISO date format YYYY.MMDD.
https://pause.kbx.de/pub/PAUSE/authors/id/J/JA/JARIAALTO/
Lingua-EN-Squeeze-1998.0925.tar.gz 10k
I would welcome more text compresion rules, so feel free to
suggest more hash entries like:
WORD => CONVERSION
MULTI WORD => CONVERSION
jari
NAME
Squeeze.pm - Shorten text to minimum syllables by using hash and vowel
deletion
REVISION
$Id: Squeeze.pm,v 1.20 1998/09/25 18:50:12 jaalto Exp $
SYNOPSIS
use Squeeze.pm; # imnport only function
use Squeeze qw( :ALL ); # function + variables
use English;
while (<>)
{
print SqueezeText $ARG;
}
DESCRIPTION
Squeeze text (English) to most compact format possibly so that it is
barely readable. You shold convert all text to lowercase for maximum
compression, because optimisations have been designed mostly fr
unpapitalised letters.
`Warning: Each line is processed multiple times, so prepare for slow
conversion time'
You can use this module eg to preprocess text before it is sent to
electronic media that has maximum text size limit. For example Pagers
have some arbitrary text size limit, say 200 characters, which you want
to fill as much as possible. Alternatively you may have GSM Cellular
phone wich is capable of receiving Short Messages (SMS), whose text
limit is 160 characters. To your amusement, the description text of this
paragraph has been converted below using this library's SqueezeText()
function . See yourself if it's readable (Yes, it takes some time to get
used to). The compress ratio is typically 30-40%
u _n use thi mod to prprce txt bfre i_s snt to
elrnic mda t_hs max txt siz lim. f_xmple Pag hv
som abitry txt siz lim, say 200 chr, W/ u wnt to fll
as mch as psbleAlternatvly u may hv GSM Cllar PH wch is
cpble of rcivng Short msg (SMS), WS/ txt lim is 160
chrTo u/ amsment, dsc txt of thi prgra has
ben cnv_ blow usng thi lbrrys SquezText() fnc See
uself if i_s redble (Yes, it tak som T to get usdto
compr rati is typcly 30-40
There are few grammar rules which are used to shorten some English
tokens very much:
Word that has _ is usually a verb
Word that has / is usually a substantive, noun,
pronomine or other non-verb
For example, these tokens must be understood before text can be read.
This is not yet like Geek code, because you don't need external parser
to understand this, but just some common sense and time to adapt
yourself to this text. *For a complete up to date list, you have to peek
the source code*
, 'for' => '4'
, 'for him' => '4h'
, 'for her' => '4h'
, 'for them' => '4t'
, 'for those' => '4t'
, can => '_n'
, does => '_s'
, 'it is' => 'i_s'
[..zap..]
EXAMPLES
To add new words e.g. to word conversion hash table, you'd define your
custom set and merge them to existing ones. Do similarly to
`%SQZ_WXLATE_MULTI_HASH' and `$SQZ_ZAP_REGEXP' and then start using the
conversion function.
use English;
use Squeeze qw( :ALL );
my %myExtraWordHash =
(
new-word1 => 'conversion1'
, new-word2 => 'conversion2'
, new-word3 => 'conversion3'
, new-word4 => 'conversion4'
);
# First take the existing tables and merge them with my
# translation table
my %mySustomWordHash =
(
%SQZ_WXLATE_HASH
, %SQZ_WXLATE_EXTRA_HASH
, %myExtraWordHash
);
my $myXlat = 0; # state flag
while (<>)
{
if ( $condition )
{
SqueezeHashSet \%%mySustomWordHash; # Use MY conversions
$myXlat = 1;
}
if ( $myXlat and $condition )
{
SqueezeHashSet "reset"; # Back to default table
$myXlat = 0;
}
print SqueezeText $ARG;
}
Similarly you can redefine the multi word thanslate table by supplying
another hash reference in call to SqueezeHashSet(), and to kill more
text immediately in addtion to default, just concatenate the regexps to
*$SQZ_ZAP_REGEXP*
KNOWN BUGS
There may be lot of false conversions and if you think that some word
squeezing went too far, please turn on the debug end send the log to the
maintainer. To see how the conversion goes e.g. for word *Messages*:
use English;
use Lingua::EN:Squeeze;
SqueezeDebug( 1, '(?i)Messages' );
$ARG = "This line has some Messages in it";
print SqueezeText $ARG;
AVAILABILITY
Mailto: jari.aalto@poboxes.com HomePage via forwarding service is at
http://www.netforward.com/poboxes/?jari.aalto or alternatively absolute
url is at ftp://cs.uta.fi/pub/ssjaaa/ but this may move without notice.
Prefer keeping the forwarding service link in your bookmark.
AUTHOR
Copyright (C) 1998-1999 Jari Aalto. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same
terms as Perl itself or in terms of Gnu General Public licence v2 or
later.
------------------------------
Date: 6 Oct 1998 15:20:57 GMT
From: paul@miraclefish.com
Subject: ANNOUNCE: Watchdog-0.04
Message-Id: <6vdcgp$bgo$1@news.neta.com>
Recently posted to CPAN. Here's a description and release notes.
Watchdog::Process, Watchdog::HTTP and Watchdog::Mysql are classes for
monitoring whether a process, http server or mysql server respectively
is functioning. The Watchdog module also includes a number of 'monitor'
scripts which can be used with the system monitoring package 'Mon'
(http://consult.ml.org/~trockij/mon). Some of these scripts make use
of the Watchdog::* classes, others make use of SNMP. For more details
see the embedded pod.
Release 0.04
- Classes renamed (suggested by Tim Bunce).
Watchdog::Service => Watchdog::Process
Watchdog::HTTPService => Watchdog::HTTP
Watchdog::MysqlService => Watchdog::Mysql
- Watchdog::Process de-coupled from other classes as Proc::ProcessTable only
compiles on Linux and Solaris.
- Watchdog::Mysql::is_alive() returns reason for failure.
- Added 'Mon' monitors
- t/{mysql.t,process.t} now skipped if prerequisites not installed
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 06 Oct 1998 17:41:51 +0200
From: virgil <horst.k@netway.at>
Subject: Apache-ASP script troubles...
Message-Id: <361A3A3F.36554266@netway.at>
Hi there,
I have tried to use the Apache - ASP script (CPAN). But on compiling
some strange error occured:
1) on "make test" perl could not find the module "T.pm" in my @INC. Can
somebody
tell me where I can find this module?
2) on "make" :
/usr/bin/pod2man: Unrecognized pod directive in paragraph 308 of ASP.pm:
text
'got an idea?
Thanx,
Horst
------------------------------
Date: Tue, 06 Oct 1998 08:51:03 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: Hauk Langlo <hauk@forumnett.no>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361A2047.B39E542@houston.Geco-Prakla.slb.com>
Hauk Langlo wrote:
>
> I'm sure there are a lot of people reluctant to post questions here
> afraid of having "RTFM" yelled in their face each time.
Hauk:
<$0.02>
Being told to read the f*&king manual (RTFM) is this groups way of
'teaching you to fish', rather than just feeding you. (You know the old
adage: Give a man a fish, he'll eat for a day. Teach a man to fish,
and he'll eat for a lifetime.)
> I'm not an
> expert myselfe and I would really like to know if there are any
> discussion forums etc where it is actually legal to ask questions that
> might be of a basic nature to some.
comp.lang.perl.misc is here to allow you to ask your questions, but it
is not here to answer stupid[*] ones.
> If you know about something like
> that, please let me know and me and probably a lot of other will go away
> and leave you guys alone.
The posters of this group do not want you to 'go away and leave you guys
alone'. What they are trying to do is seperate the corn from the schaff
(sp?). In other words, if you can't read the documentation (whether you
understand it or not), then you shouldn't be programming.
Some general rules that will help you in your quest to understand perl:
1) Read the fine manual
2) perldoc is your friend
3) perldoc perldoc will provide some useful information about perldoc
4) perldoc perl will give you a table of contents of what perldoc can
tell you.
5) when you post a message, include a snippet (10-20) lines of code
that demonstrates the problem you are having.
6) If you are asking something because you don't understand what you
read, make sure to state that, and be clear about what it is that you
are having problems with. Saying 'print "Hi\n";' doesn't work tells us
nothing. Doesn't work meaning: erased all files from your hard drive,
gave you a headache, caused your machine to present the 'blue screen of
death'....
7) Use the web. http://www.perl.com is your friend
The posters of this group are more than willing to help those who are
willing (and trying) to help themselves.
>
> Hauk Langlo
</$0.02>
HTH.
Cheers,
Dave
* stupid meaning: not-researched, not thought about, no evidence of any
research being done .... e.g. How do I print something to my screen?
would be an example of a 'stupid' question. A moments worth of
reading/research would have yielded you the answer.
--
Dave Barnett Software Support Engineer (281) 596-1434
No need to tell me the incredibly obvious, the merely obvious will do
nicely, thank you.
------------------------------
Date: Tue, 06 Oct 1998 09:28:09 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361A28F9.254293B2@us.ibm.com>
Hauk Langlo wrote:
>
> I'm sure there are a lot of people reluctant to post questions here
> afraid of having "RTFM" yelled in their face each time. I'm not an
> expert myselfe and I would really like to know if there are any
> discussion forums etc where it is actually legal to ask questions that
> might be of a basic nature to some. If you know about something like
> that, please let me know and me and probably a lot of other will go away
> and leave you guys alone.
Yes there is. It's called Deja News.
http://www.dejanews.com/home_ps.shtml
Every FAQ and question you can possibly imagine has probably already
been asked, and here's the archive for them. This is no substitute for
the FAQ or the docs, but it is a great resource to use before actually
posting to Usenet. Most times, you'll either find the answer directly,
or find a pointer to the location in the docs to look.
In the power search, enter comp.lang.perl.misc for a forum, and then
enter your search words at the top.
For instance, in the case of finding out how to randomize an array, try
the keywords "array randomize" (without the quotes).
While reading an actual post, look for the "view thread" button. This
will give a more Usenet-like view of the thread in question. It makes
it easier to follow the flow of the questions and answers.
There's actually quite a lot you can do with this search engine. Say
you're not sure if your question is really a perl question or not. You
can use a forum name like "comp.*". You'll likely get too many results,
but the key here is to look at the group names that come up. This will
give you an idea of where to actually ask your question. Now you can go
back and narrow down the forum field to the appropriate group.
Work with this search engine for a while, and it will definitely pay
off.
--
James Ludlow (ludlow@us.ibm.com)
Disclaimer: This isn't technical support, and all opinions are my own.
------------------------------
Date: Tue, 06 Oct 1998 11:11:44 -0400
From: John Porter <jdporter@min.net>
Subject: Re: CGI.pm objects
Message-Id: <361A3330.C56B298E@min.net>
madame philosophe wrote:
>
> If I've created an object in the main routine of a perlscript with say 5
> parameters from the form input (the $q object) and I pass $q to a subroutine
> like this:
>
> sub spawn {
>
> local($q) = shift;
Why local instead of my?
> $child = new CGI($q);
>
> In the new object $child I only want to use 3 of the five original params...
>
> QUESTION 1:
> How would I discard the 2 I don't want?
>
> I know there's CGI.pm's delete() method, but I can't tell if this deletes a
> param, the value of the param or both.
What difference does it make to you?
If it really does, then have a peek at the source of CGI.pm
> QUESTION 2:
> What is a quick stub for assigning a scalar to the value of a param?
>
> I know I can do:
>
> $scalar = $q->param('name');
So you know the answer already.
> but what if I have a long list of params?
>
> do I have to do something like this:
>
> $scalarA = $q->param('name1');
> $scalarB = $q->param('name2');
> $scalarC = $q->param('name3');
> $scalarD = $q->param('name4');
> $scalarE = $q->param('name5');
> $scalarF = $q->param('name6');
> ..etc.
If that's what you want to do, then you're doing the wrong thing.
What is it about calling $q->param that makes you want to
do it only once?
> I know you can retrieve names of the params like this:
>
> @names = $q->param();
>
> but how to assign to a hash rather than only this array for the
> set param keys?
Ever heard of map?
> I know there is this stub below too, but it's not secure:
>
> foreach $name (param()) {
> $value = param($name)
> }
What's not secure about:
my %hash;
for my $name ( $q->param ) {
$hash{$name} = $q->param( $name );
}
???
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: 6 Oct 1998 15:21:45 GMT
From: dbonner@cs.bu.edu
Subject: Chart 0.99 on CPAN
Message-Id: <6vdci9$bmj$1@news.neta.com>
I just uploaded Chart 0.99 to CPAN. This is a complete
rewrite of version 0.94, and will hopefully make new additions a
bit easier to do. I've added composite charts, and made the
charts a little prettier.
This is still a beta because I suspect there are a few
bugs left in it, and because I haven't had a chance to rewrite
the Pie and Pareto modules yet. So use it at your own risk. But
if you do, please email me with any bugs, problems, or suggestions
you might have.
--
david bonner
dbonner@cs.bu.edu
---------------------------------------------------------------------
"I dare do all that may become a man; Who dares do more is none."
------------------------------
Date: Tue, 06 Oct 1998 10:21:16 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Common prefix for an array of strings
Message-Id: <361A275C.85068937@min.net>
Paul Makepeace wrote:
>
> This hack seems to work. The logic of the problem allows you to chop back
> any element of the list until it fits with the any other one.
>
> $min = pop @strings;
> foreach (@strings) {
> until (/$min/) {
> $min = substr $min, 0, (length $min)-1;
> }
> }
That's neat.
Two suggestions:
1. quotemeta the string in the regex:
until ( /\Q$min\E/ ) {
just in case it contains any regex metacharacters.
2. Rather than just pop the last one, search the list for the
shortest one, and use that.
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Tue, 06 Oct 1998 15:21:12 GMT
From: thom_co@my-dejanews.com
Subject: comp.lang.perl.win32??
Message-Id: <6vdch8$qtc$1@nnrp1.dejanews.com>
Has there been any discussion of creating an additional newsgroup for
discusssion of win32 related perl issues?
There are several perl issues that would be of interest only to those doing
win32 perl programming and not to the rest of the perl community.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 6 Oct 1998 10:35:05 -0300
From: "Commitman" <commitman@digitalnet.com.br>
Subject: Compile
Message-Id: <6vd6dh$57b$1@srv4-poa.nutecnet.com.br>
How can I compile some perl program ??
Is it possible ?
------------------------------
Date: Tue, 6 Oct 1998 12:09:42 -0300
From: "Commitman" <commitman@digitalnet.com.br>
Subject: Re: Compile
Message-Id: <6vdbus$e8p$1@srv4-poa.nutecnet.com.br>
Ps: Linux compilator !
Commitman wrote in message <6vd6dh$57b$1@srv4-poa.nutecnet.com.br>...
>How can I compile some perl program ??
>
>Is it possible ?
>
>
------------------------------
Date: Tue, 6 Oct 1998 09:43:41 -0500
From: "Eric Froeming" <froeming@quikpage.com>
Subject: Compress::Zlib and zip files
Message-Id: <6vda7v$9i9$1@news3.mr.net>
I'm trying to use Compress::Zlib on Solaris 2.6 to inflate a zip
file created in Win95. Every time I try to read the stream
from the file, I get and inflate error Z_DATA_ERROR (-3).
What am I missing? Do I have to do some processing on
the file to get to the compressed stream, or could there be
a problem with trying to unzip a Win95 file?
thanks,
eric
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3901
**************************************