[9449] in Perl-Users-Digest
Perl-Users Digest, Issue: 3044 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 3 15:07:18 1998
Date: Fri, 3 Jul 98 12:02:36 -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 Fri, 3 Jul 1998 Volume: 8 Number: 3044
Today's topics:
$ENV{'HTTP_REFERER'} (Someone)
Re: $ENV{'HTTP_REFERER'} <none@spam.com>
Re: $ENV{'HTTP_REFERER'} (Josh Kortbein)
2-byte code match problem (Yun Giljung)
Re: 2-byte code match problem (Craig Berry)
Re: 2-byte code match problem (Ronald J Kimball)
[ANNC] Beta: SQL::Builder -- an OO SQL builder Perl mod <zenin@bawdycaste.org>
[Q] Database Confusion [re-sent plain/text] <ryan@steelplan.com.au>
Re: [Q] mod_perl <ryan@steelplan.com.au>
Re: [Q] mod_perl (brian d foy)
Re: [Q] mod_perl <sbekman@iil.intel.com>
Re: [Q] mod_perl (Tom Mornini)
[Q] Scope mangling <ramune@zarathustra.remove.this.spam.block.calstatela.edu>
Re: \d versus [0-9] howard@wdsec.com
Re: access time (Mark-Jason Dominus)
Re: adduser <engel@cbn.net.id>
Re: adduser (Brian v/d Westhuizen)
Re: An interesting observation (chip@pobox.com)
Re: An interesting observation (John Stanley)
Re: autovivification and tie questions (Alan Barclay)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 02 Jul 1998 08:52:11 GMT
From: someone@somewhere.com (Someone)
Subject: $ENV{'HTTP_REFERER'}
Message-Id: <359e4a26.3094955@news.isdn.net.il>
HI All,
I would like to read the HTTP_REFERER enviorment and to take only the
URL (www.something.com) and use it.
How can I do that?
Thanks.
------------------------------
Date: Thu, 2 Jul 1998 09:27:25 -1000
From: "Locke" <none@spam.com>
Subject: Re: $ENV{'HTTP_REFERER'}
Message-Id: <359bb592.0@news.hawaii.rr.com>
Didn't this come up a few days ago :)
Buy book like learning perl :)
Someone wrote in message <359e4a26.3094955@news.isdn.net.il>...
>HI All,
>
>I would like to read the HTTP_REFERER enviorment and to take only the
>URL (www.something.com) and use it.
>How can I do that?
>
>Thanks.
------------------------------
Date: 2 Jul 1998 20:56:58 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: $ENV{'HTTP_REFERER'}
Message-Id: <6ngs6q$q72$1@news.iastate.edu>
Someone (someone@somewhere.com) wrote:
: HI All,
: I would like to read the HTTP_REFERER enviorment and to take only the
: URL (www.something.com) and use it.
: How can I do that?
You can attempt to match the hostname (which is not the same as
the URL) yourself, which may break sometims, or you can visit CPAN
and find one of the many handy-dandy URL parsers.
man perlre form help matching it yourself.
www.perl.com/CPAN for CPAN
Josh
--
________________________________________________________________________
Interviewer: "So Frank, you have long hair. Does that make you a woman?"
Frank Zappa: "You have a wooden leg. Does that make you a table?"
------------------------------
Date: Fri, 03 Jul 1998 03:59:04 GMT
From: mingtian@hanmail.net (Yun Giljung)
Subject: 2-byte code match problem
Message-Id: <359d55f7.21181184@usenet.kornet21.net>
like Korean or Chinese, they are 2-byte code, so
it like
ACFE BCA4 A7BC A4D9 (4 characters in hexcode)
so if i try to s// or m// y// "BCA4" will match twice time
in above example, the first is correct but the second is not correct(
A7BC A4D9)
how can solve the problem with s//,m//,y//?
------------------------------
Date: 3 Jul 1998 05:52:39 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: 2-byte code match problem
Message-Id: <6nhrj7$ju8$3@marina.cinenet.net>
Yun Giljung (mingtian@hanmail.net) wrote:
: like Korean or Chinese, they are 2-byte code, so
: it like
:
: ACFE BCA4 A7BC A4D9 (4 characters in hexcode)
:
: so if i try to s// or m// y// "BCA4" will match twice time
: in above example, the first is correct but the second is not correct(
: A7BC A4D9)
:
: how can solve the problem with s//,m//,y//?
Here's a brute-force way to force even byte alignment:
s/^((?:..)*?)\xBC\xA4/$1\x01\x02/sg;
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Fri, 3 Jul 1998 10:54:11 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: 2-byte code match problem
Message-Id: <1dbl684.1qg4quxzg4k74N@bay1-332.quincy.ziplink.net>
Craig Berry <cberry@cinenet.net> wrote:
> Here's a brute-force way to force even byte alignment:
>
> s/^((?:..)*?)\xBC\xA4/$1\x01\x02/sg;
^^^
You could probably change that to \G to make it a little more efficient.
Mastering Regular Expressions has a solution which I think is similar,
but it doesn't seem to be referenced in the index.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 3 Jul 1998 12:45:25 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: [ANNC] Beta: SQL::Builder -- an OO SQL builder Perl module
Message-Id: <899470476.947640@thrush.omix.com>
[posted & mailed]
SQL::Builder is an OO SQL statement builder for Perl. I'd like any feed
back I can get as I'm not completely familiar with all the quirks SQL has.
I'm especially interested in comments about the interface.
The module is available from:
ftp://thrush.omix.com/pub/perl/modules/SQL-Builder-2.002.tar.gz
Attached is the perldoc. Thanks!
--
-Zenin
zenin@archive.rhps.org
NAME
SQL::Builder - OO interface for creating simple SQL statements
SYNOPSIS
use SQL::Builder;
my $statement = new SQL::Builder;
my $statement = new SQL::Builder (
Tables => 'table_name',
Columns => [ qw(foo bar this that test) ],
Values => [ 42, 'foobar' ],
BareValues => 'RowNum',
QuotedValues => [ 42, 35 ],
Where => 'foo = 10',
Where => 'that != NULL'
Where => 'or 1 = 2',
OrderBy => [ 'test', 'bar' ],
AddSomethingElse => 'extra_stuff', # user thingy (see EXTENSIONS)
);
## All data (columns, values, wheres, etc) guaranteed to be added
## in the order given, even when given in a hash style as above.
$statement->Tables ('mytable'); # FROM mytable
$statement->Tables ('foobar'); # FROM mytable, foobar
@tables = $statement->GetTables();
$statement->Columns ('FOO', 'BAR'); # SELECT FOO, BAR
@columns = $statement->GetColumns();
## Auto-detect value types. Strings get single quoted (and quote
## excaped), numbers are left bare, and undef values are considered
## SQL NULL
$statement->Values ("foo", '42', undef); # VALUES ('foo', 42, NULL)
## Values that should never be quoted. We do single quote escapes though
$statement->BareValues (
"foo'bar", 10, SysDate, "?", undef
);
## VALUES ('foo''bar', 10, SysDate, ?, NULL)
## Values that should always be quoted. Use of undef for NULL
## is not valid for this method and throws an exception.
$statement->QuotedValues (10, "foobar"); # ('10', 'foobar');
@values = $statement->GetValues();
## NOTE: This is a list of the values in modified form. Quotes have
## been excaped, strings quoted, etc.
## This needs some work, but for now this is what you get.
$statement->Where ("foo > 12");
$statement->Where ("bar != NULL"); ## Defaults to "and"
$statement->Where ("OR dog == 'cat'");
# WHERE
# foo > 12
# AND bar != NULL
# OR dog == 'cat'
## Note how it defaults to AND if no AND or OR is given
$statement->OrderBy ('FOO', 'BAR'); # ORDER BY FOO, BAR
$statement->Clear;
## Same as $statement = $statement->new(), but faster (maybe)
$statement->ClearTables;
$statement->ClearColumns;
$statement->ClearValues;
$statement->ClearWhere;
$statement->ClearOrderBy;
$statement->ClearSomethingElse; ## Clears user defined things
$insertQuery = $statement->insert();
$updateQuery = $statement->update();
$selectQuery = $statement->select();
$deleteQuery = $statement->delete();
DESCRIPTION
This is my attempt to create an clean, easy to read, object oriented way
to build SQL statements.
This module is designed to make dynamically constructing simple SQL
statements simple and much less error-prone. Common mundane tasks such
as to do an insert or update are reduced to calling the update() or
insert() method and letting SQL::Builder figure out how to do "set this
= 'that'" vs "(this) values ('that')", etc.
This is not meant as the end-all, be-all SQL builder of all time. It's
meant to make common jobs easy and hard jobs easier. Along those lines,
I'm very open to suggestions on how to improve/extend the interface for
more complex querys, but I'm very strongly set that the base interface
be as simple and efficient to use as posible.
METHODS
With the exceptions of the insert(), update(), select(), and delete()
all methods return the object they were called off of. This allows one
to string method calls together, even to the point of never actually
assigning the object to an identifier:
my $updateQuery = SQL::Builder->new()->Tables (
'tablename',
)->Columns (
'SOME', 'COLUMN_NAMES', 'foo', 'bar'
)->Values (
'some', 'values', 69, 42
)->Where (
'foo = 12'
)->update;
Although, since new() can now take a list of all this in a much cleaner
way, this type of usage is a bit outdated and would probably be much
better done as:
my $updateQuery = SQL::Builder->new (
Tables => 'tablename',
Columns => [qw( SOME COLUMN_NAMES foo bar )],
Values => [ 'some', 'values', 69, 42 ],
Where => 'foo = 12',
)->update;
Or, if you don't want to create a SQL string variable at all:
my $sth = $dbh->prepare (
SQL::Builder->new (
Tables => 'tablename',
Columns => [qw( SOME COLUMN_NAMES foo bar )],
Values => [ 'some', 'values', 69, 42 ],
Where => 'foo = 12',
)->update
) or die $dbh->errstr();
The real power though, comes in building the actual object first, and
deside later what (insert, update, delete, etc) you want to do with it:
my $query = SQL::Builder->new (
Tables => 'tablename',
Columns => [qw( SOME COLUMN_NAMES FOO BAR )],
Values => [ 'some', 'values', 69, 42 ],
Where => 'foo = 12',
);
shouldWeInsert() ## Some test to see if we have a record yet or not
? $sth = $dbh->prepare ( $query->insert ) or die $dbh->errstr
: $sth = $dbh->prepare ( $query->update ) or die $dbh->errstr;
$sth->execute()
or die $dbh->errstr;
The available methods are:
Tables (TABLE_NAMES)
Takes a list of table names which will be appended to any current
list. Use ClearTables() to reset the list. If you're going to use
aliases, put them into the string such as:
$statement->Tables ('f foo', 'b bar');
Columns (COLUMN_NAMES)
Takes a list of column names which will be appended to any current
list. Use ClearColumns() to reset the list.
Values (VALUES)
Takes a list of values which will be appended to any current list.
This method does a "best guess" method to decide if the value should
be quoted (such as a string) or not (such as a number). Passing
undef is changed to a SQL NULL. It can sometimes fail because the
value could actually be a special column name such as Oracle's
SysDate that can not be quoted, or you could be trying to insert a
numeric string into a non-numeric field and the database won't do
the conversion for you so it must be quoted. When in doubt, force
bare or quoted use by calling BareValues() and QuotedValues(), at
least for these special cases.
This method will also SQL escape your single quotes for you.
Note: Using Oracle this is a pretty safe method because it's much
smarter about "doing the right thing" even if it's not quoted
"correctly". Other systems like Informix will flip however, if you
mis-quote numeric values...
use ClearValues() to reset the values list.
BareValues (VALUES)
Takes a list of values which will be appended to any current list.
These values will never be quoted. Passing undef will be changed to
the string 'NULL'.
use ClearValues() to reset the values list.
QuotedValues (VALUES)
Takes a list of values which will be appended to any current list.
These values are always quoted. Passing undef will throw an
exception.
use ClearValues() to reset the values list.
Where (WHERE_CLAUSE)
Adds a where clause to the current stack of where clauses. If there
is no "and" or "or" at the beginning of the clause it will prepend
an "and" on for you (only on the 2nd and higher clauses of course).
Multilevel where clauses are not well supported, but you can use
them if you put it all into one string for Where(). Example:
$statement->Where("(this = 'that' AND foo = 'bar')");
$statement->Where("OR foo != NULL");
## Produces
#
# WHERE
# (this = 'that' AND foo = 'bar')
# OR foo != NULL
use ClearWhere() to reset the where clause stack.
OrderBy (COLUMN_NAMES)
Takes a list of column names which will be appended to any current
list.
use ClearOrderBy() to reset the order by list.
With all the different modifiers available (most of which I fully admit
to not even knowing exist), it would be difficult to handle them all.
So, we let you use them via an auto-loaded interface.
How this works. If you have a modifier "CONNECT BY", convert it first to
mixed case so it's "ConnectBy". Then, add the string "Add" to it, so we
have "AddConnectBy". Use this as a method name:
$statement->AddConnectBy ('SOME', 'COLUMNS', 'TO', 'USE');
Like most of the other methods, this appends these values to the
"CONNECT BY" list. Just replace the "Add" with "Clear" like this:
$statement->ClearConnectBy();
These extra modifiers are all added to the end of the rest of the query.
The values used are also not quoted, however they are divided with
commas and whitespace, such that this example will produce:
CONNECT BY
SOME,
COLUMNS,
TO,
USE
Suggestions on how to better this extension interface are welcome.
ERROR HANDLING
I throw confess() (die) exceptions if I'm unhappy, deal with it by
eval()ing me and checking for $@.
HISTORY
$Log: Builder.pm,v $
Revision 2.2 1998/07/03 12:41:38 byron
-Lots of clean up for general release
Revision 2.1 1998/05/28 12:35:28 byron
-Cleaned up the interface a bit (it's a new name, I can do that now :-)
-Added lots of docs
-Fixed my email address
Revision 2.0 1998/05/25 17:28:21 byron
-Moved name from SQL::Statement to SQL::Builder
Revision 1.18 1998/03/30 12:48:16 byron
-Cosmetic changes.
-Renamed module to SQL::Statement after learning that the DBI::*
space was reserved.
Revision 1.17 1998/02/02 22:14:23 byron
-Added "dynamic" support for misc SQL calls
Revision 1.16 1998/01/12 14:59:15 byron
-Added ORDER BY support to SELECT statements
Revision 1.15 1998/01/11 02:12:36 byron
-More null value fixes.
-Now uses the value NULL when passed a null string
Revision 1.14 1998/01/11 00:02:45 byron
-Handles undefined values more gracefully
Revision 1.13 1998/01/08 15:05:50 byron
-Added AddNumericValues() and AddStringValues() to allow for
explicit non-quoted and quoted values respectively.
Revision 1.12 1998/01/08 14:56:28 byron
-Removed numaric non-quoting code from methods and moved it into
AddValues. This will allow for new methods to be made such as
AddNumaricValues(), AddDateValues(), etc.
Revision 1.10 1998/01/07 14:31:17 byron
-Changed all data access methods to return the object they are called
from to allow method calls to be strung off each other.
Revision 1.9 1997/12/19 02:20:08 byron
-Some documentation additions
-Predeclared object fields so I don't have to keep testing them
to see if they are defined already.
-Made some exception messages cleaner
-Fixed many bugs
-Removed strict package requirement for embeded select statements so
we can be sub-classed easier. -But you didn't see this because it's
still buggy and undocumented, so don't use it!
Revision 1.8 1997/12/18 23:24:51 byron
-Fixed bug in Clear* methods
Revision 1.7 1997/12/18 23:07:42 byron
-Added perl 5.003 support
Revision 1.6 1997/12/08 06:48:00 byron
-Documentation changes
Revision 1.4 1997/12/08 06:45:55 byron
-Modified update() formating
Revision 1.3 1997/12/08 06:01:39 byron
-Documentation changes
Revision 1.2 1997/12/08 05:59:59 byron
-Moved each query type out of it's own package and back into the
main one.
-Moved where clause builder into it's own (internal) method.
TODO
Better support for where querys.
Some better method for embedding querys within querys.
AUTHOR
Zenin <zenin@archive.rhps.org>
aka Byron Brummer <byron@omix.com>
SEE ALSO
perl, DBI, SQL::Statement
------------------------------
Date: Thu, 2 Jul 1998 13:57:50 +0800
From: "Ryan Snowden" <ryan@steelplan.com.au>
Subject: [Q] Database Confusion [re-sent plain/text]
Message-Id: <6nf7lo$3vs$1@news.iinet.net.au>
This question may span beyond the scope of perl and into the realm of unix,
but since I'm familiar with using Perl and Perl can be used for database
work, I'd ask here.
What I want.
Intranet, run off an Apache Web Server, in which perl/CGI scripts exist and
handle all 'submit's and do all the dirty work. Everything that gets sent
out or received through this web system (which relies on sendmail basically)
has to be logged, and recalled for reports.
Getting Down To It.
I want to store a number of variables in a database. These range from 4
digit numbers, to entire messages (which may span many lines - like the body
of an email message).
Now, I can use %hash's to store this information, then dump it into a .db
file using dbopen & dbclose. How efficient is it to have a large message
body dumped into a .db file? This .db file will basically contain all email
messages sent, which will later be searched through, read and reports
generated from it.
I know under unix there is a package called PostGresSQL... It handles SQL
type queries. There are modules which perl can use to write to this SQL
server in order to store information (I understand - just looking at
www.perl.com). I can make this server available you see, and wonder if it's
more efficient/smarter/easier to use this, than using %hash's writing to DB
files.
A little confused on how to do this.
Ryan Snowden
------------------------------
Date: Thu, 2 Jul 1998 13:49:23 +0800
From: "Ryan Snowden" <ryan@steelplan.com.au>
Subject: Re: [Q] mod_perl
Message-Id: <6nf75s$2o0$1@news.iinet.net.au>
brian d foy wrote in message ...
|the script doesn't necessarily use the Apache::* stuff or the embedded
|interpreter. you can specify a section of the URL-space to be
|handled by mod_perl:
I don't fully understand what you mean by URL-space. From the examples
below I can deduce that you refer to the placement of the script according
to the 'submit' URL.
| #http://www.dead-horse.com/mod_perl/foo handled by mod_perl
| <Location /mod_perl>
| SetHandler perl-script
| PerlHandler Apache::Registry
| Options ExecCGI
| </Location>
So, in this case a CGI script is placed in a different directory and will be
handled by mod_perl, whereas the same script could be placed under a
directory in which the perl interpreter will run it. mm?
||while others can be handled via the traditional mechanism:
|
| #http://www.chat2.pl/cgi-bin/foo handled by external perl
| ScriptAlias /cgi-bin/ /web/cgi-bin/
|
...
|additionally, CGI.pm does some rudimentary checking to determine
|if mod_perl is handling the script, and sets certain variables
|if it is (although the same variables may be set if one isn't
|using mod_perl and particular operating systems). take a look
|at the CGI.pm code (perldoc -m CGI.pm) and search for $MOD_PERL.
|you might have to adjust the results for whatever your server
|puts in $ENV{'GATEWAY_INTERFACE'}.
I'll look into it. If it saves me some time and effort, it will be well
worth it.
|does that answer your question?
I'd say you've done a pretty good job, yeah. Next is for me to work out if
there is an Apache module which makes talking to an SQL server (postgreSQL)
easy and fast. CPAN has a lot of database modules on offer, but I don't
know which one is more widely used/is best to use in perl in order to talk
to an SQL server. If you can give me a head-start it would me much
appreciated.
Cheers
Ryan Snowden
------------------------------
Date: Thu, 02 Jul 1998 02:55:08 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: [Q] mod_perl
Message-Id: <comdog-ya02408000R0207980255080001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6nf75s$2o0$1@news.iinet.net.au>, "Ryan Snowden" <ryan@steelplan.com.au> posted:
>brian d foy wrote in message ...
>
>|the script doesn't necessarily use the Apache::* stuff or the embedded
>|interpreter. you can specify a section of the URL-space to be
>|handled by mod_perl:
>I don't fully understand what you mean by URL-space. From the examples
>below I can deduce that you refer to the placement of the script according
>to the 'submit' URL.
>| #http://www.dead-horse.com/mod_perl/foo handled by mod_perl
>| <Location /mod_perl>
URL-space means the possible URLs.
when the server looks at the request URI, it decides if it needs
to do various things. in this case, if the URI's path component
starts with /mod_perl, the server hands off the task to the embedded
perl interpreter,
>||while others can be handled via the traditional mechanism:
>|
>| #http://www.chat2.pl/cgi-bin/foo handled by external perl
>| ScriptAlias /cgi-bin/ /web/cgi-bin/
>|
while in this case, the server hands off the request to the
conventional CGI handler.
other such things may happen with Rewrite and other goodies
that i haven't mentioned. the point is that the server decides
what to do based on what it sees in the requested path and what
it has been configured to do if it sees something special in
that path.
i guess this is to the point that you'd have to continue the
discussion in a unix server newsgroup.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: Fri, 03 Jul 1998 09:25:40 +0300
From: Bekman Stanislav <sbekman@iil.intel.com>
To: Ryan Snowden <ryan@steelplan.com.au>
Subject: Re: [Q] mod_perl
Message-Id: <359C7964.4287@iil.intel.com>
Ryan Snowden wrote:
>
> My understanding of mod_perl is to be the (G)ateway in CGI.
Ryan,
You are envited to visit http://perl.apache.org to learn more about
mod_perl . You have FAQs and complete modules documentation at this URL.
Most of your answers are covered in the FAQs, the rest can be asked at
the mod_perl mailing list available from the same place or by browsing
its archives.
Hope this helps!
______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com http://www.eprotect.com/stas
Visit: http://www.eprotect.com/stas/TULARC (Perl,CGI,Linux,Web,Java,PC)
Linux receives a 'Product of the Year Award' for Best Technical Support
http://www.infoworld.com/cgi-bin/displayTC.pl?97poy.supp.htm
------------------------------
Date: Fri, 3 Jul 1998 16:18:05 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: [Q] mod_perl
Message-Id: <tmorniniEvJ1A5.9xu@netcom.com>
Ryan Snowden (ryan@steelplan.com.au) wrote:
: Next is for me to work out if
: there is an Apache module which makes talking to an SQL server (postgreSQL)
: easy and fast. CPAN has a lot of database modules on offer, but I don't
: know which one is more widely used/is best to use in perl in order to talk
: to an SQL server. If you can give me a head-start it would me much
: appreciated.
Use DBI/DBD. DBI is the general database interface, and the DBD is specifially
for the database that you've chosen. DBI/DBD is the fastest, best supported,
and most recent method of accessing databases through Perl.
-- Tom Mornini
-- InfoMania
------------------------------
Date: 2 Jul 1998 12:24:10 -0700
From: Graffiti <ramune@zarathustra.remove.this.spam.block.calstatela.edu>
Subject: [Q] Scope mangling
Message-Id: <6ngmor$2uq$1@zarathustra.calstatela.edu>
Hi all,
Is it possible to change the scope of a variable in a
manner such as this?
sub a {
my($foo);
do_stuff;
&b();
change_my_to_local($foo);
&c();
change_local_to_my($foo);
}
Is there any ways I can make the scope change like that?
A while ago, I was looking at code that I could have made
smaller, faster, and cleaner if I could use that without re-writing
much. In the end, I couldn't figure it out, so I re-wrote most of
the functions. (This counts as laziness, right? :^)
-- DN
------------------------------
Date: Thu, 02 Jul 98 12:06:48
From: howard@wdsec.com
Subject: Re: \d versus [0-9]
Message-Id: <NEWTNews.899395615.16201.howard@howardnt2>
Thanks everyone for the help
------------------------------
Date: 2 Jul 1998 20:43:32 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: access time
Message-Id: <6nh9fk$cqu$1@monet.op.net>
Keywords: blurb detonable insurance sneak
In article <6ndnlg$qo9@netaxs.com>, Joel Coltoff <joel@wmi0.wmi.com> wrote:
>Yes you can. Modify the inode. This only requires access to the directory
>and not the file.
My man page here says that write access on the file is required. What
does yours say?
------------------------------
Date: Thu, 02 Jul 1998 18:41:15 +0700
From: Engelhard <engel@cbn.net.id>
Subject: Re: adduser
Message-Id: <359B71DB.72663D33@cbn.net.id>
Thomas Frederick O'Connell wrote:
...
> i have seen so many mailing-list and/or newsgroup entries saying "where
> can i find a [better] version of adduser, preferably in perl?" and "if you
> find one, let me know because i am about to write my own". well, i fall
> into both categories and was wondering if there is
>
> 1) an authoritative source for the linux adduser script
>
> 2) a supported perl version
>
> i figured this would be something that was slightly easier to track down.
> maybe i'm just not looking in the right places. if anyone knows the right
> places, please let me know.
>
How about modify adduser perl script which is in the standard
distribution on FreeBSD OS ?
I can send you the freebsd's adduser if you can not find it.
> thanks.
> -freddie
engel.
------------------------------
Date: Thu, 02 Jul 1998 13:20:50 GMT
From: bvdwest@price-forbes.co.za (Brian v/d Westhuizen)
Subject: Re: adduser
Message-Id: <359b88db.10226242@196.4.160.8>
On Wed, 01 Jul 1998 10:23:23 -0500, tfo@telalink.net (Thomas Frederick
O'Connell) wrote:
>i have been searching around for a semi-authoritative version of adduser.
>there does not seem to be anything similar in the standard perl
>distribution or on CPAN, and no linux vendors seem to point to a non-perl
>standard.
>
>i have seen so many mailing-list and/or newsgroup entries saying "where
>can i find a [better] version of adduser, preferably in perl?" and "if you
>find one, let me know because i am about to write my own". well, i fall
>into both categories and was wondering if there is
>
>1) an authoritative source for the linux adduser script
>
>2) a supported perl version
>
>i figured this would be something that was slightly easier to track down.
>maybe i'm just not looking in the right places. if anyone knows the right
>places, please let me know.
>
>thanks.
>-freddie
i'm also in the process of writing one. Very new to perl, but ok in
shell scripts. Got one that works well in ksh. Adds users to multiple
machines in one go.
------------------------------
Date: Wed, 01 Jul 1998 21:52:07 GMT
From: Chip Salzenberg (chip@pobox.com)
Subject: Re: An interesting observation
Message-Id: <6neb50$u7r$1@cyprus.atlantic.net>
According to stanley@skyking.OCE.ORST.EDU (John Stanley):
>Chip Salzenberg <chip@mail.atlantic.net> wrote:
>>Well, you _do_ have to consider the source.
>
>Yes, someone who was trying to write something to benefit the community.
As you'd be the first to point out WRT Tom C., a person's being
willing to give to the community does not imply anything else about
that person, either good or bad.
>>While clpm is generous, it does have a memory.
>
>And holds grudges against people who hold opinions that are not popular.
>Yes, I know.
You're mistaken if you think that holding an opinion is enough to create
a collective grudge against one. You're disingenuous if you created this
straw-man argument with full understanding. Either way: "Uh uh."
(Hint: Being obnoxious creates grudges, no matter one's opinions.)
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"I brought the atom bomb. I think it's a good time to use it." //MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 2 Jul 1998 20:38:22 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: An interesting observation
Message-Id: <6ngr3u$fun$1@news.NERO.NET>
In article <6neb50$u7r$1@cyprus.atlantic.net>,
chip@pobox.com <Chip Salzenberg> wrote:
>As you'd be the first to point out WRT Tom C., a person's being
>willing to give to the community does not imply anything else about
>that person, either good or bad.
You are very willing to put words in other people's mouths.
>(Hint: Being obnoxious creates grudges, no matter one's opinions.)
Well, that's the difference between us, Chip. If you asked for
help with something that someone else hadn't already answered, and I
felt I could provide an answer, I would do so, even though you are
obnoxious. I'd do the same for Chris and Tom.
But your statement is simply wrong. Being obnoxious about popular
opinions causes no grudges to appear.
If it makes you feel good to hold a grudge, please do so. You may waste
all the time you like feeding it and petting it and putting bows and
ribbons on it. Just don't forget that you have it, and that you let it
control how you act.
------------------------------
Date: 2 Jul 1998 17:21:55 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: autovivification and tie questions
Message-Id: <899400111.145569@elaine.drink.com>
In article <Pine.GSO.3.96.980628211627.21917D-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Mon, 29 Jun 1998, Todd Lehman wrote:
>
>> Good guess -- I was using 5.004_02. Am downloading 5.004_68 now.
>
>Now, you know that _68 is an experimental version, known to have bugs,
>right? If you're looking to replace 5.004_02, I recommend 5.004_04 or the
>soon-to-be-released 5.004_05. Hope this helps!
>
Is this a typo, or will there be a 5.004_05 before 5.005?
------------------------------
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 3044
**************************************