[17616] in Perl-Users-Digest
Perl-Users Digest, Issue: 5036 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 5 14:05:51 2000
Date: Tue, 5 Dec 2000 11:05:19 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976043119-v9-i5036@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 5 Dec 2000 Volume: 9 Number: 5036
Today's topics:
Re: A locking question, please (Flint Slacker)
Re: array of unique random numbers <dperham@dperham.eng.tvol.net>
Re: array of unique random numbers (Abigail)
Re: array of unique random numbers <joe+usenet@sunstarsys.com>
Beginners Question - Zero Padding steveattwell@my-deja.com
Re: Beginners Question - Zero Padding (Flint Slacker)
Re: Beginners Question - Zero Padding (Chris Fedde)
Re: Beginners Question - Zero Padding steveattwell@my-deja.com
can't get to mySQL from cgi-bin richard_dobson@my-deja.com
Re: can't get to mySQL from cgi-bin <b_nospam_ill.kemp@wire2.com>
Re: can't get to mySQL from cgi-bin (Flint Slacker)
Re: Counting Korean characters <prlawrence@lehigh.edu>
Re: DBI:mySQL for windows <latsharj@my-deja.com>
Escape sequence \u twa_web_man@yahoo.com
Re: fetch by array <richard.bragg@ntl.com>
Re: fetch by array <prlawrence@lehigh.edu>
Re: finding content type nobull@mail.com
Re: forking a new process from a cgi w/perl <srame@excite.no.spam.no.com>
Getting number of week <cg@schlund.de>
Re: Getting number of week <tony_curtis32@yahoo.com>
Re: Getting number of week <cg@schlund.de>
Re: Help listing files in perl <mischief@velma.motion.net>
Re: HELP neurofase@my-deja.com
Re: HELP neurofase@my-deja.com
Re: HELP nobull@mail.com
how can I test a server using the Net module ?? bouli@my-deja.com
Re: how can I test a server using the Net module ?? nobull@mail.com
how to call a dos excutable file by 'system'? <jingzx@sinaman.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 05 Dec 2000 15:28:13 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: A locking question, please
Message-Id: <3a2d060e.87447031@news.tcn.net>
You can send a SIGALRM to a process after a specified time period use
alarm.
eval {
local $SIG{ALRM} = sub { die "Failed\n" };
alarm 5;
# open and lock, if the wait is more than alarm
# time the die is executed
alarm 0; # Cancel alarm, it worked
};
# Now test $@
Flint
On 4 Dec 2000 14:36:55 -0500, stanb@panix.com (Stan Brown) wrote:
>I am writing a small application that will consist of 2 co-operating perl
>tasks.
>
>Task A will obtain data, and write it to a file. Task B will then need to
>take this data out of the file for further processing. The file will
>consists of a series of records, one per line.
>
>My plan is to have task A lock the file, write to it, then unlock it. Task
>B will lock the file, copy the data that;s there, and truncate the fiel to
>zero lenght, then unlock it.
>
>My problem is with the locking mechanism. I looked at CPAm module
>File::lockf, and it appears to offer the exact functioanlity the I need.
>But I have been unable to seem to get the syntax of thiw working just
>right.
>
>I was able to get locking to work using File::Flock; (which to me appears
>to have a mich simpler interface). However I need for task A to be able to
>time out on failure to obtain the lock, so that it can continue to aquire
>and buffer data.
>
>Could some kind soul please give me an example of using File::lockf?
>
>I am alos open to sugestions as to alternate methods of doing this.
>
>The OS is HP-UX 10.20, if that matters.
>
>Thanks.
>
------------------------------
Date: 05 Dec 2000 09:50:56 -0500
From: Doug Perham <dperham@dperham.eng.tvol.net>
Subject: Re: array of unique random numbers
Message-Id: <81itoyj50v.fsf@wgate.com>
"Dela Lovecraft" <dela@nospam.ukonline.co.uk> writes:
> Dear All,
>
> I need to produce an array of random numbers, but each of them needs
> to be unique ie. if I have an array of 50 values, none can be replicated.
>
> As far as I can see, the way to do this would be:
> * set an array of n members
> * put a random number in slot 1
> * create another random number, and check to see that it doesn't appear
> in any of the preceeding elements - if it does, create a different number
> until it does
why not use a hash to guarantee uniqueness (using the random number as
the key)? Then stop when you have 50 keys.
> * repeat the above set until all n are filled.
>
>
> Is this the only way to do it? If someone has a better idea, could you give
> perl pointers to show how it would be done?
>
> Thanks for your help
>
>
> Dela Lovecraft
------------------------------
Date: 5 Dec 2000 17:34:05 GMT
From: abigail@foad.org (Abigail)
Subject: Re: array of unique random numbers
Message-Id: <slrn92q9od.80s.abigail@tsathoggua.rlyeh.net>
On 05 Dec 2000 07:29:40 -0500, Joe Schaefer (joe+usenet@sunstarsys.com) wrote in comp.lang.perl.misc <URL: news:<m31yvnnj9n.fsf@mumonkan.sunstarsys.com>>:
++ abigail@foad.org (Abigail) writes:
++
++ > This is what the OP asked:
++ > >> I need to produce an array of random numbers, but each of them needs
++ > >> to be unique ie. if I have an array of 50 values, none can be replicated.
++ >
++ > which is a 'list of random elements'. The fact there's some order in it
++ > doesn't matter; there was no requirement to have a random order. If you
++ > want a random order, fine, shuffle. But it's not a wrong answer if you
++ > don't.
++
++ s/50/2/:
++
++ I need to produce an array of 2 random numbers, but each of them
++ needs to be unique ie. if I have an array of 2 values, none can
++ be replicated.
++
++ Assume that the random numbers are to be selected from the
++ integers (1,2). A "keys %hash" implementation produces the
++ list (1,2) (or (2,1) depending on how hashes are implemented
++ on your box) with 100% certainty.
Not quite; the order of inserts can matter. But that's beside the point.
What's important is that depending on what you do with the numbers,
(1, 2) and (2, 1) might be identical anyway. There is exactly one way
to draw 2 balls from a set of 2 balls, and that's taking them both.
Whether you first pick the red ball, and then the blue one, or you first
pick the blue one then the red one, or you pick them both at the same
time: the result is the same - two balls in your hand and an empty vase.
++ With the shuffle added
++ in (or some other means that were mentioned by other
++ respondents- the shuffle is not necessary if you create
++ the list while the numbers are generated), you'll get the
++ other one roughly 50% of the time.
++
++ keys %hash reduces the randomness of the numbers in %hash.
Absolutely bullshit. Since it won't change any of the numbers,
how can it reduce the randomness?
++ Mathematically, you cannot discuss how random something is
++ until you have described the entire "process". Just because
++ your numbers were "randomly generated" does not mean you are
++ guaranteed that the ultimate list contains "random elements".
Mathematically, if you have a set, there's no order. All the OP asked
was for a set of random numbers, not a sequence.
Abigail
------------------------------
Date: 05 Dec 2000 13:07:26 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: array of unique random numbers
Message-Id: <m3sno2n3mp.fsf@mumonkan.sunstarsys.com>
abigail@foad.org (Abigail) writes:
> On 05 Dec 2000 07:29:40 -0500, Joe Schaefer wrote:
>
> Not quite; the order of inserts can matter. But that's beside the point.
> What's important is that depending on what you do with the numbers,
> (1, 2) and (2, 1) might be identical anyway. There is exactly one way
> to draw 2 balls from a set of 2 balls, and that's taking them both.
> Whether you first pick the red ball, and then the blue one, or you first
> pick the blue one then the red one, or you pick them both at the same
> time: the result is the same - two balls in your hand and an empty vase.
>
> ++ With the shuffle added
> ++ in (or some other means that were mentioned by other
> ++ respondents- the shuffle is not necessary if you create
> ++ the list while the numbers are generated), you'll get the
> ++ other one roughly 50% of the time.
> ++
> ++ keys %hash reduces the randomness of the numbers in %hash.
>
> Absolutely bullshit. Since it won't change any of the numbers,
> how can it reduce the randomness?
We are arguing over two interpretations of the same ambiguous
question. You (and I) have pointed that out already, and I am
not arguing that one interpretation was any better than the other.
This debate is silly as long as we are free to define terms as we
see fit.
From my point of view, what's needed is a _list_ of random numbers,
and apparently you view the question as requiring a _set_ of them.
Quibbling about ordering was not my intent here, and I'm sorry
if I've upset you.
>
> ++ Mathematically, you cannot discuss how random something is
> ++ until you have described the entire "process". Just because
> ++ your numbers were "randomly generated" does not mean you are
> ++ guaranteed that the ultimate list contains "random elements".
>
> Mathematically, if you have a set, there's no order. All the OP asked
> was for a set of random numbers, not a sequence.
>
Again, this is also correct- assuming that what's needed is a set.
--
Joe Schaefer
------------------------------
Date: Tue, 05 Dec 2000 16:29:57 GMT
From: steveattwell@my-deja.com
Subject: Beginners Question - Zero Padding
Message-Id: <90j55s$9dv$1@nnrp1.deja.com>
I have a string which contains a numeric code. The code length varies
between 7 to 11 digits. I want to left zero pad the string for any
value of the code less than 11 digits. Example string value =
1234567890 I want the result to be 01234567890. I'm doing this by using
if and elsif statements with concatenation. Is there any left zero fill
format function or regular expression I can use instead?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 16:41:11 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: Beginners Question - Zero Padding
Message-Id: <3a311a5d.92647521@news.tcn.net>
sprintf will handle this for you
Flint
On Tue, 05 Dec 2000 16:29:57 GMT, steveattwell@my-deja.com wrote:
>I have a string which contains a numeric code. The code length varies
>between 7 to 11 digits. I want to left zero pad the string for any
>value of the code less than 11 digits. Example string value =
>1234567890 I want the result to be 01234567890. I'm doing this by using
>if and elsif statements with concatenation. Is there any left zero fill
>format function or regular expression I can use instead?
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 16:47:24 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Beginners Question - Zero Padding
Message-Id: <w_8X5.69$T3.171188224@news.frii.net>
In article <90j55s$9dv$1@nnrp1.deja.com>,
steveattwell@my-deja.com writes:
> I have a string which contains a numeric code. The code length varies
> between 7 to 11 digits. I want to left zero pad the string for any
> value of the code less than 11 digits. Example string value =
> 1234567890 I want the result to be 01234567890. I'm doing this by using
> if and elsif statements with concatenation. Is there any left zero fill
> format function or regular expression I can use instead?
>
>
$f = sprintf("%011s", 12345687890);
print $f;
good luck
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 05 Dec 2000 17:48:04 GMT
From: steveattwell@my-deja.com
Subject: Re: Beginners Question - Zero Padding
Message-Id: <90j9oh$dpn$1@nnrp1.deja.com>
In article <w_8X5.69$T3.171188224@news.frii.net>,
cfedde@fedde.littleton.co.us (Chris Fedde) wrote:
> In article <90j55s$9dv$1@nnrp1.deja.com>,
> steveattwell@my-deja.com writes:
> > I have a string which contains a numeric code. The code length
varies
> > between 7 to 11 digits. I want to left zero pad the string for any
> > value of the code less than 11 digits. Example string value =
> > 1234567890 I want the result to be 01234567890. I'm doing this by
using
> > if and elsif statements with concatenation. Is there any left zero
fill
> > format function or regular expression I can use instead?
> >
> >
>
> $f = sprintf("%011s", 12345687890);
> print $f;
>
> good luck
> chris
>
> --
> Hey Thanks - this worked.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 17:03:26 GMT
From: richard_dobson@my-deja.com
Subject: can't get to mySQL from cgi-bin
Message-Id: <90j74p$b5i$1@nnrp1.deja.com>
hi,
i have installed indigo perl which has DBD::mySQL within it. I also
have mySQL. I have a script that runs from the command line but not
from the cgi-bin. I don't have any difficulties running other cgi
scripts. It is very simple and the core is as follows:
(not including cgi headers)
use DBI;
my $dbh = DBI->connect("DBI:mysql:database=database01;host=localhost",
undef, undef,{'RaiseError' => 1});
my $sth = $dbh->prepare("SELECT * FROM table01");
$sth->execute();
while (my $ref = $sth->fetchrow_hashref()) {
print "Found a row: id = $ref->{'field01'}, name = $ref->{'field02'}\n";
}
$sth->finish();
$dbh->disconnect();
the browser produces the following response:
'The server encountered an internal error or misconfiguration and was
unable to complete your request.'
Am I missing something simple here?
thanks in advance
Rich
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 5 Dec 2000 17:43:16 -0000
From: "W K" <b_nospam_ill.kemp@wire2.com>
Subject: Re: can't get to mySQL from cgi-bin
Message-Id: <976038206.18120.0.nnrp-14.c3ad6974@news.demon.co.uk>
richard_dobson@my-deja.com wrote in message <90j74p$b5i$1@nnrp1.deja.com>...
>hi,
>i have installed indigo perl which has DBD::mySQL within it. I also
>have mySQL. I have a script that runs from the command line but not
>from the cgi-bin. I don't have any difficulties running other cgi
>scripts. It is very simple and the core is as follows:
>(not including cgi headers)
>
>use DBI;
>my $dbh = DBI->connect("DBI:mysql:database=database01;host=localhost",
> undef, undef,{'RaiseError' => 1});
>
>my $sth = $dbh->prepare("SELECT * FROM table01");
> $sth->execute();
> while (my $ref = $sth->fetchrow_hashref()) {
>
>print "Found a row: id = $ref->{'field01'}, name = $ref->{'field02'}\n";
>
> }
> $sth->finish();
>
> $dbh->disconnect();
>
>
>the browser produces the following response:
>
>'The server encountered an internal error or misconfiguration and was
>unable to complete your request.'
>
>Am I missing something simple here?
Maybe.
'root' user may not require a password.
'nobody' might require a password.
Just to make this on topic-ish.
would you open files without checking the return status?
Its quite a good idea, as is checking whether or not your database calls
work.
PS.
Apache error logs?
------------------------------
Date: Tue, 05 Dec 2000 17:54:23 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: can't get to mySQL from cgi-bin
Message-Id: <3a332b93.97053882@news.tcn.net>
Script works fine, but I had to add a username and password, your
webserver might require one.
Flint
On Tue, 05 Dec 2000 17:03:26 GMT, richard_dobson@my-deja.com wrote:
>hi,
>i have installed indigo perl which has DBD::mySQL within it. I also
>have mySQL. I have a script that runs from the command line but not
>from the cgi-bin. I don't have any difficulties running other cgi
>scripts. It is very simple and the core is as follows:
>(not including cgi headers)
>
>use DBI;
>my $dbh = DBI->connect("DBI:mysql:database=database01;host=localhost",
> undef, undef,{'RaiseError' => 1});
>
>my $sth = $dbh->prepare("SELECT * FROM table01");
> $sth->execute();
> while (my $ref = $sth->fetchrow_hashref()) {
>
>print "Found a row: id = $ref->{'field01'}, name = $ref->{'field02'}\n";
>
> }
> $sth->finish();
>
> $dbh->disconnect();
>
>
>the browser produces the following response:
>
>'The server encountered an internal error or misconfiguration and was
>unable to complete your request.'
>
>Am I missing something simple here?
>
>thanks in advance
>Rich
>
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: Tue, 5 Dec 2000 09:34:29 -0500
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: Re: Counting Korean characters
Message-Id: <90iudm$e48@fidoii.CC.Lehigh.EDU>
[CC: "hokiebear" <ayambema@adelphia.net> ]
"hokiebear" <ayambema@adelphia.net> wrote:
> I would like to count the number of Korean characters in a given text and am
> would appreciate any help as to what expression to use for such a purpose.
> The Korean text will be in KSC-5601 or EUC-KR. Thank you!
I'm not up on it myself, but I believe Perl 5.6 's use of UNICODE will allow
what you need. Check out http://www.perl.com/pub/2000/04/whatsnew.html , which
states:
"The largest change in Perl 5.6 has to be the introduction of UTF-8 Unicode
support. By default, Perl now thinks in terms of Unicode characters instead of
simple bytes; a character can, as the CJK people already know extremely well,
span several bytes. All the relevant built-in functions (length, reverse, and so
on) now work on a character-by-character basis instead of byte-by-byte, and
strings are represented internally in Unicode"
Phil R Lawrence
------------------------------
Date: Tue, 05 Dec 2000 14:37:24 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: DBI:mySQL for windows
Message-Id: <90iuj4$3kc$1@nnrp1.deja.com>
In article <90ig32$opr$1@nnrp1.deja.com>,
richard_dobson@my-deja.com wrote:
> I am desparately looking for the DBi drivers for mySQL on wondows.
I assume you mean MS Windows and are running Perl from Activestate.
At a command prompt run:ppm search mySQL
You should get a return of: DBD-Mysql, which you can install with:ppm
install DBD-Mysql.
--
Regards,
Dick
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 17:21:52 GMT
From: twa_web_man@yahoo.com
Subject: Escape sequence \u
Message-Id: <90j877$c8h$1@nnrp1.deja.com>
Can someone please give me a concrete example of how and when to
correctly add the \u escape sequence to make the first character of a
string Uppercase?
Here is where I have it now (within a "print" statement):
<td width\=\"215\"><FONT face\=\"Trebuchet MS, Verdana, Tahoma\"
color\=\"#000033\">\L\u$wind_data\E
</FONT></td>
I've also tried:
<td width\=\"215\"><FONT face\=\"Trebuchet MS, Verdana, Tahoma\"
color\=\"#000033\">\u$wind_data
</FONT></td>
I've also tried:
if ($input[$item] =~ /Wind/) {
@wind = split (/\:/, $input[$item]);
$wind_data = @wind[1];
$wind_data = \u$wind_data
}
I'll appreciate any help.
Thanks,
Kevin Jackson
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 5 Dec 2000 17:05:41 -0000
From: "Richard Bragg" <richard.bragg@ntl.com>
Subject: Re: fetch by array
Message-Id: <Nf9X5.1090$Ah3.14870@news6-win.server.ntlworld.com>
Yup.
Assuming you are using DBI then there is a fetchall_arrayref method that can
pull loads of data over. I just collected some 50000 rows.
The problem is that it uses refereces which makes things a tad harder but I
got there in the end.
http://www.bitmechanic.com/mail-archives/dbi-users/current/0359.html is very
useful
code fragment
$st = $db->prepare('select * from foo');
$st->execute();
for (@{$st->fetchall_arrayref}) {
print join(',',@{$_});
}
<eastking@my-deja.com> wrote in message news:90ihsv$q3q$1@nnrp1.deja.com...
> Hi,every one here.
>
> I am using perl to fetch data from Oracle. I have to fetch them on by
> one.
>
> I used to fecth data by array ( about 200 for each fetch) using Pro*c.
> It is much faster .
>
> so I want to know is it possible fetch data by array in perl.
>
> thanks in advance.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 5 Dec 2000 11:38:11 -0500
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: Re: fetch by array
Message-Id: <90j5lk$hvs@fidoii.CC.Lehigh.EDU>
[CC: eastking@my-deja.com ]
<eastking@my-deja.com> wrote:
> I am using perl to fetch data from Oracle. I have to fetch them on by
> one.
>
> I used to fecth data by array ( about 200 for each fetch) using Pro*c.
> It is much faster .
>
> so I want to know is it possible fetch data by array in perl.
I assume you are using DBI... the pod says:
fetchrow_arrayref
$ary_ref = $sth->fetchrow_arrayref;
$ary_ref = $sth->fetch; # alias
Fetches the next row of data and returns a reference to an array holding the
field values. Null fields are returned as undef values in the array. This is the
fastest way to fetch data, particularly if used with $sth->bind_columns.
If your script is unduly slow, look for structure problems, particularly if you
are new to the DBI. You might want to read The Perl Journal Volume 4, Number 2
(#14), Summer 1999 "Using Databases with DBI: What Not To Do."
Phil R Lawrence
------------------------------
Date: 05 Dec 2000 17:49:09 +0000
From: nobull@mail.com
Subject: Re: finding content type
Message-Id: <u91yvm92sq.fsf@wcl-l.bham.ac.uk>
Ilmari Karonen <iltzu@sci.invalid> writes:
> When a file is uploaded the browser usually sends along some
> information along with it in the format of headers. The
> information usually includes the MIME content type.
s/the/a/;
Most popular browsers contain heiuristics to determine MIME-type for
for files obtained via protocols that don't give a content-type
(e.g. FTP or FILE). At least one widely used browser often insists on
using these heuristics on HTTP downloads rather than believing the
content-type sent by the server.
Nonetheless this same browser that is so keen to use heuristics when
it is inappropriate does not bother to apply them to uploads - it'll
happly upload a GIF as application/octet-stream.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 05 Dec 2000 09:56:40 -0700
From: srame <srame@excite.no.spam.no.com>
Subject: Re: forking a new process from a cgi w/perl
Message-Id: <3A2D1E48.E519BBA0@excite.no.spam.no.com>
Thank you. This worked very well.
-srame
Philip Garrett wrote:
>
> srame <srame@excite.no.spam.no.com> wrote in message
> news:3A2BF676.F47B9390@excite.no.spam.no.com...
> >
> > Basically, I have a "Go" button. When the "Go" button is pressed, I
> > would like some process to be executed as a child process and never to
> > be heard from again - and I would like my cgi exit. So I have something
> > like this happen after I press "Go".
> >
> > print start_html;
> > print "before execution"
> > system("nohup long_running_process &");
> > print "after execution"
> > print end_html;
> > exit;
> >
> > The problem is, the browser will time out, because the cgi will not
> > exit. It will do the stuff before the system call, and it will do the
> > stuff after the system call - but the browser will continue to "load"
> > until the long_running_process is complete. Any ideas?
>
> You want to "daemonize" the program. To do this, use fork(), setsid() (or
> maybe setpgrp(), depending on your OS), and then exec(). Here's an example:
>
> use POSIX;
>
> my $pid = fork;
> die "can't fork: $!" unless defined $pid;
>
> if ($pid == 0) {
> # child
>
> # dissociate from process group
> if (POSIX::setsid == -1) {
> die "can't setsid: $!";
> }
>
> # dissociate from controlling "terminal"
> open STDOUT, ">/dev/null";
> open STDIN, "/dev/null";
>
> # replace current program with /bin/sleep
> exec '/bin/sleep 30';
> die "can't exec: $!";
> }
>
> print "Content-type: text/plain\n\n";
> print "Parent exiting...\n";
>
> If you do a 'ps -ef' (or your system's equivalent) right after you run the
> cgi, you'll see 'sleep 30' running.
>
> hth,
> p
------------------------------
Date: Tue, 05 Dec 2000 16:59:41 +0100
From: Carsten Gaebler <cg@schlund.de>
Subject: Getting number of week
Message-Id: <3A2D10ED.4C1F4833@schlund.de>
Hi!
Is there a Perl function that returns the number of the week for a given
unix time? localtime() doesn't do that and I do not want to make a
system call to "date".
Regards
Carsten.
------------------------------
Date: 05 Dec 2000 10:01:06 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting number of week
Message-Id: <87aeaakgcd.fsf@limey.hpcc.uh.edu>
>> On Tue, 05 Dec 2000 16:59:41 +0100,
>> Carsten Gaebler <cg@schlund.de> said:
> Hi! Is there a Perl function that returns the number of
> the week for a given unix time? localtime() doesn't do
> that and I do not want to make a system call to "date".
perldoc POSIX ==> strftime %U, %V or %W
hth
t
--
Eih bennek, eih blavek.
------------------------------
Date: Tue, 05 Dec 2000 17:29:59 +0100
From: Carsten Gaebler <cg@schlund.de>
Subject: Re: Getting number of week
Message-Id: <3A2D1807.8610015B@schlund.de>
Tony Curtis wrote:
> perldoc POSIX ==> strftime %U, %V or %W
Great! Thanks!
cg.
------------------------------
Date: Tue, 05 Dec 2000 16:18:02 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Help listing files in perl
Message-Id: <t2q59qchrt8m7a@corp.supernews.com>
punksk8er@home.com wrote:
> I'm kinda new to perl and I'm kinda lost on how to make a list of files
> in a directory.
perldoc -f opendir
perldoc -f readdir
perldoc -f closedir
> Can someone be kind enough to show me?
> Thank you.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 16:27:35 GMT
From: neurofase@my-deja.com
Subject: Re: HELP
Message-Id: <90j51e$9cd$1@nnrp1.deja.com>
In article <90h7ev$pqp$1@nnrp1.deja.com>,
neurofase@my-deja.com wrote:
> I have created a form in html and used a .pl file to change the
> information entered and send it in an email. I know that their is
> nothing wrong with the perl file as it is a copy of another. I am on
> the same network as the webserver, which is an microsoft exchange
> server, so i just transfered the file across. I used leech to FTP and
> change the attributes from 777 to 755. But the form still does not
> work. Everytime I complete the form I get the following message. Can
> anyone help me? I am very very new to this all so please be basic in
> advice.
>
> Thanks
> Gary
>
> You are not authorized to view this page
> You might not have permission to view this directory or page using the
> credentials you supplied.
>
> ----------------------------------------------------------------------
--
> --------
>
> If you believe you should be able to view this directory or page,
> please try to contact the Web site by using any e-mail address or
phone
> number that may be listed on the ********* home page.
>
> You can click Search to look for information on the Internet.
>
> HTTP Error 403 - Forbidden
> Internet Explorer
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Dec 2000 16:26:20 GMT
From: neurofase@my-deja.com
Subject: Re: HELP
Message-Id: <90j4v3$9bo$1@nnrp1.deja.com>
In article <90h7ev$pqp$1@nnrp1.deja.com>,
neurofase@my-deja.com wrote:
> I have created a form in html and used a .pl file to change the
> information entered and send it in an email. I know that their is
> nothing wrong with the perl file as it is a copy of another. I am on
> the same network as the webserver, which is an microsoft exchange
> server, so i just transfered the file across. I used leech to FTP and
> change the attributes from 777 to 755. But the form still does not
> work. Everytime I complete the form I get the following message. Can
> anyone help me? I am very very new to this all so please be basic in
> advice.
>
> Thanks
> Gary
>
> You are not authorized to view this page
> You might not have permission to view this directory or page using the
> credentials you supplied.
>
> ----------------------------------------------------------------------
--
> --------
>
> If you believe you should be able to view this directory or page,
> please try to contact the Web site by using any e-mail address or
phone
> number that may be listed on the ********* home page.
>
> You can click Search to look for information on the Internet.
>
> HTTP Error 403 - Forbidden
> Internet Explorer
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 05 Dec 2000 17:43:42 +0000
From: nobull@mail.com
Subject: Re: HELP
Message-Id: <u94s0i931t.fsf@wcl-l.bham.ac.uk>
neurofase@my-deja.com writes:
> Subject: HELP
Useless subject line - please make an effort.
> You are not authorized to view this page
> You might not have permission to view this directory or page using the
> credentials you supplied.
>
> ------------------------------------------------------------------------
> --------
>
> If you believe you should be able to view this directory or page,
> please try to contact the Web site by using any e-mail address or phone
> number that may be listed on the ********* home page.
>
> You can click Search to look for information on the Internet.
>
>
> HTTP Error 403 - Forbidden
> Internet Explorer
You have a server configurataion problem, nothing whatever to do with
Perl. Please try a newsgroup that deals with configurataion of your
web server software.
BTW: The above is not the real error message. IE follows M$
programming standards and protects the user from the actual error
returned by the server because it may contain specific information
about what actually happend that could help to debug the problem.
Clearly M$ consider the idea that an M$ user may actually try to debug
something to be too scary. Instead IE presents a generic message that
tells you a few of the things that M$ can think of that could have
resulted in a 403 result code.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 05 Dec 2000 14:27:08 GMT
From: bouli@my-deja.com
Subject: how can I test a server using the Net module ??
Message-Id: <90itvj$33s$1@nnrp1.deja.com>
hello,
I'd like to test a server using the Net-ext module.
the server is ok when you can do a telnet on the port 3000, and you
are immediately disconnected.
the server is not ok if :
- you can't connect
- the connection isn't closed immediately
I tried several combinations of open, connect, bind, isopen,
isconnected, isbound, but it doesn't work.
If anyone could help ...
thanks
nicolas figaro
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 05 Dec 2000 18:23:38 +0000
From: nobull@mail.com
Subject: Re: how can I test a server using the Net module ??
Message-Id: <u9wvde7mmt.fsf@wcl-l.bham.ac.uk>
bouli@my-deja.com writes:
> hello,
Grrr...
> I'd like to test a server using the Net-ext module.
I'd never heard of the Net-ext module until now. What advantage does
it offer over IO::Socket for doing this?
> the server is ok when you can do a telnet on the port 3000, and you
> are immediately disconnected.
Immediately? Surely you then have to wait for network propagation of
the fact that the socket has closed (how long this takes varies
according to the reliability of the network).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 05 Dec 2000 23:36:39 +0800
From: jin zengxiang <jingzx@sinaman.com>
Subject: how to call a dos excutable file by 'system'?
Message-Id: <3A2D0B87.3CE734C6@sinaman.com>
HI,there :
I want to call a program which is designed to run in dos environment
,how
can I call the program by the command --" system(.....)"?
say,the program is placed in C:\
and the name is dos.exe. Does anybody know the solution ?
Thanks for your help.
Alan Jin
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 5036
**************************************