[18499] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 667 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 10 11:05:47 2001

Date: Tue, 10 Apr 2001 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <986915110-v10-i667@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 10 Apr 2001     Volume: 10 Number: 667

Today's topics:
        Business::FedEx -- Anyone get it to work? <bluearchtop@MailAndNews.com>
        CGI.pm V. Here Docs . . . ameen@dausha.net
    Re: CGI.pm V. Here Docs . . . (Rafael Garcia-Suarez)
    Re: complaint about moderation of this group (---Pete---)
        RE: Filehandle question <jamesfreeman@MailAndNews.com>
    Re: How can I check if a computer exist on my NT LAN? <me@my_no_spam.org>
    Re: how to improve this code? (Mark Jason Dominus)
    Re: Perl and Networking <mtsouk@freemail.gr>
        QUE: A good perl debugging book <mtsouk@freemail.gr>
    Re: registration script <temp1@williamc.com>
        SMB or NetBios? Spoofing. <alessandro.augusto@br.bosch.com>
    Re: unicode, perl and webbrowsers <pilsl_@goldfisch.at>
    Re: unicode, perl and webbrowsers <flavell@mail.cern.ch>
    Re: Using References <mjcarman@home.com>
    Re: Using References <RAY_electronic_design@t-online.de>
    Re: Using References (Tad McClellan)
    Re: Using References <lmoran@wtsg.com>
    Re: win32: *.pl > *.exe howto <alessandro.augusto@br.bosch.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 10 Apr 2001 10:27:36 -0400
From: asdf <bluearchtop@MailAndNews.com>
Subject: Business::FedEx -- Anyone get it to work?
Message-Id: <3ADEED92@MailAndNews.com>

I just stumbled across your FedEx module. Looks very nice.  I can't see to 
get 
it to work, however.(doesn't seem to connect with Win32::API)

1) When I hit this line in ShipAPI.pm, it dies:

$_WEBAPIConnect = Win32::API->new(WEBAPICLIENT, WEBAPIConnect, ['P', 'N', 
'P', 
'P'], 'N')

My FedEx software is installed, and I can telnet to localhost 6970.  
However, 
I get this error:

DIED: The specified module could not be found at 
F:/Perl/lib/Business/FedEx/Ship
API.pm line 59.
Can't call method "connect" on an undefined value at 
F:/Perl/lib/Business/FedEx/
ShipRequest.pm line 281.

Do I have to run this from a special directory or something? How does it 
know 
where to find the FedEx API?

2) How do I get my meter_number? Would that be my password as well? And my 
shipper # is 
my username?



------------------------------

Date: 10 Apr 2001 13:19:41 GMT
From: ameen@dausha.net
Subject: CGI.pm V. Here Docs . . .
Message-Id: <9av19d$6be$1@news.netmar.com>

Greetings,

I'm trying to get a handle on the use of CGI.pm. I've been using it lately and
enjoying it, but some of my peers think that it is a bloated tool--bloated to
the point of limiting its use. They perfer writing lengthy Here Documents
with all that goes with it.

For handling user input, they use cgi-lib. From what I understand this is a
depreciated tool in Perl5. Is my understanding correct? (I know that 5.6.1
has CGI.pm 2.752 inside).

The developing environment uses Solaris with Netscape as a server.

How can I best approach this issue to perhaps convince them that CGI.pm isn't
so bad after all?

Thanks in advance,
Ben

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


------------------------------

Date: 10 Apr 2001 14:06:36 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: CGI.pm V. Here Docs . . .
Message-Id: <slrn9d64sa.m8d.rgarciasuarez@rafael.kazibao.net>

ameen@dausha.net wrote in comp.lang.perl.misc:
> Greetings,
> 
> I'm trying to get a handle on the use of CGI.pm. I've been using it lately and
> enjoying it, but some of my peers think that it is a bloated tool--bloated to
> the point of limiting its use. They perfer writing lengthy Here Documents
> with all that goes with it.
> 
> For handling user input, they use cgi-lib. From what I understand this is a
> depreciated tool in Perl5. Is my understanding correct? (I know that 5.6.1
> has CGI.pm 2.752 inside).

Yes, cgi-lib is depreciated, and deprecated. No development is done on
cgi-lib and no new versions are released. On the other hand, new
versions of browsers and web servers are released. Thus, the latest
CGI.pm is more suitable to handle web sites on recent servers, visited
by recent browsers.

But your peers are not totally wrong : there is bloat in CGI.pm. Why
putting in a same module HTML-generating and CGI-input decoding methods?

The docs for CGI.pm have an answer :

BUGS
       This module has grown large and monolithic.  Furthermore it's
       doing many things, such as handling URLs, parsing CGI input,
       writing HTML, etc., that are also done in the LWP modules. It
       should be discarded in favor of the CGI::* modules, but somehow I
       continue to work on it.

So, go to http://search.cpan.org/ and look for the CGI modules you need.
And convert your peers ;-)

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
package another; sub AUTOLOAD { $AUTOLOAD =~ /::(.*)/;"$1 @_"; }
package hacker;  sub AUTOLOAD { $AUTOLOAD =~ /::(.*)/;"$1 @_,\n"; }
print Just another Perl hacker;


------------------------------

Date: Tue, 10 Apr 2001 14:33:13 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: complaint about moderation of this group
Message-Id: <3ad315a6.95120909@news.earthlink.net>

On Mon, 09 Apr 2001 08:09:30 GMT, Uri Guttman <uri@sysarch.com> wrote:

>>>>>> "-" == ---Pete---  <bogus@erol.com> writes:
>
>  -> Right, and since it's internet and not a private or exclusive
>  -> association, the right thing to do is to accept and help
>  -> everyone of all levels of expertise -- allowing novices
>  -> to help novices and expert to help experts. 
>
>then hang out in alt.perl. we don't appreciate novices helping novices
>here as they tend to give and propogate wrong answers. novices do better
>lurking or asking questions. when they feel they have enough perl to
>help out others then they can start to answer questions they feel they
>can properly answer....
------
Uri, first you tell to me go hang out in some other group after I
simply suggested that people of different levels of expertise help
one another and then later in the same reply you support the
very concept I suggested when you say that over time the newbie
will "learn more perl, start to answer questions and become regulars."

I think we are agreeing but stating it different terms. For  example,
I came to this group, as a newbie to Perl and posted a
 "What Perl book to buy" type question for which I received many 
great suggestions. I researched the list of suggested books, bought
2 books and reported back to the group my selections. Shortly
thereafter, someone else new to perl posted a similar  "What Perl
book to buy" type  question and I was able to provide use info to
that person by relating to his "newbie" position  and sharing what I
had recently learned. My point is, that a newbie can help a newbie,
novices can help novices and experts can help experts *and*
everything in between. However, I understand, what you mean
when you state that a novice can give out the wrong information.
I also read the guidelines for this group and did not find anything
saying that novices not appreciated or not supposed to help
others. If there is another document regarding the rules here that
I missed please direct me to that.

My opinion is to encourage everyone to help everyone,  (of course
within their area of expertise)and  then if someone gives out bad info
anyone else can chime in and present the correct information. The
advantage here is that very simple "novice" type  questions can
be answered by other novices without unnecesarilly taking up the
time of an "expert" who could be better utilized helping someone else.


>.. and they have to be capable of handling corrections
>from others. all of the regulars have made mistakes and trust others to
>be nitpicking them. that is how it works here. if you can't tolerate any 
>critiques of your posts, then don't post here.
-------
Right, and I agree. I always welcome constructive critiszm
because that's how I learn. That is -- as long as it's done in a 
courteous manner.


>  -> The thing I like to discourage is the elitist or snobish attitude
>  -> often found in the types of newsgroups (or anywhere in life) where
>  -> people gather with various levels of knowledge, experience, money
>  -> or whatever that divides people into sub-groups. However, if anyone
>  -> from any level within the group has blatant disrespect for the
>  -> rules and knowingly practices poor net-etiquette then they should
>  -> be delt with accordingly.
>
>we have no restrictions on who can participate here...
------
Uri, if you read my statement above I never suggested that you
restricted who can participate.  I only made reference to the type
of attitude I find offensive. It's a separate paragraph and a 
separate thought invoked by some of the various posts I've
read recently. 


> ...we do have certain
>rules on how they can. there is a big difference. i have seen many
>newbies here over the years stick around, learn more perl, start to
>answer questions and become regulars. it is the hit and run newbie
>attacks and whines that get annoying.
------
Again, we agree <grin>.
As a matter of fact I'm pretty sure that the group is better off
without the person who originally posted this complaint message
because he wasn't even man enough to stick around and defend
his position. Yeah, I consider that kind of behavior as the whining
cry-baby or chronic complainer type for which the group is most
likely better off without.

Personally, I  believe that many times people in general are
afraid to speak up when they see something that they feel is wrong
or could be improved upon for fear of being attacked by a few who
attempt to dominate a particular newsgroup. Everyone loses to 
some degree when this occurs. I like encourage everyone to 
speak their mind and share their ideas, but to do it in an polite
a courteous manner. And.. like you suggest,  to be mature enough
to accept constructive critique or discuss controversial issues in
an civil manner. Then everyone wins!

---pete---



------------------------------

Date: Tue, 10 Apr 2001 09:18:43 -0400
From: james freeman <jamesfreeman@MailAndNews.com>
Subject: RE: Filehandle question
Message-Id: <3ADE20BE@MailAndNews.com>

>===== Original Message From "Brian McCann" <bmccann@naisp.net> =====
>Hi,
>When I run this script without the open OUT lines
>the script will replace the string "tag" with the string "PCS-1-0-0-Build94"
>in the dos
>window, but if I add those lines in nothing happens. the line that perl
>complains about is:
>#rename $filename, "$filename.bak" or die "Cannot rename: $!";
>
>I get this error on the command line: Cannot rename: No such file or
>directory at C:\Perl\scripts\whatrn.plx line 23.
>
>any help would be greatly appreciated
>Thanks,
>Brian
>
>
>use warnings;
>use strict;
>
>my $dir = "AppsTagBuild";
>my $tag = "PCS-1-0-0-Build94";
>my $filename = "WhatLabel.java";
>
>
>open IN,
>"<C:\\$dir\\$tag\\source\\Applications\\InternalProduct\\Java\\Utils\\$filen
>ame.bak" or die "Cannot open: $!";
>open OUT,
>">C:\\$dir\\$tag\\source\\Applications\\InternalProduct\\Java\\Utils\\$filen
>ame" or die "Cannot create: $!";
>while (<IN>) {
>   s/tag/$tag/;
>   #print OUT $_;
>   print $_;
>        }
>close IN;
>close OUT;
>#rename $filename, "$filename.bak" or die "Cannot rename: $!";
>
>

problems:

no path to $filename and $filename.bak specified
+/- rename is unreliable as a function

as an aside you can use paths in the "normal" form in perl ie c:/foo/bar and 
it will be transliterated to c:\foo\bar in dos automatically thus avoiding 
"c:\\foo\\bar" to get the desired c:\foo\bar after double quote 
interpolation. 
makes code portable and easier to read.

try this

use warnings;
use strict;

my $dir = "AppsTagBuild";
my $tag = "PCS-1-0-0-Build94";
my $path = "C:/$dir/$tag/source/Applications/InternalProduct/Java/Utils";
my $filename = "WhatLabel.java";

open (IN,"<","$path/$filename.bak") or die "Can not open: 
$path/$filename.bak 
$!\n";
open (OUT,">","$path/$filename.") or die "Can not create: $path/$filename 
$!\n";

while (<IN>) {
   s/tag/$tag/;
   print OUT $_;
   #print $_;
}
close IN;
close OUT;
rename "$path/$filename", "$path/$filename.bak" or die "Cannot rename: 
$path/$filename $!\n";


Alternatively avoid rename +/- create a backup called $filename.old

use warnings;
use strict;

my $dir = "AppsTagBuild";
my $tag = "PCS-1-0-0-Build94";
my $path = "C:/$dir/$tag/source/Applications/InternalProduct/Java/Utils";
my $filename = "WhatLabel.java.bak";

# get file
open (IN,"<","$path/$filename") or die "Can not open: $path/$filename $!\n";
@file = <IN>;
close IN;

# create backup file
open (BACKUP,">","$path/$filename.old") or die "Can not create backup: 
$path/$filename.old $!\n";
for (@file) {print BACKUP $_;}
close BACKUP;

# make changes and overwrite old file
open (OUT,">","$path/$filename") or die "Can not overwrite: $path/$filename 
$!\n";
while (@file) {
   s/tag/$tag/;
   print OUT $_;
   #print $_; # do you want output to STDOUT?
}
close OUT;



------------------------------

Date: Tue, 10 Apr 2001 09:04:15 -0400
From: Dave VP <me@my_no_spam.org>
Subject: Re: How can I check if a computer exist on my NT LAN?
Message-Id: <3AD304CF.2784F00A@my_no_spam.org>

Alessandro wrote:
> 
> Hello All,
> 
> How can I check for a NT network computer before I execute the tasks.
> I need to know if the computer exist on my NT LAN or not
> For example,
> 
> if (computer exist) then execute_task1
>  elseif
>      # computer does not exist on the NT network (LAN)
>       execute_task2
> 
> -------------------
> This problem occurs to me when I try to read remote Registry values,
> but before I stablish a connection, I want to search for the existence
> of
> that computer. Some function like ping or whatever.
> 
> Thanks,
> Alessandro

I use Net::Ping

A sample section:

#!/perl -w

use strict;
use Net::Ping;


my ($host,$NTName);

###	...	Blah Blah

$host = "somemachine";
$NTName = "\\\\".$host;

my $p = new Net::Ping( "icmp", 2 );
if ( $p->ping($host) ) {
	#
	#  ...  Do something on $host
	#
}
else {
	print "Can't ping $host\n";
}
$p->close();

###	.......  Continues


Notice that Ping() will not like the NetBIOS (\\machine) format.

HTH --

Dave


------------------------------

Date: Tue, 10 Apr 2001 12:55:26 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: how to improve this code?
Message-Id: <3ad302be.3fdd$344@news.op.net>

In article <20010409.160429.2086206725.3777@irs-net.com>,
Jens Luedicke <jens@irs-net.com> wrote:
>how can I improve this code?
>
>foreach (split /\n/, $records[$number_of_mails]{"Header"}) {
>	$element = $_;
>	foreach $e (qw(From Subject To Reply-To Cc)) {
>			$records[$number_of_mails]{$e} = $1 if $element =~ /^$e:\s+(.+)/i;
>	}
>}


A straightforward transformation is:

{ my $rec = $records[$number_of_mails];
  for (split /\n/, $rec->{Header}) {
    foreach $hdr (qw(From Subject To Reply-To Cc)) {
      $rec->{$hdr} = $1 if /^$hdr:\s+(.+)/i;
    }
  }
}


I think it would be preferable to do:

{ my $rec = $records[$number_of_mails];
  for (split /\n/, $rec->{"Header"}) {
    $rec->{lc $1} = $2 if /^(From|Subject|To|Reply-To|Cc):\s+(.+)/i;
  }
}

I think the /i is probably wrong---mail message headers are now
allowed to have varying capitalization.

In particular, if /i is really desirable, then your original code
probably has a bug: If an email message has 'subject' instead of
'Subject', then you actually use 'subject' as a key; later code that
looks for $rec->{Subject} will not find anything.  But I will leave it
in since you may know something I don't.

I notice that your code does not deal correctly with continuation lines.
An amended version follows.

{ my $rec = $records[$number_of_mails];
  my ($hdr, %interesting);
  BEGIN { %interesting = map {$_ => 1} qw(from subject to reply-to cc)) }
  for (split /\n/, $rec->{Header}) {
    if (s/^\s+//) {
      $rec->{$hdr} .= $_ if defined $hdr;
    } else {
      ($hdr, my $val) = /^([^:]):\s+(.*)/;
      undef($hdr), next unless $interesting{lc $hdr};
      $rec->{$hdr} = $val;
    }
  }
}
-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Tue, 10 Apr 2001 16:21:51 +0300
From: "Mihalis Tsoukalos" <mtsouk@freemail.gr>
Subject: Re: Perl and Networking
Message-Id: <9av1jt$2oq1$1@ulysses.noc.ntua.gr>

<qurob@hotmail.com> wrote in message news:963p95$7dt$1@nnrp1.deja.com...
>
>
> This is related to my previous posts about having a Perl program that
> acts as an email client. I'm new to Perl, but have done C, Java, Visual
> Basic, Pascal, assembly....My question is, does Perl have built-in
> networking functions (shoulda checked the FAQ, I know) or would it be
> more feasible/possible to open a telnet session from inside the perl
> script? I basically want to be able to check a pop3 server for new
> messages and download them, or send outgoing through a SMTP.
>
> Sent via Deja.com
> http://www.deja.com/

A great resource is the book "Network programming with Perl" by Lincoln D.
Stein.
It has many working examples on what you want and alot more.

Mihalis.




------------------------------

Date: Tue, 10 Apr 2001 16:31:02 +0300
From: "Mihalis Tsoukalos" <mtsouk@freemail.gr>
Subject: QUE: A good perl debugging book
Message-Id: <9av254$2p6l$1@ulysses.noc.ntua.gr>

Hello to everyone.

I would like to ask those of you that you have read books on perl debugging,
to propose me one.
If possible, I would like a book not for beginners.

many thanks in advance,
Mihalis.




------------------------------

Date: Tue, 10 Apr 2001 13:22:30 GMT
From: PropART <temp1@williamc.com>
Subject: Re: registration script
Message-Id: <3AD307F3.6D118F7A@williamc.com>

Atayarani wrote:
> 
> I am very new to Perl, but hope that I will get some helpful responses.  I
> am trying to create a script for my page, in which a user can register (for
> benefits unknown) and all information submitted is sent to a specified email
> address.  I currently am using a script copied from a book, for a start.  It
> did not work, I got an Internal Server Error.  The permissions are correct,
> and the path is correct.  I have no idea where it went wrong.
> 
> -atayarani

Note: you shouldn't cross-post and you shouldn't ask questions that
are not related to the Perl language in this news group. 

does yr. Perl code compile on the command line? did you xfer it to the
server as ascii? are you sending the correct response header back? are
you using CGI.pm? are all special characters escaped correctly? what
does your error log say?

If you don't know how to check your error log you also might try
adding this line to redirect errors...

use CGI::Carp qw(carpout fatalsToBrowser);

--williamc


------------------------------

Date: Tue, 10 Apr 2001 11:54:40 -0300
From: Alessandro <alessandro.augusto@br.bosch.com>
Subject: SMB or NetBios? Spoofing.
Message-Id: <3AD31EB0.78CFE629@br.bosch.com>

I wanna know what protocol does perl for NT uses to connect with the
remore
machines. Is is SMB or NetBios?

After I discover the protocol, I would like to know about pacot
spoofing. When
the server use Perl to connect remotely on the workstations. If there is
a intrusion
between the server and the client, if he knows what kind of data is send
, he can
change the data and the client wont know. The client will receive the
intrusion
data and think that it was sent by the server.

Server ---------- Workstations
                  |
                  |
             intrusion

Alessandro



------------------------------

Date: Tue, 10 Apr 2001 15:10:05 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: unicode, perl and webbrowsers
Message-Id: <MPG.153d24958b576c8e989802@news.inode.at>


I put a very simple testscript online, that lets you enter any text in a 
form and print out the submitted text and the ord-numbers of it 
characters.
Encoding ist 'UTF-8' and all is done with perl 5.6.0

http://www.customers.goldfisch.at/cgi-bin/unicodetest.pl
(source: http://www.customers.goldfisch.at/unicodetest.pl)

I tested with IE55, which is able to enter all languages in the form and 
even to provide default-values for the form in any language (see the 
postscriptum also)

When I enter the russian YERU in the form I get the following ord-values 
returned: 209-139, so one character is interpreted as two characters in 
perl. The correct unicode-tag for this YERU (that is actually the small-
letter-yeru) is &#1099.

Now I would like to know, what is the connection between this 209-139-
ordvalues and 1099 ? The arabic character &#1512 delivers the ordvalues 
215-168.

I thought perl is able to store any unicodecharacter as one internal 
character or is this a problem of the substr-function I used to extract 
the chars ...

How should I internal store the text ? Just keep the strings as they are 
and store them into the database and hope this is all compliant to the 
important standards. Or should I try to find a way to convert all this 
ord-values into the correct html-tags &#wxyz and store this values.

You see, I still didnt get the point ;)

peter

ps: I wrote and tested the above script on my local webserver in the 
intranet. After moving it to its above location I find out, that the 
mentioned cyrillic character YERU is not processed correctely in its new 
environment: after submitting the letter it doesnt appear as YERU in the 
form but as ord-values too. This only seems to happen with YERU and no 
other russian char.
very strange ...
I begin to wonder, if the old way of implementing 7 localiced version 
would be easier than dealing with unicode ...
 

-- 
pilsl@
goldfisch.at


------------------------------

Date: Tue, 10 Apr 2001 15:19:58 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: unicode, perl and webbrowsers
Message-Id: <Pine.LNX.4.30.0104101429400.32121-100000@lxplus003.cern.ch>



OK, I'm now crossposting this and setting f'ups to the HTML authoring
group.  In due course I expect there will also be details that would
be better discussed on the CGI authoring group, but the HTML side of
things seems to be the first priority.

On Tue, 10 Apr 2001, peter pilsl wrote:

> start studying them immediately and give you a demonstration url here for
> a small discussiontree:
>
> http://www.customers.goldfisch.at/cgi-bin/guestbook.pl?topic=unicode

OK (well, your page never completed, but when I hit the browser Stop
then I was able to read enough of it to get the idea)...

http://ppewww.ph.gla.ac.uk/~flavell/tests/PETER1.GIF

> I cant post the whole perl-source here

No, this isn't the point; you need to break the problem down into
individual components and isolate your problems.  You are running way
ahead of yourself, and have set yourself much too complex a task as a
result.

You will probably want to look at the c.i.w.*** groups for recent
discussions on related topics by, at least, Andreas Prilop (der auch
deutsch spricht, koennte vielleicht helfen) and myself.

> print out a form and read the parameters sent back from this form (with
> the CGI-module), saves them to a database (with the DBI,DBD-module) and
> load them from a database and print em out again.

Again, I would want to factor-out any database issues until the basic
"form-submit and server-analysis of the result" part of the machinery
has been understood.

> At the beginning I write 'charset=UTF-8',

You're writing an HTTP Content-type header with this character coding
attribute in it - that's good.

> And so the created html-code looks like: It dont has the unicode-chars
> written like &#1056 or whatever, but has all the unicode written as some
> special characters

Right, you're sending out the text as utf-8-coded characters, and
that's perfectly OK and works - in principle - even with Netscape 4.*:
it will also work "in practice" if the browser has been properly
configured and if appropriate fonts are available.

The interesting part however is going to be the submission of new
material, and that's what you need to concentrate on next.

> that my linuxterminal cant handle.

I'm not going to deal with that issue right now.   You have enough
problems when dealing with browsers which work.

> Is it necessary to convert the stuff returned by the form somehow in this
> &#xxxx-format and how is it done ?

No, it isn't necessary.  Both representations are technically OK, and
it's not clear to me that you win anything from the technical point of
view by changing from one to the other.  You'd certainly "bloat" your
documents if you did it.

I'd recommend always including the terminating ";" like &#1234;
even in cases when it isn't needed.

> I hope you understand what I'm trying to tell:

gewiss, gewiss...

> It seems there are two ways
> to make IE or netscape display the same unicode-character:
> * writing the char as &#xxxx
> or
> * just put this nonprintable char directely in the source

Correct.  But it _does_ have to be utf-8 coded.  If you look at this
shot of your response page
http://ppewww.ph.gla.ac.uk/~flavell/tests/PETER2.GIF you'll see that
the o-umlaut in 'Veroeffentlichen' comes out wrong: the reason is that
you have included the o-umlaut as an iso-8859-1-coded 8-bit character,
which is wrong in a utf-8-coded document.  The same happens with some
other umlauted letters.

You must either convert these to utf-8 coding, or use &ouml; etc.
notation.

But this is a trivial fix, compared with the problems you're going to
encounter in handling coded user input.  Let's discuss that when the
thread has moved to the appropriate group and you've done some more
background-reading.

By the way, you appear to have decided you want to generate XHTML, but
what you're generating isn't valid XHTML, which means by XML rules
that it _ought_ to be totally rejected.  If you insist on using XHTML
then you should do it properly IMHO.

good luck



------------------------------

Date: Tue, 10 Apr 2001 08:29:29 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Using References
Message-Id: <3AD30AB9.AC1F75AE@home.com>

Lou Moran wrote:
> 
> [W]hile I am not confused as to how references work
> I am wondering what I would use them for.
> 
> In Johnson's book [...] he has an excellent example of how
> references work:
> 
> my $outer;
> {
>         my $inner = 42;
>         $outer = \$inner;
> }
> print "$$outer\n" ; #prints 42
> 
> Makes perfect sense.
> 
> Why would I do this?  When would this be useful?

In my experience, it's rare to take a reference to a scalar. What is
common is taking references to arrays and hashes. For one, this allows
you to pass (and return) multiple arrays and/or hashes to subroutines.
(Remember that Perl flattens all arguments and return values into a
single list.) It can also be used to reduce the amount of memory needed
to invoke a sub since you pass only a reference to an array instead of
the array itself. It allows you to make changes directly to the original
array.

Probably the most useful application of references is creating arbitrary
complex data structures such as lists of lists, hashes of hashes, lists
of hashes, etc. This is an extremely powerful tool.

You can use them to control access to data, to create anonymous
arrays/hashes/subroutines, to create objects... At first, it might not
seem apparent what references are good for, but after you start learning
about them you'll find that they're immensely useful in a hundred
different ways.

-mjc


------------------------------

Date: Tue, 10 Apr 2001 16:44:07 +0100
From: "Raymund Hofmann" <RAY_electronic_design@t-online.de>
Subject: Re: Using References
Message-Id: <9av69e$cfn$06$1@news.t-online.com>

Dear lou moron,

You discovered it correctly, references are completely useless. They are in
some sense similar to most of the equipment in a garage - you don't die if
everything of it is gone (Powerdrill's, charger's, hometrainer's etc.).
But that is only half of the truth.
If you decide to become Member of the DNRC (of which i am the Leader), just
by paying the initial member fee you will instantly be enlighted and
understand what everything in this world is for.

Dogbert

"Lou Moran" <lmoran@wtsg.com> schrieb im Newsbeitrag
news:qav5dts37g3v1i4qel1or5kopfnblcmhc2@4ax.com...
> --Been writing Perl stuff again (mostly for Sys Admining) and I was
> reading my books and while I am not confused as to how references work
> I am wondering what I would use them for.
>
> --In Johnson's book (which I find the easiest to read (find stuff) he
> has an excellent example of how references work:
>
> my $outer;
> {
> my $inner = 42;
> $outer = \$inner;
> }
> print "$$outer\n" ; #prints 42
>
> Makes perfect sense.
>
> Why would I do this?  When would this be useful?
>
> --
> print "\x{263a}"




------------------------------

Date: Tue, 10 Apr 2001 10:02:48 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Using References
Message-Id: <slrn9d64k8.4c7.tadmc@tadmc26.august.net>

Lou Moran <lmoran@wtsg.com> wrote:

>--Been writing Perl stuff again (mostly for Sys Admining) and I was
>reading my books and while I am not confused as to how references work
>I am wondering what I would use them for.


You need to know references if you want to:

   1) pass/return multiple aggregate data types (hashes/arrays)
      to/from subroutines.

   2) pass large data structures to/from subroutines efficiently.

   3) construct multi-level data structures (eg. 2-D array).

   4) do OO programming in Perl.
   
among other reasons.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 10 Apr 2001 11:00:12 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Using References
Message-Id: <lr76dtgt4uf9opsuimjcojegmmk1v9hi4p@4ax.com>

On Tue, 10 Apr 2001 16:44:07 +0100, "Raymund Hofmann"
<RAY_electronic_design@t-online.de> wrote wonderful things about
sparkplugs:

>Dear lou moron,
>
SNIP

Moron, see now no one has bothered with that one since the fourth
grade...  Lou Moran Pie, now that was funny... Moron is kind of tired.
I hope you can do better next time. 

PS--You spell your own name wrong.  Now scurry along and be stupid
somewhere else.

--
print "\x{263a}" 


------------------------------

Date: Tue, 10 Apr 2001 10:11:09 -0300
From: Alessandro <alessandro.augusto@br.bosch.com>
Subject: Re: win32: *.pl > *.exe howto
Message-Id: <3AD3066C.9FFABFC8@br.bosch.com>

I think Johnathan, that it works to you because you have the interpretor
Perl
instaled on that machine.

When you install perl, the files with the extension .pl are linked to
Perl.exe.
Try to remove or change Perl.exe´s name and see if still working? I
haven´t
test this, but I think it won´t work.

Alessandro

Jonathan Stowe wrote:

> alexander gausa <alexander.gausa@gmx.de> wrote:
> > hi!
> > i want to generate an exe-file from an pl-file.
> >
>
> renaming the file works for me.
>



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 667
**************************************


home help back first fref pref prev next nref lref last post