[9821] in Perl-Users-Digest
Perl-Users Digest, Issue: 3414 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 11 02:07:36 1998
Date: Mon, 10 Aug 98 23: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 Mon, 10 Aug 1998 Volume: 8 Number: 3414
Today's topics:
Re: ActiveState 5.005: Where are the threads? <jdf@pobox.com>
Re: Calculate Date in Perl ngong@my-dejanews.com
calling one script from another script alexkay4510@my-dejanews.com
Re: cat while file open w/ Win32 Perl <REPLY_TO_lastronin@earthlink.net>
Re: Copyright question <jamesht@idt.net>
Re: create html files in htdocs <REPLY_TO_lastronin@earthlink.net>
Re: Date and Time <abarfoot@eng.auburn.edu>
Re: Date and Time (Larry Rosler)
Re: File updating question <REPLY_TO_lastronin@earthlink.net>
Re: having trouble with printing array to html <REPLY_TO_lastronin@earthlink.net>
is the ActiveState Perl win32 broken or am I??? <REPLY_TO_damonbrent@earthlink.net>
Is there a maximum recommended file size for Perl Scrip <info@purco.qc.ca>
Re: japanese character searches of flatfile db's <sue@geocities.co.jp>
Re: Perl 5.005 and Linux: make test <ajohnson@gpu.srv.ualberta.ca>
Re: PERLDOC for Win32 ?? <antoy@cs.pdx.edu>
Re: perlfaq - frequently asked questions about Perl (pa <uri@sysarch.com>
Re: printing remote host <REPLY_TO_lastronin@earthlink.net>
Re: sorting hash by values <clinton@REMOVETHIS.dt.wdc.com>
Re: SSI Perl Script <REPLY_TO_lastronin@earthlink.net>
Re: String comparison problem <REPLY_TO_lastronin@earthlink.net>
Re: Test Results - Asking a question <jdf@pobox.com>
Using variable in TR (cs - Elton Kong)
Re: What is the purpose of Perl <pgunn01@ibm.net>
Re: what is this stuff? <REPLY_TO_lastronin@earthlink.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Aug 1998 23:43:29 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: ActiveState 5.005: Where are the threads?
Message-Id: <d8a8uo0e.fsf@mailhost.panix.com>
nvp@shore.net (Nathan V. Patwardhan) writes:
> If there's one "element of beauty" in the merged versions, it's that a
> person can download a set of development tools (U/WIN, Cygnus, Mingw32,
> Borland, MSVC-whatever), and build Perl effectively themselves.
FWIW, I have not been able to build Perl 5.005 with the latest Cygwin
development kit, whereas building with an old version of MSVC was a
no-brainer. In fact, I can't even get through Configure. And I
hacked it for a couple of hours...
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Tue, 11 Aug 1998 04:21:34 GMT
From: ngong@my-dejanews.com
Subject: Re: Calculate Date in Perl
Message-Id: <6qogse$pl3$1@nnrp1.dejanews.com>
> Have you looked at your server's error logs for details? do you know your
> server keeps error logs??
Return to the step that I make install Date::Calc module. It appears message
like this :
## Differing version of Date/Calc.pm found. You might like to
rm /usr/local/lib/perl5/site_perl/./Date/Calc.pm
## Differing version of auto/Date/Calc/Calc.so found. You might like to
rm /usr/local/lib/perl5/site_perl/i386-bsdos/./auto/Date/Calc/Calc.so
## Running 'make install UNINST=1' will unlink all those files for you.
I don't know that this message is a cause of error quoted below or not. I try
to use command 'make install UNINST=1' to unlink all those files mentioned
above. Here is the error again :
Skipping /usr/home/<username>/usr/local/lib/perl5/site_perl/i386-bsd
os/./auto/Date/Calc/Calc.so (unchanged) Unlinking
/usr/local/lib/perl5/site_perl/i386-bsdos/./auto/Date/Calc/Calc.so (sh
adowing?) Cannot forceunlink
/usr/local/lib/perl5/site_perl/i386-bsdos/./auto/Date/Calc/Ca lc.so:
Permission denied at /usr/local/lib/perl5/File/Find.pm line 135 *** Error
code 13
I was used to use function date in shell script to calculate date instead. It
works on Linux but it doesn't work on my virtual server which is BSD Unix
because its option isn't complete. How can I calculate a new date in Perl or
Shell Script, then ?
Best Regards,
Anchalee Laiteerapong
------------------------
This is my test program :
#!/usr/local/bin/perl
use Date::Calc qw(:all);
use CGI;
print("Content-type: text/html\n\n");
print("<html>\n");
print("<head>\n");
print("<title>This is a test</title>\n");
print("</head>\n");
print("<body>\n");
($year, $month, $day) = Today();
print("Today is $day/$month/$year");
print("</body>\n</html>");
------------------------
Here is the error I got when I tried to run it locally :
% virtual ./test.cgi
Can't find loadable object for module Date::Calc in @INC
(/usr/local/lib/perl5/i386-bsdos/5.00401 /usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/i386-bsdos /usr/local/lib/perl5/site_perl
.) at ./test.cgi line 3
BEGIN failed--compilation aborted at ./test.cgi line 3.
------------------------
And here is the error from the error_log that was recorded when I tried
to run this from WWW:
[Sun Aug 9 22:55:52 1998] HTTPd: malformed header from script
/usr/local/etc/httpd/cgi-bin/test/test.cgi
Can't find loadable object for module Date::Calc in @INC
(/usr/local/lib/perl5/i386-bsdos/5.00401 /usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/i386-bsdos /
usr/local/lib/perl5/site_perl .) at
/usr/local/etc/httpd/cgi-bin/test/test.cgi line 3
BEGIN failed--compilation aborted at
/usr/local/etc/httpd/cgi-bin/test/test.cgi line 3.
------------------------
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 03:36:02 GMT
From: alexkay4510@my-dejanews.com
Subject: calling one script from another script
Message-Id: <6qoe72$m0i$1@nnrp1.dejanews.com>
Here is the situation. My order form calls a script on secure server on
another site. I would like to be able to receive the input form information
on my site . Call a script on my site and have the info sent by email (
sendmail ) to me and then call the secure server as it does now to continue
the process. In other word can one script call another passing the input
information to both...
Alex
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 11 Aug 1998 00:55:53 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: cat while file open w/ Win32 Perl
Message-Id: <6qoi8h$br4$1@holly.prod.itd.earthlink.net>
Oh, i forgot to mention that the exact problem is a memory leak. the
processor goes on forever and never quits when it hits the concatenation
line, the scary result of which is one's mouse pointer combusts, unable to
turn into an i-beam when rolled over text. that's about the only effect. it
compiles and executes up to the cat line, but that's it.
i've even tried every regex trick in the book, all the quoting schemes,
etc., to no avail. and the funny thing is, cat will work outside of the
while <FH> loop. weird, eh? maybe this should have gone directly to guru
sammy instead of the newsgroup, but as i've read the docs, they say to post
to the group, capture output of -w and -V BEFORE reporting to the bugs
people. ah well
ha.
------------------------------
Date: Tue, 11 Aug 1998 01:43:40 -0400
From: jamesht <jamesht@idt.net>
Subject: Re: Copyright question
Message-Id: <35CFDA0C.FA3C73CC@idt.net>
'You',
Who should have an attribution??
Me...
ps- This message is copyright 1998 and may not be used in any way without
the express written consent of me.
Tad McClellan wrote:
> Alan Silver (alan@find-it.furryferret.uk.com) wrote:
> : >What, really, are you going to copyright? Are you going to patent
> : >
> : >$i += 1;
>
> : Aren't you being childish ? You know fully well that was not the
> ^^^ ^^^
> : intention of the poster.
>
> Who you?
>
> You should have an attribution in there if you are going
> to address someone in particular...
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Tue, 11 Aug 1998 01:38:26 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: create html files in htdocs
Message-Id: <6qoko9$gbo$1@holly.prod.itd.earthlink.net>
as tom p. mentioned, output to check your results. additionally, you might
try environment variables to set your path, or use any of the standard
modules distributed with Perl.
assuming your cgi-bin is UNDER htdocs and the dir you want to
create/delete/whatever is also under htdocs somewhere,
$ENV{'DOCUMENT_ROOT'}
yields
/u/root/foo/bar/htdocs
without a trailing slash. if you want to traverse your tree starting from
the current cgi-bin directory, use
$ENV{'SCRIPT_NAME'}
$ENV{'SCRIPT_FILENAME'}
which yields
/cgi-bin/myscript.cgi and
/u/root/foo/bar/htdocs/cgi-bin/myscript.cgi
alternately, you can try
use Cwd;
$dir = cwd();
this yields
/cgi-bin
which is handy for knowing where you are in order to get to where you want
to go. try this:
# this should give you u/root/foo/bar/htdocs/dir1/dir2/dir3/mypage.txt
$path = $ENV{'DOCUMENT_ROOT'} . '/dir1/dir2/dir3/mypage.txt';
open (FILE, ">$path") || print("oops could not open FILE at $path");
finally, make sure that all the directories you need to traverse to
create/read/etc the file you want outside the cgi-bin has the proper
permissions set. check that everyone has execute permissions. the easiest to
set is chmod 755. on some servers, not necessarily Apache (and depending on
how you configured apache and user permissions), doing a 777 or anything
with a write permission on a directory WILL NOT allow you to access that
directory. weird but true. there's really no need to go to the parent
directory (parent being THE root directory of your user account) if /htdocs
lives somewhere below parent.
cheers,
ha quach
mailto:info@r-go.com
c.clark@student.unsw.edu.au wrote in message
<35cb86a3.615056@news.syd.enternet.com.au>...
>
>G'day,
>
>I'm using an apache server. I want to create HTML files in the htdocs
>directory from a CGI program in Perl. I have tried setting the path,
>but it doesn't seem to work.
>
>I have no problems creating/deleting (or whatever) to files in the
>cgi-bin directory, it's just when I try and go to the parent directory
>and then into htdocs.
>
>At the moment everything is default on the server. Would it be a
>permission thing? Can anyone give me a quick example of the code?
>
>
>Ta muchly,
>
>
>Chris Clarke.
------------------------------
Date: Mon, 10 Aug 1998 22:25:39 -0500
From: andy barfoot <abarfoot@eng.auburn.edu>
To: Thomas Emery <temery@crocker.com>
Subject: Re: Date and Time
Message-Id: <Pine.SOL.3.96.980810222456.865A-100000@marauder.eng.auburn.edu>
my ($month,$day,$hour,$min) = (localtime)[4,3,2,1];
my $answer = sprintf "%02d/%02d %02d:%02d\n", $month+1,$day,$hour,$min;
--
andy.barfoot@eng.auburn.edu
On Mon, 10 Aug 1998, Thomas Emery wrote:
> How can I show the date as month and day (no year), and the time as just
> hour and minute (dropping the second)?
>
> Tom
------------------------------
Date: Mon, 10 Aug 1998 21:39:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date and Time
Message-Id: <MPG.10396af7426820819897c3@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <35CF8547.1BEEE4DF@crocker.com> on Mon, 10 Aug 1998 22:42:00 -
0100, Thomas Emery <temery@crocker.com> says...
> How can I show the date as month and day (no year), and the time as just
> hour and minute (dropping the second)?
perdoc -f localtime
In list context, localtime returns all of the elements of the date/time,
which you can manipulate or print as you please.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 11 Aug 1998 00:21:07 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: File updating question
Message-Id: <6qog7c$7p6$1@holly.prod.itd.earthlink.net>
Phil Taylor wrote in message <35cf60bc.11105292@news.demon.co.uk>...
>I'm trying to achieve the following:-
>
>1) open file
>2) lock file
you don't need to lock the file if you're just going to slurp it into an
array while reading then copying over to a temp file and deleting the
original.
>3) backup the file (in case the forthcoming update goes badly wrong)
getting ahead of myself. for insurance with backup copy, you'll want:
open (FILE1, "<$path1")
|| die("oopsies, error opening $path1 to read");
open (FILE2, ">$path2)
|| die("oopsies, error opening $path2 to write");
while (<FILE1>)
{
$_ = .... [manipulate what you need to each line in FILE1 for
writing to FILE2]
print FILE2 $_; # this prints FILE1 to FILE2 one line at a time
}
close(FILE1); # close them in the order you open them
close(FILE2);
notice that nothing has changed in FILE1, so there's no need for a backup
copy. just in case, you could do:
use File::Copy; # put this near the top of your script
copy("source file", "destination-file");
or, if paths are already defined as variables...
copy($path1, $path2);
>4) read the file into an array
it's hardly ever a good idea to slurp a file into a fat array. i learned
this the hard way when i started developing locally. it's bad on memory. if
you can, never do this:
@lines = <FILE>;
despite all the documentation examples i've seen.
>5) update the array
as before, work on $_ rather than @lines array.
>6) write the array back to the file
>7) close the file
>8) delete the backup
do some debugging and print contents of FILE2 to STDOUT or your browser.
once it's exactly what you want, you can do:
unlink $path1;
>If I open a file using this code segment ...
>
>open (FILE, "+<filename")
what the FAQ fails to mention that open to read and write at the same time
permits only that you keep the file size the same if you change its
contents. that's hard to do unless you initially set up each line in your
file with a fixed length, as you would in a database with fields filled up
with junk if there's no data for the field to keep the lines regular.
otherwise, if the data you're updating changes the file size, you'll need to
do the 2-file, one to read, one to write method.
>once the file has been read, how do I ensure the file is emptied
>before the array is written back (step 6)
to empty a file but keep it hanging around for later use, do something to
the effect:
open (FILE1, ">$path1)
|| die("oopsies");
close(FILE1);
opening to write automatically gives you a fresh file. hope that helped. i'm
still learning myself... for more info, see any module at CPAN beginning
with 'File'.
cheers,
ha quach
mailto:info@r-go.com
------------------------------
Date: Mon, 10 Aug 1998 22:24:59 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: having trouble with printing array to html
Message-Id: <6qo9dl$m1p$1@holly.prod.itd.eartllink.net>
in addition to -w, -V, and other stuff the other gents mentioned, perhaps
these will help:
Sara Rosso wrote in message <35CF5559.5723@rsn.hp.com>...
>I am trying to convert text submitted by a form into a bulleted list.
>Since the number of bullets will vary from submission to submission, I
>decided the easiest way would be to use a textarea, and separate the
>list items by a semi-colon.
1) make sure you have something to handle your delimiter. a semicolon is
iffy. set semicolon to a variable name and use that variable instead of
literal string semicolon
$delim = ';';
>The input should go from:
>number one; number two; number 3; this is item number four
>
>to(for practical purposes, I will use a o as a bullet):
>o number one
>o number two
>o number three
>o this is item number four
>
>This is the html referencing the textarea:
><textarea name="deliverables" wrap=virtual cols=55 rows=8></textarea>
>
>This is the perl I have - no errors appear when compiled:
>
>open(pdstemp, ">/itsrc/apache/htdocs/projects/temp/$pid.html");
>print pdstemp "<ul>\n";
>@delivarray = split(/;/, $deliverables);
>foreach $line (@delivarray) {
>print pdstemp "<li>$line\n";
>}
>print pdstemp "</ul>\n";
>close pdstemp;
2) try using normal syntax for filehandle in all caps.
3) do all your array manipulation *before* you open file. that's just good
habit.
4) i'm guessing that the value part of the form's name-value pair is handled
in another subroutine that stores them in a hash. for example, if you have a
hash called %in wherein $key is the name and $in{$key} is the value and
$in{'deliverables'} will be the value for your textarea tag named
'deliverables', you'll have to a split on $in{'deliverables'} rather than
the bare $deliverables variable you have in your code example. as it is,
$deliverables is a fresh variable with an empty value.
5) but even before you do the split, i assume you have a chunck of code to
handle the textarea wrap. instead of virtual, i recommend wrap=hard. this
will keep the \r\n. you can do either a for count or an 'items' in array
foreach. here's a for. you may also want to assign the printed stuff to a
variable rather than printing it to file directly; for some reason, this is
nicer on Perl.
$in{'deliverables'} =~ s/\r\n/$delim/;
@stuff = split(/$delim/, $in{'deliverables'});
$towrite = "<ul>\n";
for $i (0 .. $#stuff)
{
$towrite .= "<li>$stuff[$i]\n";
}
$towrite .= "</ul>";
open (PDSTEMP, ">/itsrc/apache/htdocs/projects/temp/$pid.html")
|| print "no can do opening PDSTEMP";
print PDSTEMP $towrite;
close(PDSTEMP);
6) make sure your html output has the proper ending tags </body></html>,
otherwise you won't see anything from the latest output. as a long shot, if
your stuff in a table, you won't see the output if you don't close your
table tags properly.
er, post similar questions to comp.infosystems.www.authoring.cgi next time.
cheers,
ha quach
mailto:info@r-go.com
>
>When I go to view the file online, other html is there that I reference
>earlier in the perl, but there is no list. (This list is part of a
>larger on-the-fly generated html document.)
>
>Please give me any insight you have on this matter. Is there an easier
>way to do this?
>
>Thanks in advance.
>Sara Rosso
------------------------------
Date: Tue, 11 Aug 1998 01:00:33 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: is the ActiveState Perl win32 broken or am I???
Message-Id: <6qoj78$f8d$1@birch.prod.itd.earthlink.net>
ok, this is the code ---
binmode(STDIN);binmode(STDOUT);binmode(STDERR);
while($this_much = read STDIN, $buffer, 1024)
{
print $buffer;
}
this code works on the LM and GS ports 5.004_02 (and any UN*X Perl), but the
ActiveState [ 5.003_7(build 316) or 5.005 ] ports will *NOT* run the above
code.
is my code *marginally* proper, or are the ActiveState builds broken?
any ideas of a workaround?
tia,
brent
------------------------------
Date: Tue, 11 Aug 1998 00:50:55 -0400
From: Leon Stepanian <info@purco.qc.ca>
Subject: Is there a maximum recommended file size for Perl Scripts
Message-Id: <35CFCDAF.5AD4FE26@purco.qc.ca>
Hi;
Just a small question. My perl script is now 192K and includes lots of
sub_routines,
internal html prints, several file logging, updating and retreiving
sub_routines, along with a access code tracing system to make sure all
generated pages and actions are not activated via pages which were
bookmarked.
Since everything is in the same file xxxx.pl, are there any negative
ramifications when multiple users are on the system? In general, if this
same Perl script was split into about 10-15 smaller scripts, would it
function more efficiently, since I assume I would need extra code to
identity the files, open them, execute and close, etc. But on the other
hand, users could access a launching script then go to different perl
files for their functions, thus freeing additional calls to the one file
system.
Any comments would be appreciated.
Leon Stepanian
------------------------------
Date: Tue, 11 Aug 1998 14:17:19 +0900
From: Nakajima Yasue <sue@geocities.co.jp>
Subject: Re: japanese character searches of flatfile db's
Message-Id: <35CFD3DF.E4561912@geocities.co.jp>
I heard There was an extended version of perl called 'jperl' which worked the
same as the original perl and the only difference was jperl could handle Japanese
characters. I'm sorry I don't know the current version.
Anyway please try to get some more information at fj.comp.lang.perl. fj.xx is a
news group for Japanese.
Yasue
tbond@ideapro.com wrote:
> I have a Perl program that allows people to register themselves for access to
> a searchable database of downloadable files. After becoming a registered
> user, they can later login anytime for access to our file library, then
> search for a file by it's name. Then they are presented with a simple html
> page in their browser that's a hyper link built on the fly by the program
> that lets them download the linked file (as long as their "session id" is
> alive). Everything works smoothly in English. Only registered users can
> download the files.
>
> Question is, my client wants to convert this over so that it works for
> Japanese users. They would enter their names in Japanese using their
> Japanese keyboards, and the file names in the downloadable database would be
> kept in Japanese. So, here is the issue -- will the registered clients be
> able to login and search the database using these non-English characters? A
> search might look like this:
>
> IeIX*`;b*CJ'o
>
>
> ...which is unintelligiable in English, of course. Unfortunately, I don't
> understand Japanese, and have no access to Japanese keyboards. I know that
> Perl uses many "ASCII" type general expressions that may be a problem, and
> makes many assumptions about text and characters. However, if I just want to
> do simple comparisons in the database for EXACT MATCHES, shouldn't this be
> possible? I want the CONTENTS of the databases to be irrelevant to the way
> the program works for me, if you see what I mean. Is this possible?
>
> What problems might I face, and is there anyone who knows of a Perl resource
> where these issues are explored?
>
> (Note: the database will be a standard flatfile database of usernames and
> passwords, and the file database will be a simple list of exact file names,
> delimited by "|" symbols)
>
> Thanks very much for your help!
>
> -- Tom Bond
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 10 Aug 1998 22:09:19 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Perl 5.005 and Linux: make test
Message-Id: <35CFB5DF.56A83DDE@gpu.srv.ualberta.ca>
thestranger@my-dejanews.com wrote:
>
> Hi:
>
> Though 5.005 seemed to compile ok, I got most of the tests under /t/lib failed
> with references to DynaLoader.
>
> Someone suggested that perhaps gcc 2.7.2.1 is not ok. Any other Linux people
> encounter this?
5.005_01 and now 5.005_02 compiled on my linux with gcc 2.7.2.1 ... all
tests passed out of the box --- usethreads not enabled. What was your
configuration?
regards
andrew
------------------------------
Date: Mon, 10 Aug 1998 20:18:24 -0700
From: Sergio Antoy <antoy@cs.pdx.edu>
To: jweisgram@hotmail.com
Subject: Re: PERLDOC for Win32 ??
Message-Id: <35CFB800.54CB3A26@cs.pdx.edu>
Jim Weisgram wrote:
>
> Charles Maier <maierc@chesco.com> wrote:
>
> >dturley@pobox.com wrote:
> >>
> >> In article <35C81B5A.A504ACC6@chesco.com>,
> >> maierc@chesco.com wrote:
> >> > Is there no perdoc executable for the Win32 port of Perl??
> >>
> >> Get the GS binary dist:
> >>
> >> http://www.perl.com/CPAN-local/ports/win32/Standard/x86
> >> /perl5.00402-bindist04-bc.tar.gz
File Not Found
The requested URL
/CPAN-local/ports/win32/Standard/x86/perl5.00402-bindist04-bc
was not found on this server.
> >
> >
> >LOL... a "tar.gz" binary release for a Win32 executable?
> >
> >Thanks.. I will try to get it from there.
>
> Winzip handles it just fine. I expect other modern unzippers will also.
> --
> All opinions expressed are mine and not my employers (but they ought to be)
> Jim Weisgram
> Oregon Department of Transportation
Sergio
--------------------------------
Sergio Antoy
Dept. of Computer Science
Portland State University
P.O.Box 751
Portland, OR 97207
voice +1 (503) 725-3009
fax +1 (503) 725-3211
internet antoy@cs.pdx.edu
WWW http://www.cs.pdx.edu/~antoy
--------------------------------
------------------------------
Date: 11 Aug 1998 00:32:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <x73eb45eah.fsf@sysarch.com>
--text follows this line--
>>>>> "NVP" == Nathan V Patwardhan <nvp@shore.net> writes:
NVP> Uri Guttman (uri@sysarch.com) wrote: : and control. winblows is
NVP> just what i call it. sneeze and reboot!
NVP> Inferior "OS" or not, blanket trashing of said product also
^^^^^^^^ ^^^^
how true note the quotes. must not be an OS after all :-)
NVP> insults the work that a number of people have done to (1) create
NVP> a complete Perl distribution for the win32 crowd, (2) merge the
NVP> AS code with the core distribution, and (3) build
NVP> fully-functional, Unix-like tools for said environment (like
NVP> Cygwin, mingw32, U/WIN, etc).
i don't insult the work done by perl types. i insult redmond and the
spineless management POBs who made such crap a requirement that perl
types must create so much work to make it minimally functional. and you
still have to reboot after sneezing! even perl can't fix the respiratory
illnesses in winblows.
i will let tom c. continue, as he flames POB systems much better than i can.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 10 Aug 1998 23:50:45 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: printing remote host
Message-Id: <6qoeee$3eq$1@holly.prod.itd.earthlink.net>
er, despite what the other fella has to say in response, if it really is a
response...
Thomas Emery wrote in message <35CDCCCC.F21688DC@crocker.com>...
>I have a message board (and the people) want to list all poster's IP
>address.
Assuming it is YOU who want to list the PEOPLE's ip address, use Perl's
built-in %ENV.
$ENV{'REMOTE_ADDR'}
will yield the person's ip address. a quick script to check all the common
env vars:
while (($key, $val) = each(%ENV))
{
print "\$ENV{'$key'} = $val<BR>\n";
}
there is a barebones example of environment variables at our site:
http://r-go.com/cgi-bin/lib/show-env.cgi for GET and POST. alternately, you
can do this with SSI. a tutorial on SSI is at
http://r-go.com/support/manuals/diesel.shtml.
>I am assuming that it is as simple as finding the file that
>right now generates the messages and put in a line that says something
>like print Remote_Host or something like that.
what 'file' are you referring to? the one you want to write the env var to
or the person's postings? remember, most everyone has a dynamic ip address.
fetching the person's posting from a datafile using their ip is NOT going to
do the trick (ignore that remark if this has nothing to do with what you
want to do). you might want to use cookies instead.
for similar questions, please post to comp.infosystems.www.authoring.cgi in
the future.
cheers,
ha quach
mailto:info@r-go.com
------------------------------
Date: Tue, 11 Aug 1998 03:15:05 GMT
From: "John Clinton" <clinton@REMOVETHIS.dt.wdc.com>
Subject: Re: sorting hash by values
Message-Id: <ZGOz1.175974$Ye6.19001708@news.rdc2.occa.home.com>
If you only have a small handful of entries in your hash then the
solutions other give can work fine, but they are very inefficient.
Often you must create a data structure (like this hash) with a mind for
your special needs. I often create a hash where the value part is a
reference to a list and sometimes have the key value ALSO be a member of
that value list. In effect I would have:
%hash = ( fred => ['fred', 1, "a"],
sue => ['sue', 8, "m" ]
);
Then I can sort fairly quickly as:
foreach $entry (sort { $a->[1] cmp $b->[1] } values %hash)
{
print "$entry->[0] : $entry->[1]\n";
}
For many of my uses of Perl I need to have a hash of references to lists
anyway so having the hash's key be another entry in the list is a minor
price to pay. In effect you have a bunch of records that you want to keep
in a list to sort, etc. but you also need a hash to permit fast lookups --
so have both.
------------------------------
Date: Tue, 11 Aug 1998 00:31:40 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: SSI Perl Script
Message-Id: <6qogr4$920$1@holly.prod.itd.earthlink.net>
Victor Szilagyi wrote in message <35CF043B.CD21067D@hrmarketing.com>...
>I have a SSI script for a random image displayer.
what the heck is an SSI script? did you know this newsgroup is for Perl? do
you mean a CGI script that's passed as
<!--#exec cgi="/cgi-bin/myscript.cgi/" -->
??
> I want to test the
>script out before I actually post it. Can anyone recommend a free
>utility to do this??
huh? what kind of a question is this? if you want to execute a Perl script
via the SSI exec tag, just DO IT! create test.shtml and stick the tag in
there. when you're done testing, change test.shtml to the name of the page
you want the public to view.
for the future, please post similar questions to
comp.infosystems.www.authoring.cgi. this is just a friendly reminder because
there are nasty flamers here, especially if you're a newbie. hope that
DIDN'T help!
cheers,
ha quach
mailto:info@r-go.com
------------------------------
Date: Tue, 11 Aug 1998 00:47:56 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: String comparison problem
Message-Id: <6qohpk$as3$1@holly.prod.itd.earthlink.net>
Mark Conlin wrote in message <6qmrep$348@catapult.gatech.edu>...
>
>Okay, I am trying to see if two strings are equal
>
>so my code says
>
>if ($submit{'orginal'} eq
me){
>
>this was not working so I decided to print the two strings to see
>what was going on so
>
>print OUTFILE "org = $submit{'original'}\n";
>print OUTFILE "current = $name \n";
>if ($submit{'orginal'} eq $name){
everything looks fine. perhaps there's something in your if block that's messing things up. make sure you're getting to the if loop, that you're inside it, and at any time you doubt that the previous manipulation isn't working, print yourself a message:
print "hello to myself before the if block<br>\n";
if ($submit{'original'} eq $name)
{
print "hello to myself from inside the if block<br>\n";
# [ stuff i want to do #1] ...
print "hello from stuff 1... we're still okay<br>\n";
# [ stuff n... , print "n" and so on...]
}
else
{
print "ouch! we never made it to the if block!!! wah!!";
}
>
>now they appear to be the same, here is an exact cut from the output
>
>org = Phyllis Kingston
>current = Phyllis Kingston
>
>Okay I know what you thinking, some kind of special character at the end?
>so I chop them and get this
>
>org = Phyllis Kingsto
>current = Phyllis Kingsto
how about a character at the beginning? um, if you're using your browser for output, look at the page's source code. try these tricks:
1) pad the string to denote string bonderies:
$original = '#' . $submit{'original'} . '#';
$current = '#' . $name . '#';
print "original = $original\n";
print "current = $current\n";
does this yield a match on output?:
#Phyllis Kingston#
2) try suspect extra spaces between first name and last name:
$submit{'original'} =~ s/\W/#/g;
does this yield the pound sign wherever there's a nonword character?
Phyllis#Kingston
3) try case-insensi
tivity
if ($submit{'original'} =~ /$name/i)
{
}
well, i'm out of ideas.
cheers,
ha quach
mailto:info@r-go.com
NOTE: remove underscores in email address to respond.
>
>What else could be going on here ?
>
>thanks
>Mark Conlin
>
>
>--
>mec --gt2863a
>
------------------------------
Date: 10 Aug 1998 23:49:33 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: cberry@cinenet.net (Craig Berry)
Subject: Re: Test Results - Asking a question
Message-Id: <af5cunqa.fsf@mailhost.panix.com>
cberry@cinenet.net (Craig Berry) writes:
> At least until some postulated future time when most people claim to have
> read the docs, that claim will make a valid pre-filter for good intent.
Hey, everybody! I've read the docs, but they really suck!!! I was
wondering, how do I...
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 11 Aug 1998 03:30:42 GMT
From: cselton@hkp.hk (cs - Elton Kong)
Subject: Using variable in TR
Message-Id: <6qodt2$ii13@hkpa05.polyu.edu.hk>
Hi!
I want to use a variable's value in the tr operator. Below is my
test code:
$m = 'abc';
$n = 'xyz';
$o = 'a1b2c3';
$o =~ tr/$m/$n/;
print $o, "\n";
What I would like to do is to store the source characters and
replacement characters in 2 variables, and then do the translation
using these 2 variables. However the above code doesn't work.
Could anyone help?
TIA,
Elton
--
-|-
.-'~~~`-. IN MEMORY OF..
.' `.
| R I P | Elton Kong
| | mailto:cselton@polyu.edu.hk
| | http://www.acad.polyu.edu.hk/~cselton/
\\| |//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
------------------------------
Date: Mon, 10 Aug 1998 23:57:07 -0400
From: Pat Gunn <pgunn01@ibm.net>
Subject: Re: What is the purpose of Perl
Message-Id: <35CFC113.1E1F@ibm.net>
Uri Guttman wrote:
>
> >>>>> "IRAA" == I R A Aggie <fl_aggie@thepentagon.com> writes:
>
> IRAA> Forgive my presumption here, I only have a vague notion of what
> IRAA> forking does, but wouldn't this give you _parallel_ universes?
>
> IRAA> James - I don't think the data space is shared...
>
> actually the data and code spaces are shared.
>
> and what definition of universe are you using? if it means the entire
> system, then you have to copy the OS, etc., not just fork a process.
>
> you have to do something like (untested :-)
>
> dd if=/dev/kmem of=??
No no no no. Not /dev/kmem. Silly. You do an "init s", and then
a "dd if=/dev/mda of=/dev/mdb", and then "reboot". The original
USys is still running the original universe, and you can connect
mdb to another USys and have your parallel universe. If you have a
MSys, you can be running multiple universes on a single box, allowing
them to share data and rulesets. Indeed, this is very useful if you
want to do quantum tracing to monitor system performance, and allows
for quick uptime if for some odd reason one copy crashes.
--
---------------------------------------------------
Pat Gunn, moderator:comp.sys.newton.announce
comoderator:comp.os.os2.moderated
"You can always judge a man by the quality of his enemies." -- Dr Who
http://junior.apk.net/~qc
------------------------------------------------
------------------------------
Date: Tue, 11 Aug 1998 00:22:56 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: what is this stuff?
Message-Id: <6qogap$80u$1@holly.prod.itd.earthlink.net>
look around for a good source on translating hexadicemal characters. i'm
sure there's even a module somewhere to convert these.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3414
**************************************