[14058] in Perl-Users-Digest
Perl-Users Digest, Issue: 1468 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 23 18:05:47 1999
Date: Tue, 23 Nov 1999 15:05:22 -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: <943398321-v9-i1468@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 23 Nov 1999 Volume: 9 Number: 1468
Today's topics:
Re: [JOB]: Web Developer/Senior Web Developer: SGML, XM (Craig Berry)
Re: A tiny shell written in Perl (Joe Petolino)
Re: Assigning an element of n associat. array to a scal <rzijp@dds.nl>
Best book on Perl (John)
Re: Best book on Perl <slanning@bu.edu>
Re: Best book on Perl <ron@savage.net.au>
Re: binarie operators like and & or .. (M.J.T. Guy)
Re: binarie operators like and & or .. (Clinton Pierce)
Calc.pm <g-preston1@ti.com>
Re: Calc.pm (Matthew Bafford)
Re: Can Perl read gif pixels? <burton@REMOVETHIS.lucent.com>
change directories in system <robert.castellowNOroSPAM@s1.com.invalid>
Re: Change password via cgi script <nandu@cimedia.com>
Re: Change password via cgi script <tbornhol@prioritytech.com>
Re: Escape Character/CGI Script Trouble <nandu@cimedia.com>
Re: getlogin() (Brett W. McCoy)
Re: help please, while wont....... <lr@hpl.hp.com>
Re: Help w/ DBI <crt@mailbr.com.br>
Re: Help with understanding syntax <ajs@ajs.com>
How do I set timeout for socket on STDIN? <rgerharz@not.erols.com>
Re: How do I set timeout for socket on STDIN? <dan@tuatha.sidhe.org>
Re: How do I set timeout for socket on STDIN? <slanning@bu.edu>
Re: How do I set timeout for socket on STDIN? <uri@sysarch.com>
Re: How do I take all of the email addresses out of an <gellyfish@gellyfish.com>
how to print special characters? <cuteman@sensewave.com>
Re: how to print special characters? <lr@hpl.hp.com>
Re: how to print special characters? <rhomberg@ife.ee.ethz.ch>
Re: how to print special characters? <flavell@mail.cern.ch>
How to send a bitmap as part of an HTML mail message? <Jack.Alexander@digital.com>
Re: how to send data back and forth over sockets (Michel Dalle)
Re: How write records to ASCII file <slanning@bu.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 23 Nov 1999 17:39:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: [JOB]: Web Developer/Senior Web Developer: SGML, XML, PERL5, LINUX
Message-Id: <s3lkb56crrp94@corp.supernews.com>
Kenneth Bandes (kbandes@home.com) wrote:
: As for this group, comp.lang.perl.misc, the charter (posted
: frequently as a mini-FAQ by Nathan Torkington) says:
: "comp.lang.perl.misc is for questions on the Perl language."
:
: Period.
:
: What's your question on the Perl language?
Dropping into devil's advocate mode, one could argue that "Would you like
me to pay you for using the Perl language?" is a topical way to post a
help-wanted ad. :)
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: 23 Nov 1999 21:28:50 GMT
From: petolino@Eng.Sun.COM (Joe Petolino)
Subject: Re: A tiny shell written in Perl
Message-Id: <81f0ui$2vp$1@engnews3.Eng.Sun.COM>
Song Wang <wsong@ece.uci.edu> wrote:
> I want to use Perl to write a tiny shell which includes
> the following functionalities:
> (1) executing a small set of commands, probably with arguments.
> (2) autocompletion of those commands.
> (3) executing a script containing commands.
> I don't know if CPAN has already had this kind of Perl modules.
> Any pointers to this kind of tiny shell are appreciated.
Term::ReadLine::Perl in CPAN has autocompletion (and Term::ReadLine::Gnu
may have it, too - I haven't checked), so that takes care of your Item 2.
The rest sounds pretty easy to write on your own.
-Joe
------------------------------
Date: Tue, 23 Nov 1999 18:31:32 +0100
From: "Robbert Zijp" <rzijp@dds.nl>
Subject: Re: Assigning an element of n associat. array to a scalar variable
Message-Id: <383acf99$0$16683@reader1.casema.net>
It would be appreciated when you'd be a bit more specific about what you've
tried.
Robbert
Andrew Bleakley heeft geschreven in bericht <383a63ee@pink.one.net.au>...
>I have parsed the information from a form and assigned the name/value pairs
>to assoc. array formdata.
>I then need to assign the value associated with 'name' to variable called
>$user_name. I cannot seem to make the assignment. Any help would be
>appreciated.
>
>
>
------------------------------
Date: Tue, 23 Nov 1999 16:46:02 -0500
From: jadapturNOSPAM@hotmail.com (John)
Subject: Best book on Perl
Message-Id: <jadapturNOSPAM-2311991646030001@nas-2-37.boston.navinet.net>
What's the best Book to Learn Perl for the web..
--
Remove SPAMNOT from email address to reply
------------------------------
Date: 23 Nov 1999 17:24:18 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: Best book on Perl
Message-Id: <kus66ysrgml.fsf@strange.bu.edu>
jadapturNOSPAM@hotmail.com (John) writes:
> What's the best Book to Learn Perl for the web..
No it's not..
------------------------------
Date: Wed, 24 Nov 1999 09:42:37 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Best book on Perl
Message-Id: <tQE_3.8048$MZ.61486@ozemail.com.au>
Start here to read up on what's available... http://savage.net.au/Books.html
--
Cheers
Ron & Pen Savage
ron@savage.net.au pen@savage.net.au
http://savage.net.au/index.html
------------------------------
Date: 23 Nov 1999 17:09:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: binarie operators like and & or ..
Message-Id: <81eho3$shr$1@pegasus.csx.cam.ac.uk>
Clinton Pierce <cpierce1@ford.com> wrote:
>
>The former you've got wrong. Try this:
>
> $something="a";
> $something2= ord($something) & 0x80;
>
>That compares the bits in the ASCII representation of "a" to 0x80.
>
>The latter is nonsensical. "a" is being used where a number is expected,
>so Perl is going to use the value of 0 instead.
Not entirely. & can operate on strings. I think he may want
$something2 = $something & "\x80";
Mike Guy
------------------------------
Date: Tue, 23 Nov 1999 20:12:09 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: binarie operators like and & or ..
Message-Id: <3841f307.916740072@news.ford.com>
[poster cc'd in e-mail]
On 23 Nov 1999 17:09:23 GMT, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>Clinton Pierce <cpierce1@ford.com> wrote:
>>
>>The former you've got wrong. Try this:
>>
>> $something="a";
>> $something2= ord($something) & 0x80;
>>
>>That compares the bits in the ASCII representation of "a" to 0x80.
>>
>>The latter is nonsensical. "a" is being used where a number is expected,
>>so Perl is going to use the value of 0 instead.
>
>Not entirely. & can operate on strings. I think he may want
It can, but I didn't suspect that it was his intention. 0x80 has a very
clear implied meaning in what he was trying to do (test the high-bit on a
character). In fact, in e-mail, he indicated the correct answer was my
first one.
> $something2 = $something & "\x80";
Is certainly valid perl, but he specified a right operand as 0x80 and so I
thought (actually I now know) he wanted the bitwise AND between numbers
hoping that perl would do the right thing with the "a". Almost nobody
wants the result of $something2 = $something & "\x80".
--
Clinton A. Pierce "If you rush a Miracle Man, you
clintp@geeksalad.org get rotten Miracles." -- Miracle Max,
http://www.geeksalad.org The Princess Bride
------------------------------
Date: Tue, 23 Nov 1999 11:04:09 -0600
From: Jerry Preston <g-preston1@ti.com>
Subject: Calc.pm
Message-Id: <383AC909.370E9EB0@ti.com>
Hi!
Where can I find a copy of Calc.pm that can be down loaded to a system?
Thanks,
Jerry
------------------------------
Date: Tue, 23 Nov 1999 18:30:10 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Calc.pm
Message-Id: <slrn83lltm.3gi.*@dragons.duesouth.net>
On Tue, 23 Nov 1999 11:04:09 -0600, Jerry Preston <g-preston1@ti.com>
spewed forth:
: Where can I find a copy of Calc.pm that can be down loaded to a system?
If this module is located on CPAN, go to:
http://search.cpan.org/
Otherwise, use a little searching skills:
http://www.google.com/search?q=Calc.pm
http://www.altavista.com/?text=yes&q=Calc.pm&search=Search
: Thanks,
HTH,
: Jerry
--Matthew
------------------------------
Date: Tue, 23 Nov 1999 13:43:52 -0500
From: Burton Kent <burton@REMOVETHIS.lucent.com>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Can Perl read gif pixels?
Message-Id: <383AE068.256378AF@REMOVETHIS.lucent.com>
Martien Verbruggen wrote:
> Image::Magick gives you the possibility to easily walk over the pixels
> of an image?
>
> You can use $im->Get('columns', 'rows'), have two loops
> inside of each other, and use Get and pixel[x,y], but isn't that
> terribly slow? Or do you know of a better way with Image::Magick?
>
> Maybe use Image::Magick to convert to PNG, and use GD to do the work
> :)
>
> Martien
> --
I don't really care if it's slow, and thanks for your terribly slow code! It
looks like it will give me what I want.
B
------------------------------
Date: Tue, 23 Nov 1999 14:54:53 -0800
From: natureboy <robert.castellowNOroSPAM@s1.com.invalid>
Subject: change directories in system
Message-Id: <06284168.4a5e64da@usw-ex0109-069.remarq.com>
is there a method to track the directory paths after
executing a system("cd ..") for example? i know the system
command will start and kill a process after completion and
return the status. therefore once system executes a cd ..
the process will die and the parent does'nt seem to have any
information of the current directory path. any ideas?
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: 23 Nov 1999 12:25:00 -0500
From: Nandu Shah <nandu@cimedia.com>
Subject: Re: Change password via cgi script
Message-Id: <m3903p3ytv.fsf@budgie.cimedia.com>
Scootty <eastwoodch@yahoo.com> writes:
> How to write the cgi script that using the command 'passwd' for
> users can change their password of unix system from the net?
This is one of those cases when, if you don't know how to do it, you
might consider it a highly dangerous thing to attempt.
But, if you MUST do it, look to the 1st edition Camel Book (the pink
one), p. 286 for advice.
Nandu
------------------------------
Date: Tue, 23 Nov 1999 15:26:19 -0600
From: "Tim Bornholtz" <tbornhol@prioritytech.com>
Subject: Re: Change password via cgi script
Message-Id: <86470D334C82EF52.53AF987B531374D2.678CD5F89EF64C8E@lp.airnews.net>
Scootty <eastwoodch@yahoo.com> wrote in message
news:383A3E14.2B8E877D@yahoo.com...
> Hi all,
>
> How to write the cgi script that using the command 'passwd' for users
> can change
> their password of unix system from the net?
>
> Thanks
>
Here is some code that I use to change passwords. I use apache and
.htpasswd files. If you don't this probably won't work.
sub ChangePassword {
my ($userid, $password) = @_;
#If Password is empty, the user will be removed!!!!!
my ($PasswordFile, $NewFile, $BackupFile);
my (@saltchars, $salt, $passwdcrypt);
$PasswordFile = ".htpasswd";
$NewFile = "$PasswordFile.tmp.$$";
$BackupFile = "$PasswordFile.bak";
# encrypt the password
srand($$|time);
@saltchars=(a..z,A..Z,0..9,'.','/');
$salt=$saltchars[int(rand($#saltchars+1))];
$salt.=$saltchars[int(rand($#saltchars+1))];
$passwdcrypt = crypt($password,$salt);
if (! open(CURRENT, "< $PasswordFile")) {
return "Unable to open file $PasswordFile, password was NOT changed";
}
if(! open(NEW, "> $NewFile")) {
return "Unable to open file $NewFile, password was NOT changed";
}
while(<CURRENT>) {
if (/^$userid/) {
# If the password is blank, delete the user
if(length($password) > 0) {
print NEW "$userid:$passwdcrypt\n";
}
} else {
print NEW $_;
}
}
close(CURRENT);
close(NEW);
rename( $PasswordFile, $BackupFile);
rename( $NewFile, $PasswordFile);
return "Password successfully changed for $userid<br>\n";
}
hth,
Tim Bornholtz
tbornhol@prioritytech.com
------------------------------
Date: 23 Nov 1999 12:17:22 -0500
From: Nandu Shah <nandu@cimedia.com>
Subject: Re: Escape Character/CGI Script Trouble
Message-Id: <m3bt8l3z6l.fsf@budgie.cimedia.com>
"rydaron" <rydaron@sonic.net> writes:
> When I tried adding that code for the style sheet in each of the sections,
> it spat out a 500 error at me. Now, I'm a bright guy, and I assumed that the
> problem was because of all the semicolons (gee, you suppose?), so I tried
> inserting \; wherever I saw a semicolon, but apparently that wasn't the
> escape character.
When you get a 500 error, try your script from the command line; make
sure it's not printing ANYTHING before the MIME header. I ran your
code snippet, and here's what I got:
String found where operator expected at - line 1, near "css">\n""
It's not the semicolons that need escaping, it's the quotes:
> print "<style type="text/css">\n";
You could backslash the quotes, put your text in a here document, use
qq, or read the HTML from a file.
Nandu
------------------------------
Date: Tue, 23 Nov 1999 18:23:31 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: getlogin()
Message-Id: <slrn83ln1s.bke.bmccoy@moebius.foiservices.com>
Also Sprach Paul Walkerp <paul.walker@st.com>:
>Quick question - getlogin() is limited to returning 8 characters for a
>username. Is that because the OS only returns 8 characters, or just a
>limitation for some other reason?
Where does it say that it is limited 8 characters, and on what OS?
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Tue, 23 Nov 1999 09:23:26 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: help please, while wont.......
Message-Id: <MPG.12a46d6b73d0f1f598a25d@nntp.hpl.hp.com>
In article <81dp6b$e96$1@news.uk.ibm.com> on Tue, 23 Nov 1999 11:10:52
+0100, Matt King <mattking@techie.com> says...
...
> ... The
> problem is, is that the script creates a 0 byte file and does not preform
> the upload. Using the information from the other appends I have rewritten
> the script, but the error remains. Here is the portion of the script that is
> not working. Can someone point out where the error, thanks.
>
> if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$Filename")) { &errormessage; }
> binmode OUTFILE;
> undef $BytesRead;
> undef $Buffer;
>
> #### Here is the error location, everything else apears to work
> correctly......
You have given little information. All I can suggest is that you
binmode($File_Handle) at this point. Perhaps the first byte read is
being interpreted as end-of-file.
> while ($Bytes = read($File_Handle,$Buffer,1024)) {
> $BytesRead += $Bytes;
> print OUTFILE $Buffer;
> }
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 23 Nov 1999 18:54:59 -0200
From: "Bruno C. Reded Tinoco" <crt@mailbr.com.br>
Subject: Re: Help w/ DBI
Message-Id: <383afda5.0@news.americasnet.com>
HI,
I don't know but try this:
$db = "the database name";
$user = "Some user";
$sql_cmd = "Some SQL command";
$con = DBI->connect("dbi:mysql:database=$db;user=$user;host=localhost");
$select = $con->prepare($sql_cmd);
$select->execute;
[]s
Bruno
Adam Levenstein <che@worker.com> escreveu nas notícias de
mensagem:3837931e.294422215@news.psu.edu...
> Does anybody here know the DBI module well?
>
> I'm trying to connect to a MySQL server, but my script doesn't work
> and I don't know why. It doesn't give me an error, but doesn't add the
> form info to the DB either.
>
> Could someone take a look and let me know what's wrong? I'd appreciate
> it.
>
> Thanks,
>
> Adam
>
> P.S. $user, $password, and $host are defined, but I took them out of
> this code for security reasons.
>
>
>
> #!/usr/bin/perl
>
> use DBI;
>
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair); # decode pairs
> $value =~ tr/+/ /; # trans all
> '+' to ' '
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $FORM{$name} = $value;
> }
>
> $loc = $FORM{'location'};
> $roomies = $FORM{'no_roomies'};
> $ownroom = $FORM{'ownroom'};
> $rent = $FORM{'rent'};
> $deposit = $FORM{'deposit'};
> $utilities = $FORM{'utilities'};
> $parking = $FORM{'parking'};
> $pets = $FORM{'pets'};
> $name = $FORM{'name'};
> $email = $FORM{'email'};
> $phone = $FORM{'phone'};
> $description = $FORM{'description'};
>
> $driver = "mysql";
> $db = 'entries';
>
> $dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user,
> $password, {RaiseError => 1});
>
> $dbh->do("INSERT INTO sublets VALUES ('$loc, $roomies, $ownroom),
> $rent, $deposit, $utilities, $parking, $pets, $name, $email, $phone,
> $description')", undef, $dbh->quote("number"), $dbh->quote("name"));
>
> print "Content-type: text/html\n\n";
> print "$FORM{'location'}";
>
> $dbh->disconnect;
>
>
> ------------------------------------------------------
> "You must be in love with the devil. You probably
> sold your soul to him to learn how to play the banjo.
> May God help you!"
>
> - "Bishop" Norman Boyd
------------------------------
Date: 23 Nov 1999 10:00:57 PST
From: Aaron Sherman <ajs@ajs.com>
Subject: Re: Help with understanding syntax
Message-Id: <m3hfid84vl.fsf@centauri.ajs.com>
mjd@op.net (Mark-Jason Dominus) writes:
> In article <slrn83dd13.m2v.abigail@alexandra.delanet.com>,
> Abigail <abigail@delanet.com> wrote:
> >The advantage over the "for" and the "if/else" solutions are that
> >if you have 47 cases, it doesn't have to try them all before defaulting
> >to default. (Assuming you can easily calculate the correct label).
>
> Yes, but the way `goto' works is by searching the program starting
> from the beginning. So it ends up looking at all the nonmatching
> labels anyway.
I know that I'm a bit out of touch, but wasn't this the case a LONG
time ago, and that was then fixed when labels became just another type
of variable in perl5.000?
As I recall, this was one of the huge reasons for switching over to
perl 5, because it also forced some reconciling of the way that return
worked, which made return attractive for general use.
-AJS
--
Aaron Sherman
ajs@ajs.com finger ajskey@lorien.ajs.com for GPG info. Fingerprint:
www.ajs.com/~ajs BF8E 8987 1D58 E01E E0B8 4BB6 B388 2F80 97AE A001
"Do you come from a land downunder, where bitters flow and the
men chunder?" -Men at Work
------------------------------
Date: Tue, 23 Nov 1999 14:36:25 -0500
From: "Reinhold J. Gerharz" <rgerharz@not.erols.com>
Subject: How do I set timeout for socket on STDIN?
Message-Id: <s3lr5uborrp75@corp.supernews.com>
I need to detect timeout or disconnection in my input function, when STDIN
is a socket.
I am writing a mini-server in Perl 5.005_58 on Linux (RedHat 5.2). The
service runs under inetd, so it starts up with inetd having setup STDIN as a
socket to the client. I cannot find a way to set the timeout for an already
created socket. I would be grateful for some suggestions.
Please post no email. The return address is faked!
--
Reinhold J. Gerharz
"The only good spammer is a DEAD spammer!" - Anonymous
------------------------------
Date: Tue, 23 Nov 1999 20:56:51 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: How do I set timeout for socket on STDIN?
Message-Id: <ncD_3.6079$Pj3.11945@news.rdc1.ct.home.com>
In comp.lang.perl.misc Reinhold J. Gerharz <rgerharz@not.erols.com> wrote:
> I am writing a mini-server in Perl 5.005_58
Regardless of anything else, this is a huge mistake. Never use any of the
development releases (_50 through _99) for anything except work on perl
itself. They're all, in some form or fashion, broken. (That's why they're
development releases after all) Perl 5.6, which 5.005_58 is a development
release for, isn't even in beta yet.
Dan
------------------------------
Date: 23 Nov 1999 16:22:21 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: How do I set timeout for socket on STDIN?
Message-Id: <kus903orjhu.fsf@strange.bu.edu>
"Reinhold J. Gerharz" <rgerharz@not.erols.com> writes:
> I need to detect timeout or disconnection in my input function,
> when STDIN is a socket.
The C-like (4-parameter) version of select().
But it can get ugly..
------------------------------
Date: 23 Nov 1999 17:42:30 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How do I set timeout for socket on STDIN?
Message-Id: <x7pux0n82x.fsf@home.sysarch.com>
>>>>> "SL" == Scott Lanning <slanning@bu.edu> writes:
SL> "Reinhold J. Gerharz" <rgerharz@not.erols.com> writes:
>> I need to detect timeout or disconnection in my input function,
>> when STDIN is a socket.
SL> The C-like (4-parameter) version of select().
SL> But it can get ugly..
then use one of many modules which make it easier. IO::Select, Event.pm
and others do timeouts on I/O.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 23 Nov 1999 01:25:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I take all of the email addresses out of an email? 2 of 2 (fwd)
Message-Id: <81cqdk$16h$1@gellyfish.btinternet.com>
On Tue, 23 Nov 1999 00:22:50 GMT Matthew Bafford wrote:
>
> Or, like me, they just /dev/null anything with FWD in the subject more
> than once. :-)
>
Oh no they are the great ones - I have a really spectacularly sad one with
over six hundred addresses on it at work...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 23 Nov 1999 19:01:17 GMT
From: "cuteman" <cuteman@sensewave.com>
Subject: how to print special characters?
Message-Id: <1wB_3.2608$QA6.185347072@news.telia.no>
I don't seem to get the special characters I want.
I have programmed a WebShop using Perl/CGI. But my script writes out "funny"
characters for the norwegian characters "æøåÆØÅ". How do I type them? I've
tried "\æ\ø\å\Æ\Ø\Å". (Hmm... perhaps something like "%XX" for each?)
Sigmund S.
------------------------------
Date: Tue, 23 Nov 1999 11:42:49 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: how to print special characters?
Message-Id: <MPG.12a48e1086557b5298a25f@nntp.hpl.hp.com>
In article <1wB_3.2608$QA6.185347072@news.telia.no> on Tue, 23 Nov 1999
19:01:17 GMT, cuteman <cuteman@sensewave.com> says...
> I don't seem to get the special characters I want.
>
> I have programmed a WebShop using Perl/CGI. But my script writes out "funny"
> characters for the norwegian characters "æøåÆØÅ". How do I type them? I've
> tried "\æ\ø\å\Æ\Ø\Å". (Hmm... perhaps something like "%XX" for each?)
Yes, 'like' that: "\xXX". Perhaps this little exercise will help you.
#!/usr/local/bin/perl -w
use strict;
$_ = 'æøåÆØÅ';
print "$_\n\n";
my $s = join "" => map sprintf('\x%x', ord) => split //;
# An alternative transformation:
# my $s = join '\x' => "", (unpack 'H*' => $_) =~ /../g;
print "$s\n\n";
print eval qq{"$s"}, "\n";
__END__
Output:
µ°s¦++
\xe6\xf8\xe5\xc6\xd8\xc5
µ°s¦++
I don't know why the output representations are different; blame it
(along with everything else) on Windows/DOS, I guess.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 23 Nov 1999 21:01:02 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: how to print special characters?
Message-Id: <383AF27E.3EF6E9AF@ife.ee.ethz.ch>
cuteman wrote:
>
> I don't seem to get the special characters I want.
>
> I have programmed a WebShop using Perl/CGI. But my script writes out "funny"
> characters for the norwegian characters "æøåÆØÅ". How do I type them? I've
> tried "\æ\ø\å\Æ\Ø\Å". (Hmm... perhaps something like "%XX" for each?)
print them using *HTML* ä for ä etc. Any other way and they won't
show up correctly on some browsers. Look at you favorite HTML
description to find the correct commands.
- Alex
------------------------------
Date: Tue, 23 Nov 1999 21:19:49 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to print special characters?
Message-Id: <Pine.HPP.3.95a.991123211901.721M-100000@hpplus01.cern.ch>
On Tue, 23 Nov 1999, Alex Rhomberg wrote:
> print them using *HTML* ä for ä etc. Any other way and they won't
> show up correctly on some browsers.
Try telling that to the HTML authoring group, where it would be
on-topic, and we'll show you how you're wrong.
------------------------------
Date: Mon, 22 Nov 1999 17:12:40 -0500
From: "Jack Alexander" <Jack.Alexander@digital.com>
Subject: How to send a bitmap as part of an HTML mail message?
Message-Id: <81ce4q$h7e$1@nntpd.lkg.dec.com>
I'm using Windows NT4 SP6 and Perl 5.004.
My Perl program creates an HTML formatted mail message and sends it using
the SMTP package.
I'd like to add a bitmap image to the mail content, but I don't know how to
do this.
Could someone give me a pointer where to look?
thanks,
--
Jack Alexander
Compaq Computer Corporation
UNIX/NT Software Development Environments
110 Spitbrook Rd. (ZKO2-3/Q08)
Nashua, NH 03062 USA
------------------------------
Date: Tue, 23 Nov 1999 13:46:51 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: how to send data back and forth over sockets
Message-Id: <81e66k$bj7$1@news.mch.sbs.de>
In article <38370A7E.4F1D5EEB@nycap.rr.com>, "Matthew H. Devlin III" <mhdevlin@nycap.rr.com> wrote:
>I have created a little Tk application that runs on unix. What I want
>to do with it is be able to run it on a windows machine and connect via
>a socket to the unix server.
>
>Can someone provide me with some code so I can get started? I just need
>some examples so I can get the jist.
>like a simple client which connects to a simple server, runs a `ls` and
>then returns the output back to the client.
>
This sounds like the Net::Telnet module. Here's an example from the readme :
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/bash\$ $/');
$t->open("sparky");
$t->login($username, $passwd);
@lines = $t->cmd("/usr/bin/who");
print @lines;
You can find it on CPAN...
Michel.
------------------------------
Date: 23 Nov 1999 14:51:14 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: How write records to ASCII file
Message-Id: <kushfidugul.fsf@strange.bu.edu>
jad@edekamapson.dk (Jan Andersen) writes:
> What is "on 2275 September 1993" ? Is it in the documentation ;-)
hehe, it'll *ALWAYS* be Sept. '93 for some people on Usenet.
Sadly, their minds couldn't handle the trauma..
------------------------------
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 1468
**************************************