[12537] in Perl-Users-Digest
Perl-Users Digest, Issue: 6137 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 26 16:07:14 1999
Date: Sat, 26 Jun 99 13:00:18 -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 Sat, 26 Jun 1999 Volume: 8 Number: 6137
Today's topics:
Re: A buggy intersection-method (Kai Henningsen)
Re: Having an external script modify %ENV? (Kai Henningsen)
How do I access MS Access and/or Lotus Approach Databas <root@tones.charm.net>
Re: Index of an array-item <tchrist@mox.perl.com>
Need help with numbers and zeros <oliver@admiralq.free-online.net>
Re: Need help with numbers and zeros <rick.delaney@home.com>
Re: Need help with numbers and zeros <rootbeer@redcat.com>
Re: Needle in a hash/list... <gellyfish@gellyfish.com>
Perl without Web-Server <andre.pletschette@ltam.lu>
Right justify text (Stanley Horwitz)
Re: Right justify text <tchrist@mox.perl.com>
Re: should be how to remove ^M from middle of variable? <kazuma@my-deja.com>
spawning on the left side of the assignment, or somethi <shaw@active.ch>
Re: spawning on the left side of the assignment, or som <rick.delaney@home.com>
Re: spawning on the left side of the assignment, or som <tchrist@mox.perl.com>
Re: Summing an array (Kai Henningsen)
test (please don't read) <scientia@XXXtechnologist.com>
Third level domains: how can I create them? <scientia@XXXtechnologist.com>
Re: Third level domains: how can I create them? (Bill Unruh)
Re: UNIX: ~name won't work on system() as expected (Kai Henningsen)
Unlink == delete files? Why (on earth) is it called unl <mats.pettersson@falukuriren.se>
Re: Very easy integer question <gellyfish@gellyfish.com>
Re: wwwboard on webjump.com <rootbeer@redcat.com>
Re: wwwboard on webjump.com <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Jun 1999 17:14:00 +0200
From: kaih=7Jbfofn1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: A buggy intersection-method
Message-Id: <7Jbfofn1w-B@khms.westfalen.de>
u970130@studbo.hit.no (Thomas Weholt) wrote on 17.06.99 in <37684848.4807699@news1.c2i.net>:
> the result is a listing of hits containing perl, some other lines, but
> not lines containing tar, like
> /somedir/perl/perl.txt
> /somedir/perl/readme
Then I guess your @array1 etc. are already not what you think they are.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 26 Jun 1999 16:59:00 +0200
From: kaih=7JbfoKKHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Having an external script modify %ENV?
Message-Id: <7JbfoKKHw-B@khms.westfalen.de>
akhazano@oacis.com (Andrew Khazanov) wrote on 23.06.99 in <37743986.69506154@news.isp.net>:
> On 22 Jun 1999 20:09:11 -0700, in comp.lang.perl.misc you wrote:
>
> >Andrew Khazanov <akhazano@oacis.com> writes:
> >
> >> Exactly. I want a _shell_ script called by Perl to modify _Perl's_
> >> environment.
> >
> >Another approach is to modify the shell script to, rather than setting the
> >variables, print out the variable settings
>
> I didn't want to do that because these scripts will still be used by
> hand, and there are quite a few of them. What I think I'll end up
> doing is a bit different -- I'll just create a ksh process that I'll
> be able to interact with (using IPC::Open2), and feed it commands.
There is yet another way.
You can make a wrapper shell script that, after running those other
scripts, lists the current state of its environment. Then you can take
that information from perl and use it to feed the next invocation. Or
maybe you just redirect it to a file and make the wrapper script execute
that file at the start.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 26 Jun 1999 15:19:26 -0400
From: root <root@tones.charm.net>
Subject: How do I access MS Access and/or Lotus Approach Databases?
Message-Id: <n1xm6a81.fsf@tones.charm.net>
Hi All,
I work in a company that is pathologically attached to ancient technology.
Unfortunately for me, that means I have to do things like write scripts to
interface with Win3.1 and the like. My newest task is to write scripts that
will make data in MS Access and Lotus Approach DBs available over our
intranet Web site. Now, I can do this with a Standard SQL DB like MySQL
or even Oracle with the DBI:: modules. Is there any equivalent way(s)
of getting to MS Access or Lotus Approach. It would be a whole lot easier
than the alternative, which involves having them export the data in CSV
or something like that an setting that up as a rudimentry DB?
Any suggestions? I'd be much obliged if I could keep from having
to do spend a month writing translation scripts. Peace,
James
------------------------------
Date: 26 Jun 1999 13:01:20 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Index of an array-item
Message-Id: <37752380@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:Cursed to torture myself and others with MicroPlanet Gravity v2.11
For the record, is MicroPlanet Gravity v2.11 non-torturous? You don't
see to post mutiliated messages the way webbrowsers being abused as
newsreader do. I'm slightly surprised. Or are you going out of your
way not to post severely mangled material?
:I wonder why you think that this FAQ is responsive to the particular
:question. Where in the array is not the same as whether in the array.
It does not seem all that different to me.
Here's the issue: as soon as you say the word "search" in conjunction
with either "list" or "array", you're setting yourself up for trouble.
Arrays are for ordering. Hashes are for searching. Going the other
way is possible, but suboptimal.
:I don't know how to do this besides using a dumb for-loop linear search
:with breakout on match, do you?
Yes: by having established ab initio a completely different sort of data
structure, one designed for look-ups. We call this a "hash".
Just because f(i) produces x doesn't imply that there must exist some
g(x) that will produce i, because you don't know that f(j) does not also
produce x. The easiest way to do this is probably to create two different
structures while processing your data.
If you were just doing this:
while (<>) {
chomp($line[$.] = $_);
}
or this:
chomp(@line = <>);
it's certainly easy enough to ask for the i'th line. But when you want
to know what value of i has "fred" stored at it, you're in big trouble.
So you get stuck using a linear (cf line, linear) search algorithm rather
than one of constant order.
The obvious thing to do is of course:
while (<>) {
chomp;
$line[$.] = $_;
$data{$_} = $.;
}
But that may not produce desireable results on data that contains
duplicates. So you'd likely do something more like this instead:
while (<>) {
chomp;
$line[$.] = $_;
push @{ $data{$_} }, $.;
}
So now, given datum X, you can find its indices using @{$data{X}}, and
given index I, you can find its datum with $line[I]. If you only
want one of the indices for a given datum, then either use $data{X}[0]
or else use overwriting in lieu of pushing.
But I'm sure you knew all this, Larry.
--tom
--
"A ship then new they built for him/of mithril and of elven glass"
--Larry Wall in perl.c from the v5.0 perl distribution,
citing Bilbo from Tolkien's LOTR
------------------------------
Date: Sat, 26 Jun 1999 19:25:22 +0100
From: "Oliver Brown" <oliver@admiralq.free-online.net>
Subject: Need help with numbers and zeros
Message-Id: <mY8d3.3485$BS6.2867@wards>
I need a random number from 1 to 120. But I need to add zeros to it to make
it a three digit number
e.g. 27 = 027 and 4 = 004
Any ideas.
Thanks!
------------------------------
Date: Sat, 26 Jun 1999 19:00:44 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Need help with numbers and zeros
Message-Id: <37752322.606ABA28@home.com>
[posted & mailed]
Oliver Brown wrote:
>
> I need a random number from 1 to 120. But I need to add zeros to it to make
> it a three digit number
>
> e.g. 27 = 027 and 4 = 004
perldoc -f rand
perldoc -q zero
If you can't get perldoc working for you (-q is 5.005, -f is 5.004) or
you just plain don't like it then consult perlfunc and perlfaq4 using
whatever file browsing method you prefer.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sat, 26 Jun 1999 12:02:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Need help with numbers and zeros
Message-Id: <Pine.GSO.4.02A.9906261201370.26514-100000@user2.teleport.com>
On Sat, 26 Jun 1999, Oliver Brown wrote:
> I need a random number from 1 to 120. But I need to add zeros to it to
> make it a three digit number
You could use rand and sprintf from the perlfunc manpage. Is that what you
needed to know? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Jun 1999 18:51:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Needle in a hash/list...
Message-Id: <7l37fo$4kh$1@gellyfish.btinternet.com>
On Wed, 23 Jun 1999 16:52:09 GMT Mitch wrote:
> How can I find a value in a hash/list. So, if my hash/list is
>
> coke sucks:major bites:forever rules:dominates # the :'s are part of
> each element. So $hash{coke}[0] -> sucks:major
>
Mitch, Mitch, Mitch ...
These postings of yours on basically the same question seem to go on and
on and on and on - as a systems analyst I would always advocate splitting
your problem up into the smallest parts that you can - this part is of course
called analysis : but this should be followed by *synthesis* - putting those
constituent parts back together again , finding the commonality between
these parts. The way that you are going about this (ahem *trivial*)
problem is by nibbling away at it solving each new problem as it arises -
whereas the way that you should have started out is by deciding how
your data would best be expressed - I guess that you must have at least
a passing acquaintance with the perldsc manpage as your use of a hash of
lists would suggest, however if you havent read it I think you really
should now before you go any further. You need to look at the way that
the multilevel data in that document is layed out and attempt to do
so for the data that you expect - ie your example above would become:
%hash = (
coke => [ 'sucks:major',
'bites:forever',
'rules:dominates'
]
);
Writing it out like that (yes writing - whoever said you needed a computer
to do useful computer programming tasks ) - might indicate to you where
you might need to expand your data structure: straight away I can see
how you might want to expand this to at least :
%hash = (
coke => {
sucks => {
major => 0
},
bites => {
forever => 0
}
rules => {
dominates => 0
}
}
);
This way you can accomodate not only a variable number of products but
a similarly variable number of adjectives that might apply to each and
equally of modifiers to those adjectives - of course it becomes
increasingly more difficult to decompose this data structure in order to
print it out but you have read perldsc havent you ...
The moral of all this is to sit down with a pen and paper and work out
what your data is going to look like, whereas what you are actually
doing is breaking it down it down into a number of little language
problems which people are giving you the answers to, thus entrenching
yourself in some further problem ... and so and so forth.
I hate to say this but believe me I've been doing this stuff for quite a
while now...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 21:21:50 +0200
From: "Pletschette Andri" <andre.pletschette@ltam.lu>
Subject: Perl without Web-Server
Message-Id: <7l393s$j43$1@calais.pt.lu>
I just want to know if it's possible to run (test) Perl CGI-Programs without
a Web-Server.
the page and the CGI Program are in /home/cgi-test/
and Perl is under /usr/bin/perl
Thank's for any help.
______________________
Pletschette Andri
http://www.grosbous.lu
------------------------------
Date: 26 Jun 1999 18:01:54 GMT
From: stan@tempest.temple.edu (Stanley Horwitz)
Subject: Right justify text
Message-Id: <7l34ii$3hr$1@cronkite.ocis.temple.edu>
I apologize if this is a FAQ. I am using Perl to process some email
messages and my program is working pretty nicely, but I would like
to output the body of the message (which is just a string called
$msg so that the text is justified with the message length being
no more than 80 characters. I have been reading up on how to use
Perl formats, but the book I have is very unclear about how to do
what I want. If anyone has any ideas on how I can print a particular
string of arbitrary length in a justified format, please let me
know.
Thanks
------------------------------
Date: 26 Jun 1999 13:08:40 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Right justify text
Message-Id: <37752538@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
stan@tempest.temple.edu (Stanley Horwitz) writes:
@data = <<EOF =~ /\S.*\S/g;
I apologize if this is a FAQ. I am using Perl to process some email
messages and my program is working pretty nicely, but I would like
to output the body of the message (which is just a string called
$msg so that the text is justified with the message length being
no more than 80 characters. I have been reading up on how to use
Perl formats, but the book I have is very unclear about how to do
what I want. If anyone has any ideas on how I can print a particular
string of arbitrary length in a justified format, please let me
know.
EOF
for $line (@data) {
printf "%76s\n", $line; # or 80
}
I apologize if this is a FAQ. I am using Perl to process some email
messages and my program is working pretty nicely, but I would like
to output the body of the message (which is just a string called
so that the text is justified with the message length being
no more than 80 characters. I have been reading up on how to use
Perl formats, but the book I have is very unclear about how to do
what I want. If anyone has any ideas on how I can print a particular
string of arbitrary length in a justified format, please let me
know.
Yes, it's a FAQ. Your apology will be accepted once you've read it.
--tom
--
Blood and flood are not like food,
Nor is mould like should and would.
------------------------------
Date: Sat, 26 Jun 1999 18:02:43 GMT
From: Kazuma <kazuma@my-deja.com>
Subject: Re: should be how to remove ^M from middle of variable?
Message-Id: <7l34jv$4gd$1@nnrp1.deja.com>
> You *do* know about the ? flag, don't you? (As in \r?\n)
Yes I know, but I answered without thinking about it.
Sorry and thanks...
Kazuma
--
Cos'e' il genio: fantasia, intuizione,
colpo d'occhio e velocita' d'esecuzione...
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 26 Jun 1999 20:00:58 +0200
From: Shaw Kaake <shaw@active.ch>
Subject: spawning on the left side of the assignment, or something like that....
Message-Id: <3775155A.C952C002@active.ch>
Hello,
I am new to perl. My task is as follows, I have a database with
currently 25 language translations of my product catalog text matched
with variable names in comma delimited format. (varName,Country,Text)
The idea is to create HTML templates and substitute the variable names
in the HTML with the text from the database, and write finished, static
HTML files to specific directories.
Here is a snip of what is working to dissect the database, but
inelegant, bear with the style:
$datafile="r:/internet/data/testdata.csv";
(open(DataFileHandle, $datafile));
@MainData=<DataFileHandle>;
close (DataFileHandle);
$length=@MainData;
$counter=0;
while ($counter <= $length) {
$stringData=@MainData[$counter];
($name, $country, $text) = split(/,/,$stringData,3);
#the following code to be optimized, scrutinized
if ($country) {
if ($country eq "austria") {
push(@austria,$name,$text);
%austria=@austria;
}
if ($country eq "baltic") {
push(@baltic,$name,$text);
%baltic=@baltic;
}
if ($country eq "benelux") {
push(@benelux,$name,$text);
%benelux=@benelux;
}
# and I have to repeat each of the countries to
# fill the variables for the next step in the program
# .........until
$counter++;
}
Is there a way to create, on the fly, the variables for the @ARRAY's and
%HASHes by concatenating the variable names with a value foreached from
the list? I would like to compact the code down and offer the
flexibility to add new countries. Something like the following
nonworking example, replaceing the above line ten, and assuming a
prescanned @countrylist:
foreach $countrymember (@countrylist)
if ($country eq $countrymember) {
push(@.$countrymember,$name,$text);
%.$countrymember=@.$countrymember;
}
Using the concatenation operator . to bind the symbol for hashes and
arrays. But left side operations seem never to work the way I'd expect.
Lisp language let me use the following if I remember correctly for left
of the assignment operator expressions:
(read(eval(strcat "@" countryname))) = whatever
What is the elegant perl solution? Thanks for your time.
Shaw Kaake
------------------------------
Date: Sat, 26 Jun 1999 19:35:01 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: spawning on the left side of the assignment, or something like that....
Message-Id: <37752B2B.9BDF9EEF@home.com>
[posted & mailed]
Shaw Kaake wrote:
>
> Is there a way to create, on the fly, the variables for the @ARRAY's and
> %HASHes by concatenating the variable names with a value foreached from
> the list?
Yes, it's called symbolic references, but don't use those. Use a data
structure like a hash of arrays, as documented in perldsc. You should
also check out perlref, since all complex data structures in Perl are
implemented by storing references.
Example:
%struct = (
Austria => [],
Baltic => [],
Benelux => [],
);
#...
push @{ $struct{$country} }, $name, $text;
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 26 Jun 1999 13:45:34 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: spawning on the left side of the assignment, or something like that....
Message-Id: <37752dde@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Shaw Kaake <shaw@active.ch> writes:
:I am new to perl. My task is as follows, I have a database with
:currently 25 language translations of my product catalog text matched
:with variable names in comma delimited format. (varName,Country,Text)
That's not comma-delimited. It's parenthesis-delimited.
It's comma-separated.
:Is there a way to create, on the fly, the variables for the @ARRAY's and
:%HASHes by concatenating the variable names with a value foreached from
:the list? I would like to compact the code down and offer the
:flexibility to add new countries.
[verba deleta]
:What is the elegant perl solution? Thanks for your time.
Here's a FAQ:
How can I use a variable as a variable name?
Beginners often think they want to have a variable contain the
name of a variable.
$fred = 23;
$varname = "fred";
++$$varname; # $fred now 24
This works *sometimes*, but it is a very bad idea for two
reasons.
The first reason is that they *only work on global variables*.
That means above that if $fred is a lexical variable created
with my(), that the code won't work at all: you'll accidentally
access the global and skip right over the private lexical
altogether. Global variables are bad because they can easily
collide accidentally and in general make for non-scalable and
confusing code.
Symbolic references are forbidden under the `use strict' pragma.
They are not true references and consequently are not reference
counted or garbage collected.
The other reason why using a variable to hold the name of
another variable a bad idea is that the question often stems
from a lack of understanding of Perl data structures,
particularly hashes. By using symbolic references, you are just
using the package's symbol-table hash (like `%main::') instead
of a user-defined hash. The solution is to use your own hash or
a real reference instead.
$fred = 23;
$varname = "fred";
$USER_VARS{$varname}++; # not $$varname++
There we're using the %USER_VARS hash instead of symbolic
references. Sometimes this comes up in reading strings from the
user with variable references and wanting to expand them to the
values of your perl program's variables. This is also a bad idea
because it conflates the program-addressable namespace and the
user-addressable one. Instead of reading a string and expanding
it to the actual contents of your program's own variables:
$str = 'this has a $fred and $barney in it';
$str =~ s/(\$\w+)/$1/eeg; # need double eval
Instead, it would be better to keep a hash around like
%USER_VARS and have variable references actually refer to
entries in that hash:
$str =~ s/\$(\w+)/$USER_VARS{$1}/g; # no /e here at all
That's faster, cleaner, and safer than the previous approach. Of
course, you don't need to use a dollar sign. You could use your
own scheme to make it less confusing, like bracketed percent
symbols, etc.
$str = 'this has a %fred% and %barney% in it';
$str =~ s/%(\w+)%/$USER_VARS{$1}/g; # no /e here at all
Another reason that folks sometimes think they want a variable
to contain the name of a variable is because they don't know how
to build proper data structures using hashes. For example, let's
say they wanted two hashes in their program: %fred and %barney,
and to use another scalar variable to refer to those by name.
$name = "fred";
$$name{WIFE} = "wilma"; # set %fred
$name = "barney";
$$name{WIFE} = "betty"; # set %barney
This is still a symbolic reference, and is still saddled with
the problems enumerated above. It would be far better to write:
$folks{"fred"}{WIFE} = "wilma";
$folks{"barney"}{WIFE} = "betty";
And just use a multilevel hash to start with.
The only times that you absolutely *must* use symbolic
references are when you really must refer to the symbol table.
This may be because it's something that can't take a real
reference to, such as a format name. Doing so may also be
important for method calls, since these always go through the
symbol table for resolution.
In those cases, you would turn off `strict 'refs'' temporarily
so you can play around with the symbol table. For example:
@colors = qw(red blue green yellow orange purple violet);
for my $name (@colors) {
no strict 'refs'; # renege for the block
*$name = sub { "<FONT COLOR='$name'>@_</FONT>" };
}
All those functions (red(), blue(), green(), etc.) appear to be
separate, but the real code in the closure actually was compiled
only once.
So, sometimes you might want to use symbolic references to
directly manipulate the symbol table. This doesn't matter for
formats, handles, and subroutines, because they are always
global -- you can't use my() on them. But for scalars, arrays,
and hashes -- and usually for subroutines -- you probably want
to use hard references only.
Essentially, you have to build yourself a proper data structure
centered on a hash.
--tom
--
MS-DOS is CP/M on steroids, bigger bulkier and not much better.
------------------------------
Date: 26 Jun 1999 17:21:00 +0200
From: kaih=7JbfolfHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Summing an array
Message-Id: <7JbfolfHw-B@khms.westfalen.de>
rra@stanford.edu (Russ Allbery) wrote on 22.06.99 in <ylbte7h600.fsf@windlord.stanford.edu>:
> You could do something similar with an array; the most trivial
> implementation would be to store a full sum with each element. Of course,
> if you need sums from the beginning of the list to an arbitrary element
> with O(1) retrieval, you end up with O(n) insertion times.
You generalize too much.
For simply summing all of an array, keep a sum field in the array. Single
element change/add/remove operations that took O(1) before will still take
O(1), and so will summing. If you had multiple element manipulation ops,
those might take an O(n) hit.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Sat, 26 Jun 1999 20:03:32 -0700
From: Scientia <scientia@XXXtechnologist.com>
Subject: test (please don't read)
Message-Id: <37759484.6E47@XXXtechnologist.com>
test (please don't read)
------------------------------
Date: Sat, 26 Jun 1999 20:07:04 -0700
From: Scientia <scientia@XXXtechnologist.com>
Subject: Third level domains: how can I create them?
Message-Id: <37759558.22C0@XXXtechnologist.com>
Third level domains: how can I create them?
(If there are more suitable newsgroups for this message, please
let me know).
Hello.
I have 3 domains on a virtual servers (I mean second-level domains),
and I would like to create many third level domains.
Let's imagine that one domain of mine is called example.com .
How can I create domains like newdomain.example.com ?
My provider allowed me to create as many domains I want,
but they did not give me technical explanations:
they simply told me that I have to go inside their control panel
(a kind of wizard software) and I can create domains from there.
The technical staff of my provider is always busy (so they say)
and they do not tell me more than this.
I do not even know the os running on my server (probably Linux,
or maybe Unix because in my perl CGIs I have to enclose an initial
command that is tipycal of Unix).
Actually I tried to create a couple of third level
domains such as newname.example.com :
the control panel told me that they were created correctly
and also a DNS reference were created.
But after two days they are not seen by my browser yet!
Is there a "propagation" effect even on third level domains ?!
Or is there something wrong and I'll never see my new domains?
Further on, I know that some companies, such as hypermart.net
or homepage.com , create IMMEDIATELY third level domains
such as yourname.hypermart.net
(they make this for commercial purpose
because they add their ad banners to your new domain).
So, how can they do this?
Probably they have a dedicated server that allows them to create
immediately such domains.
I am considering to get a small dedicated server to do that
(I need a lot of third level domains) but I would like to know
how it is technically possible to make what hypermart.net does!
Maybe I can make it even on my present server, if my provider
allows me to modify some special system files:
which ones? I need some help to understand this.
I can make simple Perl programs and someone told me that it is
possible to create third level domains with simple Perl scripts!
Someone else told me that a "4xx error code" must be corrected
so that the visitor is redirected within a new directory,
and that allows "newname.example.com" to work...
But I don't understand very much.
Thanks to everybody will help me.
Diego
scientia@technologist.com
------------------------------
Date: 26 Jun 1999 19:47:48 GMT
From: unruh@physics.ubc.ca (Bill Unruh)
Subject: Re: Third level domains: how can I create them?
Message-Id: <7l3ap4$fpq$1@nntp.ucs.ubc.ca>
In <37759558.22C0@XXXtechnologist.com> Scientia <scientia@XXXtechnologist.com> writes:
>Let's imagine that one domain of mine is called example.com .
>How can I create domains like newdomain.example.com ?
You need to run a DNS a domain name server, so that when something on
the net looks for newdomain.example.com, that query will come to your
ISPs DNS (for example.com) who will pass it on to your DNS. That is what
the named daemon does-- answers name queries. Your ISP also has to pass
on requests to you when they come in to their machine.
------------------------------
Date: 26 Jun 1999 16:04:00 +0200
From: kaih=7JbfnmKmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: UNIX: ~name won't work on system() as expected
Message-Id: <7JbfnmKmw-B@khms.westfalen.de>
rick.delaney@home.com (Rick Delaney) wrote on 20.06.99 in <376C4B39.FC22CECF@home.com>:
> [posted & mailed]
>
> Russ Allbery wrote:
> >
> > Tom Christiansen <tchrist@mox.perl.com> writes:
> > > Rick Delaney <rick.delaney@home.com> writes:
> >
> > >> Apparently <'$test'> is OWTDI (though it is very misleading).
> >
> > > There seems to be some unannounced level of interpolation going on here.
> >
> > Yes, that's extremely odd. That should be globbing with the pattern
> > C<$test>, not with the contents of the variable $test. Why is glob
> > double-interpolating?
>
> I don't think it is. When using <*.c>, the <> are the quote characters
> so everything between them is interpolated. So
>
> <*.$ext>
>
> is the same as
>
> glob "*.$ext"
>
> And saying
>
> <'*.$ext'>
>
> would be the same as
>
> glob qq{'*.$ext'};
>
> For some reason, though, it appears that '*.c' is being interpreted (by
> the shell?) as *.c. I'm not sure why this is, or even if it's bad or
> not.
Here's an extract from doing a strace on this operation:
20946 execve("/bin/sh", ["sh", "-c", "echo \'*.c\'|tr -s \' \t\f\r\' \'\\012\\012\\012\\012\'"], [/* 24 vars */]) = 0
So, instead of telling the shell to
echo *.c
it tells the shell to
echo '*.c'
... and it certainly DOES NOT WORK for me.
But then, didn't someone claim <*> uses the C shell? Doesn't look like it
here.
Anyway, this is what glob($test) does:
21064 execve("/bin/sh", ["sh", "-c", "echo *.c|tr -s \' \t\f\r\' \'\\012\\012\\012\\012\'"], [/* 24 vars */]) = 0
And I'd certainly prefer an implementation that didn't involve the shell.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Sat, 26 Jun 1999 21:45:31 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <37752DDB.5D596676@falukuriren.se>
Hi!
After searching for a built in file-delete function in despair, i was
surprised (although i probably shouldn't be) to find it in 'unlink'.
Why such an unlogical name? Does it really delete files (as freeing up
disk space), or am i missing something of great importance here?
Feel free to enlighten me, please!
Mats
------------------------------
Date: 26 Jun 1999 19:06:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Very easy integer question
Message-Id: <7l38bi$4km$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 23:14:59 +0900 Cal Bond wrote:
> Ive just cut and
> pasted bits of code in so don't know how to actually change this myself,
>
Dont you think then perhaps you should be learning to program a language
before you start to play around with it thus - there are two key concepts
that you might want to toy with and explore thoroughly on Deja news (
<http:/www/deja.com>) before you get all hurt and start raging back at me:
A) Cargo Cult Programming
B) Script Kiddie
You might also want to examine the most excellent body of documentation
that ships with every Perl installation:
man perl
or
perldoc perl
or (at last resort see)
<http://language.perl.com>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 11:02:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: wwwboard on webjump.com
Message-Id: <Pine.GSO.4.02A.9906261100270.26514-100000@user2.teleport.com>
On Sat, 26 Jun 1999 luvencl@my-deja.com wrote:
> I am looking for help with placing wwwboard on the webjump.com server.
Do you need help in contacting the support staff for that server or in
composing your message to them asking for help? Or do you need help from
mental health professionals because you wish to use wwwboard at all? :-)
> CGI Script Error
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Jun 1999 17:48:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: wwwboard on webjump.com
Message-Id: <7l33p3$4ka$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 16:05:36 GMT luvencl@my-deja.com wrote:
> I am looking for help with placing wwwboard on the webjump.com server.
> I followed all instructions, but I get:
> CGI Script Error
<snip expected junk>
In the post you appear to be replying to (and for why I dont know - you
should have started a knew thread) David refered to some points I had
made about wwwboard - you can read the full post to which he refers at:
<http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=479798920&fmt=text>
Read that and then think a little why you might not get a great deal of
help with this question - if you have a problem with one of Matts scripts
then perhaps you ought to mail him - alternatively you might have a problem
that is peculiar to your ISP then perhaps you might contact them but please
dont think that this newsgroup is a helpdesk for any old crap written in
Perl running in any old environment.
There are plenty of resources available that might help you listed in the
first item in the document perlfaq9 that is available with every installation
of Perl.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
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 6137
**************************************