[17655] in Perl-Users-Digest
Perl-Users Digest, Issue: 5075 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 10 11:05:31 2000
Date: Sun, 10 Dec 2000 08:05:08 -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: <976464307-v9-i5075@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 10 Dec 2000 Volume: 9 Number: 5075
Today's topics:
appending to the begining of a file in PERL mmustafa@my-deja.com
Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht <wc@england.uk>
Re: CGI.pm and uploadInfo() (Adam)
Re: compiling scripts with Active State perl (Tim Hammerquist)
I want 3 guests/row instead of one. Must change RE and <fabianos@telia.com>
IO::Select::select not blocking on a filehandle <freddie@ns1.nowait.net>
Re: IO::Select::select not blocking on a filehandle (Chris Fedde)
Re: Lured by JSP. Limited study time. Need guru to argu <mikecook@cigarpool.com>
Re: lwp <dsdf@sdfd.com>
networking... <rucus20@hotmail.com>
Re: networking... (Martien Verbruggen)
Newbie problem reg. activeperl <rajeshpm@emirates.net.ae>
Reading first 5 lines data <blnukem@hotmail.com>
Re: Reading first 5 lines data <joe+usenet@sunstarsys.com>
Re: Reading from a file (Tad McClellan)
Re: Reading from a file <bwalton@rochester.rr.com>
Re: Shared Memory (Adam)
Shift & Reload with LWP::UserAgent andyga9931@my-deja.com
Tie hash of hash using MLDBM debjit@my-deja.com
Re: Trouble making use of 'eval' to prevent fatal divis <bwalton@rochester.rr.com>
Re: Trouble making use of 'eval' to prevent fatal divis (Tad McClellan)
who know that Unicode -> Ascii convert... in perl CGI <yabarahi@robotics.sejong.ac.kr>
Re: Why doesn't this work????? (Location: redirection. me
Re: Why isn't Perl highly orthogonal? <brian+usenet@smithrenaud.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 10 Dec 2000 15:28:42 GMT
From: mmustafa@my-deja.com
Subject: appending to the begining of a file in PERL
Message-Id: <9107f6$ef1$1@nnrp1.deja.com>
Does anyone know how to append to the begining of a file in PERL? I
know that to append to a file , you use '>>'. This appends to the end
of the file.
Please let me know if there is a way to append to the begining of the
file.
Thanks
Farooq
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 12:50:32 +0100
From: Winston <wc@england.uk>
Subject: Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht
Message-Id: <3A336E08.4B88B56F@england.uk>
Hello Adolf,
Please use english so that we can understand, else post in
de.comp.lang.perl.misc or de.comp.lang.perl.cgi
Beatforge wrote:
>
> Hallo, ich suche dringenst jemanden, der gegen Bezahlung ein paar
> Seiten implementieren kann.
>
> 1. Eine Html-Seite, die auch lokal auf dem Rechner gespeichert wird,
> und mit der man registrationslos Emails verschicken kann.
> Die Emails haben dann einen bestimmten festen Absender und man kann
> auch Attachments damit verschicken.
> Auch einzutragen sind: Betreff, Body und variabler Werbefooter.
> Das dürfte ja nicht so schwierig sein??
>
> Auch wünschenswert wären leicht zu administrierbare Foren,
> Gästebücher,
> Mailempfehlungen (mail this page to a friend usw.)
>
> Das ganze wäre für das Projekt Null Grad Celsius.
>
> Hier die URL: www.nullgradcelsius.de
>
> Angebote bitte nur per Email an elmar@nullgradcelsius.de
>
> P.S. Sorry wegen dem Absendernamen dieser MSG.
------------------------------
Date: Sun, 10 Dec 2000 13:55:42 GMT
From: adamf@box43.gnet.pl (Adam)
Subject: Re: CGI.pm and uploadInfo()
Message-Id: <3a338a90.10264953@nntp.lucent.com>
On Sun, 10 Dec 2000 00:23:49 +0000 (GMT), Geoff Soper
<g.soper@soundhouse.co.uk> wrote:
>Using the CGI.pm module I can call uploadInfo() which will return 'a
>reference to an associative array containing all the document headers.' I
>want to access the 'Content-Type' value.
>
>I thought I could do:
> %upload_info = uploadInfo($upload_name);
> $type = $upload_info{'Content-Type'};
>
>But this doesn't seem to work. I'm guessing this is because of my lack of
>understanding of references. Could somebody explain where I've gone wrong
>and how I should go about this?
uploadInfo($upload_name) returns a refference to a hash, so this...
$type = uploadInfo($upload_name)->{'Content-Type'};
... should work.
documentation to read:
# perldoc perlref
# perldoc CGI
--
Adam.
------------------------------
Date: Sun, 10 Dec 2000 11:53:34 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: compiling scripts with Active State perl
Message-Id: <slrn936rq3.uo.tim@degree.ath.cx>
Stephen Patterson <spam@s.patterson.freeuk.com> wrote:
> >I'd just like to wish you luck in finding a free/GPL Perl compiler on the
> >Win32 platform. All the solutions I've heard about involve changing
> >either your price range or your platform.
>
> Which solutions would these be then?
Since others have mentioned the alternate price range solutions, the
free/GPL compile options are limited to those systems which have a
compatible gcc compiler. And since just about every gcc compiler I've
seen for the Win32 platform costs $$, the best alternative is a *nix
platform such as *BSD or linux.
--
-Tim Hammerquist <timmy@cpan.org>
Just because my fingers are in my ears doesn't mean I'm ignoring you.
-- Larry Wall
------------------------------
Date: Sun, 10 Dec 2000 11:13:19 GMT
From: "Fabian" <fabianos@telia.com>
Subject: I want 3 guests/row instead of one. Must change RE and setting up rows and collumns i outfile.
Message-Id: <jzJY5.2914$O%.458497@newsc.telia.net>
I like to change this script to display the output.
In regular guestbooksscripts there is a new guest/row.
I want 3 guests/row.
Is it possible.
Can i anyone help me?
Fabian
open (FILE,"$guest") || die "Can't Open $guest: $!\n";
@LINES=<FILE>;
close(FILE);
$SIZE=@LINES;
# Open Link File to Output
open (GUEST,">$guest") || die "Can't Open $guest: $!\n";
for ($i=0;$i<=$SIZE;$i++) {
$_=$LINES[$i];
if (/<!--begin-->/)
{
print GUEST "<!--begin-->\n" ;
}
if ( $FORM{'post'}){
if ($linkmail eq '1') {
print GUEST "
$FORM{'foretag'}<br>$FORM{'realname'}<br>$FORM{'adress'}<br>$FORM{'post'}<br
><br>" ;
}
}
if ($entry_order eq '0') {
print GUEST "<!--begin-->\n";
}
}
else {
print GUEST $_;
}
}
close (GUEST);
------------------------------
Date: Sun, 10 Dec 2000 20:42:46 +1030
From: Freddie <freddie@ns1.nowait.net>
Subject: IO::Select::select not blocking on a filehandle
Message-Id: <9ll63tge5qatg3b5rkfih4dgnr7gtsvuee@4ax.com>
Hi,
I seem to be having a rather annoying problem with
IO::Select::select... here's some code:
sub main_loop {
open(LOG, "< $c{'logfile'}") || die $!;
seek(LOG, 0, 2);
my $logfh = \*LOG;
my $read_set = new IO::Select();
$read_set->add($conn);
$read_set->add($logfh);
my @ready;
while (1) {
my ($rh_set) = IO::Select::select($read_set, undef,
undef);
foreach my $fh (@$rh_set) {
$logfh is ALWAYS in @$rh_set, so the select call is always returning
straight away, making a nice spinlock = 100% CPU usage :-( I've tried
it with can_read() too, same problem... anyone have any ideas?
Freddie
(cc: to my e-mail address please)
------------------------------
Date: Sun, 10 Dec 2000 15:58:51 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: IO::Select::select not blocking on a filehandle
Message-Id: <%KNY5.109$B9.188721664@news.frii.net>
Keywords: freddie@ns1.nowait.net
[A courtisy cc was sent to the author]
In article <9ll63tge5qatg3b5rkfih4dgnr7gtsvuee@4ax.com>,
Freddie <freddie@ns1.nowait.net> wrote:
>Hi,
>
>I seem to be having a rather annoying problem with
>IO::Select::select... here's some code:
>
>sub main_loop {
> open(LOG, "< $c{'logfile'}") || die $!;
> seek(LOG, 0, 2);
>
> my $logfh = \*LOG;
>
> my $read_set = new IO::Select();
> $read_set->add($conn);
> $read_set->add($logfh);
>
> my @ready;
> while (1) {
> my ($rh_set) = IO::Select::select($read_set, undef,
>undef);
>
> foreach my $fh (@$rh_set) {
>
>
>$logfh is ALWAYS in @$rh_set, so the select call is always returning
>straight away, making a nice spinlock = 100% CPU usage :-( I've tried
>it with can_read() too, same problem... anyone have any ideas?
>
>Freddie
>
This bit workes for me...
#!/usr/bin/perl
use strict;
use warnings;
use IO::Select;
use IO::File;
my $f = IO::File->new("one") or die "can't open 'one': $!";
my $g = IO::File->new("two") or die "can't open 'two': $!";
my $s = new IO::Select();
$s->add($f);
$s->add($g);
while (1) {
my @r = $s->can_read();
for (@r) {
print STDOUT <$_>;
}
}
--
This space intentionally left blank
------------------------------
Date: Sat, 9 Dec 2000 22:42:16 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Re: Lured by JSP. Limited study time. Need guru to argue Perl's advantages
Message-Id: <VJEY5.4287$iZ5.647079@news.uswest.net>
As to JSP I can't speak authoritatively - however, (in my experience, at a
30,000 foot fly-over) in a nutshell:
Perl is fast - Java is slow.
Michael
--
== CigarPool ==
http://www.cigarpool.com
"Garry Heaton" <garry@heaton6.freeserve.co.uk> wrote in message
news:90u8ji$cvk$1@newsg2.svr.pol.co.uk...
> I have started learning Perl and really like the language but I have also
> begun studying the Java Server Pages and have had some good results with
> database-access scripts. Much longer-winded syntax but full access to the
> extensive Java API. As I only have limited study time available and need
to
> learn 1 programming language thoroughly instead of dabbling in 2, I am
faced
> with the difficult choice of maybe dropping my Perl studies simply because
> everywhere I hear about the advantages of the Java/JSP approach
> (scalability, server resources, servlet advantages etc.) Haven't heard
much
> in defence of Perl's advantages over Java. Is there a Perl guru out there
> who can put a good case for choosing Perl over the new JSP technology?
>
> I don't want to be political about it. This is a really serious dilemma
I'm
> facing as my study time is now limited as a result of new commitments.
>
> Thanks
>
> Garry Heaton
>
>
>
>
>
------------------------------
Date: Sun, 10 Dec 2000 12:46:08 +0100
From: "matteo" <dsdf@sdfd.com>
Subject: Re: lwp
Message-Id: <3a3366a9@post.usenet.com>
**** Post for FREE via your newsreader at post.usenet.com ****
try to use a4proxy to see what urls are loaded
"Enrico Ng" <ng@fnmail.com> ha scritto nel messaggio
news:90u74i$c12$1@info1.fnal.gov...
> I dont know if this is possible, but I want to make a script that will
login
> to my online bank acount and display my balance.
> the problem is that the form that is used to login is a asp script.
> I tryed just putting ?usename=enricong&password=...
> but that didnt work.
>
> any ideas?
>
> --
> Enrico Ng <ng@fnmail.com>
>
>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: Sun, 10 Dec 2000 00:18:20 -0800
From: "Rucus20" <rucus20@hotmail.com>
Subject: networking...
Message-Id: <t364mhe6lc9r78@corp.supernews.com>
Hey I would like to know if any one could write a perl program for linux
(RedHat 5.xx) that i could run on my LAN
if must comply with these rules:
1. Free Source Code
2. Command Line & Web Interface.
3. Personal Screennames.
4. Chat like Environment.
5. Easy access Menu(s)
1. To Block Users.
2. Send File(s)
3. Internet Connectivity (DSL, Dialup)
6. Somewhat Visually Pleasing.
7. Able to put on a web site (For Free Downloading)
8. Easily readable Config File ------> So I could do Private stuff
I Plan to use this for exchange through the company infrastructure and hope
you all could help me out. I would like it to NOT USE external programs like
SENDMAIL. Thank You.
Contact me with stats and Info at rucus20@hotmail.com
------------------------------
Date: Sun, 10 Dec 2000 20:51:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: networking...
Message-Id: <slrn936kgv.20m.mgjv@martien.heliotrope.home>
On Sun, 10 Dec 2000 00:18:20 -0800,
Rucus20 <rucus20@hotmail.com> wrote:
> Hey I would like to know if any one could write a perl program for linux
> (RedHat 5.xx) that i could run on my LAN
Many people have already written large amounts of perl programs that run
on Linux, as well as on many other systems. So, yes, someone could, and
did.
> if must comply with these rules:
>
> 1. Free Source Code
Lots of those around.
> 2. Command Line & Web Interface.
Seen those, yes.
> 3. Personal Screennames.
What?
> 4. Chat like Environment.
> 5. Easy access Menu(s)
> 1. To Block Users.
> 2. Send File(s)
> 3. Internet Connectivity (DSL, Dialup)
> 6. Somewhat Visually Pleasing.
> 7. Able to put on a web site (For Free Downloading)
> 8. Easily readable Config File ------> So I could do Private stuff
You seem to be very confused. You talk about a Web application as well
as dial-up and DSL. Are you really asking for a rather large web-based
application, or are you talking about a complete environment that
handles modems, PPP and the lot?
And do you really believe you can get someone else to write code that
you then magnanimously can 'give away' for free by download?
> I Plan to use this for exchange through the company infrastructure and hope
> you all could help me out. I would like it to NOT USE external programs like
> SENDMAIL. Thank You.
I am stunned. You are seriously asking people to take on a project that
on first sight looks like at least a week of solid work, but probably
more than that, and then to give all their results to you, for free?
And you put restrictions on it as well?
Are you from Mars?
> Contact me with stats and Info at rucus20@hotmail.com
I'd contact you with a clue by four, but it's just not worth it. Thanks
for immediately identifying yourself as killfile-fodder.
Martien
--
Martien Verbruggen |
Interactive Media Division | life ain't fair, but the root
Commercial Dynamics Pty. Ltd. | password helps. -- BOFH
NSW, Australia |
------------------------------
Date: Sun, 10 Dec 2000 11:23:13 +0400
From: "rajeshpm" <rajeshpm@emirates.net.ae>
Subject: Newbie problem reg. activeperl
Message-Id: <90vb07$oni2@news.emirates.net.ae>
I have installed ActivePerl 5.6 on my computer. I have windows98.
When i double click it on windows explorer it gives a message saying that
the version of windows i am using is not compatible.
So what do i do ? is there a solution to this.?
Can somebody help.
Thanks
regards
vidya
------------------------------
Date: Sun, 10 Dec 2000 09:19:01 -0500
From: "K6" <blnukem@hotmail.com>
Subject: Reading first 5 lines data
Message-Id: <9103tq$t2e$1@news.monmouth.com>
Hi All
I need help reading the first lines data from a flat file. What I want to
accomplish is to only return the first five data strings and then return the
next five after that with a link on the bottom. If you have an example of
this type of function please post.
Thanx K6
------------------------------
Date: 10 Dec 2000 10:34:25 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Reading first 5 lines data
Message-Id: <m33dfwjnni.fsf@mumonkan.sunstarsys.com>
"K6" <blnukem@hotmail.com> writes:
> Hi All
>
> I need help reading the first lines data from a flat file. What I want to
> accomplish is to only return the first five data strings and then return the
> next five after that with a link on the bottom. If you have an example of
> this type of function please post.
Actually, the code you wrote works fine. Check it again.
If it's still not working, post the segment that's broken
along with perl -w 's error messages (also use strict).
Some sample data might also help.
You could also check
% perldoc -f open
% perldoc -f readline
% perldoc -q lines
% perldoc -f close
--
Joe Schaefer
------------------------------
Date: Sat, 9 Dec 2000 22:26:59 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Reading from a file
Message-Id: <slrn9361gj.u2.tadmc@maxim.metronet.com>
peterkelley@my-deja.com <peterkelley@my-deja.com> wrote:
>Before I start - I'm a newbie.
Errr, yes. Everybody is a newbie before they start. It is only
after you have started that you can advance beyond that. heh.
Your first step (even before posting to Usenet) should be
to find out where the standard Perl docs got installed when
you installed perl.
You can use the 'perldoc' program that was also installed when
you installed perl to access the docs. To learn how to use
perldoc, type:
perldoc perldoc
>How do I read data from a file
You can look up Perl functions with the -f switch:
perldoc -f open
That is clpmisc talk for "read about the open() function in perlfunc.pod".
>and put it into a hash?
Perl's data types are described in perldata.pod
perldoc perldata
>I 'm trying to create
>a currency calculator that will read the currency type and rate from a file.
A hash would be great for that.
There is example code in the standard docs too.
>Secondly, can I have a hash with one key and multiple values?
Yes. But you'll need to do yet more reading. You need to know
about Perl's references.
perldoc perlreftut
perldoc perlref
But using references is probably something you should put off for
a while when first learning Perl.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 10 Dec 2000 05:18:30 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Reading from a file
Message-Id: <3A3312C8.267DE653@rochester.rr.com>
peterkelley@my-deja.com wrote:
>
> Before I start - I'm a newbie.
>
> How do I read data from a file and put it into a hash? I 'm trying to create
> a currency calculator that will read the currency type and rate from a file.
That's pretty simple:
while(<>){
chomp;
($type,$rate)=split / /; #split on whitespace
$hash{$type}=$rate;
}
>
> Secondly, can I have a hash with one key and multiple values? For example, I
> would like to have a file containing a product ID with values like price,
> description, etc. Can I do that? How do I access those values later in the
> program? For example, how do I pull out the price of a particular product
> ID?
One approach would be to simply use multiple hashes, one for each value
you want to store. Another approach would be to store a reference to an
array which holds the multiple values as the value of each hash key.
Like:
$hash{$key}=[$value1,$value2,$value3];
To access a given value later:
$val=$hash{$key}[1];
to get $value2 back, for example. Please read:
perldoc perldsc
>
> Help would be appreciated!
>
> pk
...
--
Bob Walton
------------------------------
Date: Sun, 10 Dec 2000 13:33:54 GMT
From: adamf@box43.gnet.pl (Adam)
Subject: Re: Shared Memory
Message-Id: <3a338607.9103241@nntp.lucent.com>
On Sat, 09 Dec 2000 20:52:31 GMT, "Cary" <caryz@hotmail.com> wrote:
>Greetings. I have cgi program which requires a big hash table. Is there any
>resources(better yet, example codes) on shared memory where all my cgi
>scripts can read in this hash table from a shared memory?
the Storable module from CPAN could help you.
--
Adam.
------------------------------
Date: Sun, 10 Dec 2000 13:41:51 GMT
From: andyga9931@my-deja.com
Subject: Shift & Reload with LWP::UserAgent
Message-Id: <91016v$aa3$1@nnrp1.deja.com>
Hi all,
I guess the most of you knwo what the most browsers do when you press RELOAD
with the shift key held down. They force the proxy server to download the
file again even if it is in the cache.
I need to know if this can be done by LWP::UserAgent too. Any Ideas ?
Greetings
Andy
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 13:41:55 GMT
From: debjit@my-deja.com
Subject: Tie hash of hash using MLDBM
Message-Id: <910173$aa5$1@nnrp1.deja.com>
I'm facing problem in tie a has of hash to disk file.
snip
use MLDBM qw(DB_File Storable);
tie %HoH, 'MLDBM', 'mldbm_file', O_CREAT|O_RDWR, 0640;
....
Read from text file: $name $value1 $value2
$HoH{name}{value1} = value2;
___
If I read the 'mldbm_file' only keys come not values,
BUT if I assign like
%HoH = (
name1 => { val1 => val2, val3 => val4, },
name2L => { val1 => val2, val3 => val4, }
);
I get the value hashes as well.
Thanks
Debjit
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 05:03:34 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Trouble making use of 'eval' to prevent fatal division by zero.
Message-Id: <3A330F4A.40787A1@rochester.rr.com>
"M. Taylor Monacelli" wrote:
>
> I'd like to prevent division by zero errors when
> testing my Ratio class, but I'm not sure how to
> incorporate the 'eval' function.
>
> my $ratio = Ratio->new(4/5);
>
> I can make a Ratio instance like this with out any
> problems, but when I try the following:
>
> my $ratio = Ratio->new(4/0);
>
> I get the 'Illegal division by zero error'.
>
> I know *about* the 'eval' function, but I am not
> sure how to make use if it in this case because
> the division '4/0' is done before I get a chance
> to catch the error.
>
> Maybe if I did something like this:
>
> my $ratio = Ratio->new( eval { 4/0 } );
>
> but this is client code! I can't tell the user to
> use 'eval { 4/0 } )' instead of simply '4/0'
> whenever they want to make a new Ratio.
>
> Can someone offer me an alternative?
Sure. Modify your interface to accept two arguments, a numerator and a
denominator. It could also continue to accept one argument as it does
now, so you wouldn't break any existing code. Then you could do:
my $ratio = Ratio->new(4,0);
and you could process the problem any way you choose. HTH.
--
Bob Walton
------------------------------
Date: Sat, 9 Dec 2000 22:48:27 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Trouble making use of 'eval' to prevent fatal division by zero.
Message-Id: <slrn9362or.u2.tadmc@maxim.metronet.com>
M. Taylor Monacelli <tailor@u.washington.edu> wrote:
>I'd like to prevent division by zero errors when
>testing my Ratio class, but I'm not sure how to
>incorporate the 'eval' function.
Then you go read about the eval() function.
perldoc -f eval
...
# make divide-by-zero nonfatal
which then gives the code "to prevent fatal division by zero".
But it is the users of your class that need to trap that error,
not your code.
>my $ratio = Ratio->new(4/0);
>I get the 'Illegal division by zero error'.
If you (really the user of your class here) divide by zero,
you are _supposed_ to get divide by zero errors :-)
Those are constants in the source code, right? If they typed
that, they deserve a surprise.
>Can someone offer me an alternative?
The problem is in _user_ code (what you call client code). It is
not up to your module/class to handle errors in code outside
of your class.
Don't worry about it. Leave it as it is. If they put garbage in,
they get garbage out. (or, things stop before they get anything :-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 10 Dec 2000 23:10:05 +0900
From: "Charle Shin" <yabarahi@robotics.sejong.ac.kr>
Subject: who know that Unicode -> Ascii convert... in perl CGI
Message-Id: <9102iv$5c4$1@usenet.kreonet.re.kr>
first thank for seeing my writting..
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-kr">
I have some problem because upper one line code.
my web CGI will get utf-8 code from other web client...
so I want that my CGI code can covert unicode to Ascii code ..
who know this figure that can solved this problem... plz .. I have no
time...
my boss will kill me.. !!
if capable.. I want some example sourece code ...
thank .. every one .. good bye..
------------------------------
Date: Sat, 09 Dec 2000 14:40:03 GMT
From: me
Subject: Re: Why doesn't this work????? (Location: redirection....)
Message-Id: <3a324414.76162853@nntp.interaccess.com>
Thank you for the advice, but that didn't work either..
Any other ideas? It's so simple, it's just driving me crazy!
On Sat, 09 Dec 2000 01:25:31 GMT, me wrote:
>I have been having problems with my perl scripts on a linux server...
>
>For redirection: here's a script that will not work (it works on
>another server I use with FreeBSD)
>
>
>#!/usr/local/bin/perl
>
>print "Location: http://www.cnn.com/\n\n";
>
>That's it.... It runs fine in telnet, but I always get "premature end
>of script headers" when I try to execute it through Apache server...It
>works fine on my FreeBSD installation.
>
>
>I'm assuming it's something set up incorrectly with the Apache Web
>Server, but other scripts seem to work fine (but only when I use CGI
>and it's commands, not normal print "text/html", etc.)
>
>
>Any ideas would be appreciated.
>
>
>Thanks...
>
>psantt@interaccess.com
>
>
>
------------------------------
Date: Sun, 10 Dec 2000 10:36:50 -0500
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Why isn't Perl highly orthogonal?
Message-Id: <brian+usenet-5E8875.10365010122000@news.panix.com>
In article <90ttii$q6g$1@uwm.edu>, Thelma Lubkin
<thelma@alpha2.csd.uwm.edu> wrote:
> In comp.lang.perl.misc Dave Cross <dave@dave.org.uk> wrote:
> : The length of a string and the number of elemetns in an array really
> : aren't the same thing at all, so it makes sense to me that I find them
> : in different ways. The same goes for substrings and array slices.
>
> : Thinking of these concepts as similar seems to meto be a hangover from
> : C, where strings are arrays of characters, but surely we've moved on
> : since then.
>
> : Maybe your boss is a C programmer?
>
> if aray[8] can hold 8 5-character strings (ie aray's
> elements are char*5), a C programmer would say it's a length
> 8 array, not a length 40 array.
it depends on what you mean by length. C programmers typically think
about the actual number of bytes they use, so length could mean a
couple of different things depending on the context.
but that's not what Dave was talking about. in Perl, a string is
not a sequence like it can be in some other languages. it is just
a scalar.
> Why the gratuitous insult to C programmers?
i don't see how "gratuitous" or "insult" have anything to do with
it.
> --thelma
> who struggles along in both languages.
which is perhaps why you missed the point.
--
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
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 5075
**************************************