[12135] in Perl-Users-Digest
Perl-Users Digest, Issue: 5735 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 20 15:07:20 1999
Date: Thu, 20 May 99 12:00:16 -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 Thu, 20 May 1999 Volume: 8 Number: 5735
Today's topics:
Re: best way to database stuff using Perl? <cassell@mail.cor.epa.gov>
Re: Binary image file reading or $x as a number. <jdporter@min.net>
Re: Binary image file reading or $x as a number. (Larry Rosler)
Re: conditional regexp matching. Please advise. (Larry Rosler)
Re: evalling __END__ and <DATA> <d-edwards@nospam.uchicago.edu>
Re: FAQ 4.68: How do I handle binary data correctly? <cassell@mail.cor.epa.gov>
Re: FAQ 4.70: How do I keep persistent data across prog <bwaite@uswest.com>
Re: File Opening Problem <frutchey@usc.edu>
Re: Is it a file or a link? (Randal L. Schwartz)
Re: MS WORD97 Macro Question - off-topic (Michel Dalle)
open() function... <pumpkin@nowhere.com>
Re: Perl "constructors" <jdporter@min.net>
Perl Unicode/Multibyte Support <farmernet@my-dejanews.com>
Re: Perl Unicode/Multibyte Support <tchrist@mox.perl.com>
Re: Perl Unicode/Multibyte Support (Ilya Zakharevich)
perlcc prob:undefined reference to `boot_DynaLoader' <kbw@negia.net>
problems compiling ePerl saaron@slip.net
This script is broken..Please help <portboy@home.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 20 May 1999 10:53:10 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: best way to database stuff using Perl?
Message-Id: <37444C06.81F79C10@mail.cor.epa.gov>
Bart Lateur wrote:
>
> Michiel Verhoef wrote:
>
> >True, but that's largely a management thing: the inital costs of NT are lower
> >(cheaper hardware mainly), which is what most non-IT managers look at.
>
> Huh? I thought Linux and Free-BSD both run on ordinary PC hardware, so
> where's that difference?
But Bart, all good IS managers know this:
"Microsoft.. good. Free things without support contracts.. bad"
Just think of George Bush (Sr.) saying it, and you'll get
the feel for it. :-)
Thank G@d I have a manager who actually has linux and Perl on
a home machine!
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 20 May 1999 18:14:01 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Binary image file reading or $x as a number.
Message-Id: <7i1jd6$aa3$1@nnrp1.deja.com>
In article <7hvqau$15r$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> my $byteMe = getc INFILE;
> my $byte2 = unpack("C",$byteMe);
> print sprintf "%x", $byte2;
Instead of unpack, you could use ord:
$b = ord($c);
It has the same effect (or did for me, at least),
and is about 25% faster in my benchmarks.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 20 May 1999 11:38:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Binary image file reading or $x as a number.
Message-Id: <MPG.11adf69b7fb6a08d989ace@nntp.hpl.hp.com>
In article <7i1jd6$aa3$1@nnrp1.deja.com> on Thu, 20 May 1999 18:14:01
GMT, John Porter <jdporter@min.net> says...
> In article <7hvqau$15r$1@nnrp1.deja.com>,
> armchair@my-dejanews.com wrote:
> > my $byteMe = getc INFILE;
> > my $byte2 = unpack("C",$byteMe);
> > print sprintf "%x", $byte2;
>
> Instead of unpack, you could use ord:
> $b = ord($c);
> It has the same effect (or did for me, at least),
> and is about 25% faster in my benchmarks.
You are right about ord() instead of unpack 'C' (which seems to be a
carrryover from Perl 4). However, for compactness, speed, correctness
(two hex digits guaranteed), and clarity, one should use:
print unpack 'H', getc INFILE;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 20 May 1999 10:10:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: conditional regexp matching. Please advise.
Message-Id: <MPG.11ade1e7a0ae5272989acd@nntp.hpl.hp.com>
In article <37453b0c.21045722@news.skynet.be> on Thu, 20 May 1999
16:44:10 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Ravi Kumar wrote:
> > I have to read in hex numbers specifiable either as 0xffffffff or
> >fffffffh.
> >but not both. I cannot exhaustively try all combinations with several
> >regexps. How can I do this with one regexp ?
>
> /^(?:0x[0-9A-Fa-f]+|[0-9A-Fa-f]+h)$/
>
> but I really can't see what's wrong with
>
> /^0x[0-9A-Fa-f]+$/ or /^[0-9A-Fa-f]+h$/
In a useful snippet, this wouldn't be only a Boolean test but also a
capture of the value.
if (/ ^0x ([0-9A-F]+) $ | ^ ([0-9A-F]+) h$ /ix)
{ ... Do something with $+ ... }
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 20 May 1999 18:10:50 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: evalling __END__ and <DATA>
Message-Id: <tg675ny5lh.fsf@noise.bsd.uchicago.edu>
"Stephen Warren" <swarren@www.wwwdotorg.org> writes:
> <jed@glug.hip.berkeley.edu> wrote in message
> news:m3aev2bab8.fsf@glug.hip.berkeley.edu...
> >
> > Hi, ho.
> >
> > I'm trying to slurp some perl code out of another file and run it. If
> > I eval this code, it halts at an __END__ without reading any DATA. For
> > example, if I run this script:
> >
> > open (FILE,"file");
> >
> > while (<FILE>) {
> > $code .= $_; # this is simplified for the sake of example
> > }
> > eval $code;
>
> This won't help your root problem much, but the eval can always be written:
>
> eval <FILE> || die "Some error message: $@" ;
>
> Which looks even better(!) for STDIN:
>
> eval <> || die "" ;
>
> I don't _think_ you'll get much joy out of what you're trying to do,
> unfortunately. Perhaps you might try converting the code you're eval()ing
> into a module, where it should work. Or maybe require() it?
Why not just
do 'file';
?
Darrin
------------------------------
Date: Thu, 20 May 1999 10:33:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 4.68: How do I handle binary data correctly?
Message-Id: <3744474C.8ED235FC@mail.cor.epa.gov>
Ronald J Kimball wrote:
>
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> > In article <3742da5c@cs.colorado.edu> on 19 May 1999 09:35:56 -0700, Tom
> > Christiansen <perlfaq-suggestions@perl.com> says...
>
> [...]
>
> > > On some legacy systems, however, you have to play tedious games
> > > with "text" versus "binary" files. See the section on "binmode" in
> > > the perlfunc manpage, or the upcoming the perlopentut manpage
> > > manpage.
> >
> > <RANT>
> >
> > I guess I'll keep harping on this until the Perl writers and teachers
> > change their attitudes and their approach to this question. The proper
> > -- dare I say 'mature' -- answer is:
> >
> > Use the "binmode" function immediately after opening the file.
>
> I agree. Perl is a multi-platform programming language. The
> documentation should be multi-platform as well.
I also agree.. but I think that if anyone wants changes in the
docs, that person should be submitting revisions to Tom.
Preferably well-written submissions, with enough surrounding
material to make the incorporation of the new material easy.
Granted, there are irritating features in win32 [if I may be
permitted a euphemism, Tom]. But ranting and sniping about
them in the docs only makes the Perl community appear to be
the sort of uncooperative fringe movement that many IS shops
want to believe it to be. Entertainment in the docs is
terrific [remember the shell-to-perl program called 'Tom
Christiansen'? :-], but sniping serves little purpose.
Perl is mature and helpful. I think that at the very least
we should aspire to be likewise.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 20 May 1999 11:34:35 -0600
From: Brad Waite <bwaite@uswest.com>
Subject: Re: FAQ 4.70: How do I keep persistent data across program calls?
Message-Id: <374447AB.CEC5E918@uswest.com>
Tom Christiansen wrote:
> How do I keep persistent data across program calls?
>
> For some specific applications, you can use one of the DBM modules.
> See the AnyDBM_File manpage. More generically, you should consult
> the FreezeThaw, Storable, or Class::Eroot modules from CPAN. Here's
> one example using Storable's `store' and `retrieve' functions:
>
> use Storable;
> store(\%hash, "filename");
>
> # later on...
> $href = retrieve("filename"); # by ref
> %hash = %{ retrieve("filename") }; # direct to hash
>
I guess I need a little more hand-holding.
I've tried to use Storeable, FreezeThaw and Eroot all with no luck whatsoever.
If I freeze an object and then thaw it in the same program, everything's fine.
When I store it using IPC::ShareLite, and then fetch it in another program, I
dump core. Here's some snippets:
# Program 1
use GD;
use IPC::ShareLite;
$share = new IPC::ShareLite( -key=>'Joe', -create=>1, -destroy=>0);
open(GIF, "/tmp/pic.gif");
$pic = newFromGif GD::Image(GIF);
close GIF;
$frozen = freeze($pic);
$share->store($frozen);
# Program 2
use GD;
use IPC::ShareLite;
$share = new IPC::ShareLite( -key=>'Joe', -create=>1, -destroy=>0);
$frozen = $share->fetch;
$pic = thaw($frozen);
print $pic->gif;
Results: seg faults and dumps core.
Every variation I've tried produces the same result. Can anyone see why this
isn't working?
------------------------------
Date: Thu, 20 May 1999 11:11:20 -0700
From: Brian Frutchey <frutchey@usc.edu>
Subject: Re: File Opening Problem
Message-Id: <37445048.E8ACA01C@usc.edu>
Thanks everyone! I didn't know the perl documentation was so complete. It
was the data tainting, so I ran the data through a regular expression and
now all is well. Thanks again!
Ronald J Kimball wrote:
> Brian Frutchey <frutchey@usc.edu> wrote:
>
> > But suddenly, all of my scripts which use
> > write mode
> > are giving me the error "Insecure dependency in open while running
> > setgid at
> > .../.../... line ...".
>
> When you get an error message in Perl you are unsure about, you should
> refer to the perldiag documentation:
>
> Insecure dependency in %s
>
> (F) You tried to do something that the tainting mechanism didn't
> like. The tainting mechanism is turned on when you're running setuid
> or setgid, or when you specify -T to turn it on explicitly. The
> tainting mechanism labels all data that's derived directly or
> indirectly from the user, who is considered to be unworthy of your
> trust. If any such data is used in a "dangerous" operation, you get
> this error. See in the perlsec manpage for more information.
>
> The perlsec documentation will tell you how to untaint your data.
>
> --
> _ / ' _ / - aka -
> ( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
> / http://www.tiac.net/users/chipmunk/
> "It's funny 'cause it's true ... and vice versa."
--
____________________________________________________________________
_/_/_/ _/ _/ _/ _/ Brian Frutchey
_/ _/ _/ _/_/ _/ IHV Engineering
_/_/_/ _/ _/ _/ _/ _/ Alternate Platforms Group
_/ _/ _/ _/ _/_/ (310) 348-6082
_/_/_/ _/_/_/ _/ _/ http://www-scf.usc.edu/~frutchey
M I C R O S Y S T E M S
------------------------------
Date: 20 May 1999 10:32:20 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Is it a file or a link?
Message-Id: <m17lq3d4uz.fsf@halfdome.holdit.com>
>>>>> "Andrew" == Andrew Allen <ada@fc.hp.com> writes:
Andrew> : If efficiency is your concern, then the perldoc that details
Andrew> : either the function stat, or -f/-l etc should mention the
Andrew> : implicit file _ (IIRC) that effectively stores the result of
Andrew> : the last stat() (or -f etc IIRC) so you might get away with
Andrew> : something like:
Andrew> : if ( -f $filename && ! -l _ )
Andrew> : Anyway, the above syntax may be way off, but it's there in
Andrew> : the docs.
Andrew> Nope. -l needs lstat. -f uses stat. What you did provides the
Andrew> handy error message:
Andrew> The stat preceding -l _ wasn't an lstat at -e line 1.
Right idea, wrong order:
for (qw(/home/merlyn /etc /etc/passwd /home/merlyn/bin/perl)) {
if (! -l $_ and -f _) {
print "$_ is a natural file\n";
}
}
Which correctly reported that /etc/passwd was the only natural file
there of respectively a symlink-to-directory, directory, file,
symlink-to-file. (Yes, my home directory is a symlink. :)
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 20 May 1999 17:54:48 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: MS WORD97 Macro Question - off-topic
Message-Id: <7i1i80$ilb$1@news.mch.sbs.de>
In article <7i1efh$ins$1@fcnews.fc.hp.com>, "Derald Powell" <derald_powell@hp.com> wrote:
>After recording a word97 macro, how do you make it availabe for execution by
>a perl script.
>I know this THE perl newsgroup, but I can't find a word newsgroup, nor
>information on accessing
>word scripts. Any help appreceiated. You can send replies to
Have a look at your Perl documentation, and specifically at the ActivePerl FAQ
'Using OLE with Perl'. Have you tried 'Run' yet ?
Michel.
------------------------------
Date: Thu, 20 May 1999 10:29:16 -0700
From: "Mr. Pumpkin" <pumpkin@nowhere.com>
Subject: open() function...
Message-Id: <vHX03.41973$134.370026@tor-nn1.netcom.ca>
Is there anyway for the open function to open a file using an absolute
http:// url?
eg. open (ORDER, http://www.site.com/order/index.html")
What I want to do is change the url from http:// to https:// as soon as a
person requests the order form. All pages, although .html files, are
filtered through a cgi shopping cart script... I tried using a redirect
using the Location: tags, but it is too late by that point for it to be
interpreted... any suggestions?
Thanks,
Forest Johns
fdjohns@home.com
------------------------------
Date: Thu, 20 May 1999 18:34:26 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7i1kjh$b7k$1@nnrp1.deja.com>
In article <7ht7kc$6hi$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> In the case of where you had a reference to a base class A, and it was
a
> B, you would normally just call functions in both A and B, but yes, if
> you were able to determine it was a B, and then cast it to a reference
> to a B, you could call B functions that were not a part of A. So you
> need a IsA type function to determine is a derived class is possibly
> being referred to by a base class reference (or pointer).
> If ( A.IsA() == "B" )
> {
> B & r= (B&) A;
> r.bar();
> }
>
> So even though C++ records don't need to be checked for fields being
> present, unlike hashes, if presented with a C++ base class in a
> hierarchy, you may have to check it's type in some occasions.
Right. Consider that the distinction between data members and methods
is neglible under this question. Does this object -- which I know is
at least an A, and might be of some descendent of A -- have a certain
property (data or method) which is NOT a part of A? To answer it,
you have to do some kind of type inquiry. In Perl, you can ask
isa( a, B ), but you could also ask about the particular method,
without caring about the class: can( a, foo ). Perl, unlike C++,
also allows you to inquire about the presence of "fields", using
exists.
> The real question is, what is a Perl programmer doing with Meyer's
book?
Well, the simple answer is, I was a C++ programmer before I was a
Perl programmer, and I can't throw anything out.
But more relevantly, Meyers' book contains a lot of great info
which is applicable in other languages besides C++.
(Um, you know I'm referring to "Effective C++", by Scott Meyers, right?
I don't care much for Bertrand Meyer, except as a quotable authority.)
--
John Porter
Put it on a plate, son. You'll enjoy it more.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 20 May 1999 17:34:41 GMT
From: Farmer Net <farmernet@my-dejanews.com>
Subject: Perl Unicode/Multibyte Support
Message-Id: <7i1h3h$8fu$1@nnrp1.deja.com>
I am doing research on Perl's Multibyte capabities. I found information
about perllocale, internationalization, localization and so on. We are
trying decide whether to use Java or Perl to handle international
languages to publish to international websites (Japan, Chinese, and
European countries).
Is Perl the right choice? What are the risks involved if we were to
choose Perl for internationalization.
Most of our code is in Perl, however, we are considering moving towards
Java.
Any help will be appreciated.
Thanks
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 20 May 1999 11:54:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <37444c45@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Farmer Net <farmernet@my-dejanews.com> writes:
:I am doing research on Perl's Multibyte capabities. I found information
:about perllocale, internationalization, localization and so on. We are
:trying decide whether to use Java or Perl to handle international
:languages to publish to international websites (Japan, Chinese, and
:European countries).
Did you read this:
NAME
utf8 - Perl pragma to turn on UTF-8 and Unicode support
SYNOPSIS
use utf8;
no utf8;
DESCRIPTION
The utf8 pragma tells Perl to use UTF-8 as its internal string
representation for the rest of the enclosing block. (The "no utf8"
pragma tells Perl to switch back to ordinary byte-oriented processing
for the rest of the enclosing block.) Under utf8, many operations that
formerly operated on bytes change to operating on characters. For
ASCII data this makes no difference, because UTF-8 stores ASCII
in single bytes, but for any character greater than `chr(127)',
the character is stored in a sequence of two or more bytes, all of
which have the high bit set. But by and large, the user need not
worry about this, because the utf8 pragma hides it from the user. A
character under utf8 is logically just a number ranging from 0 to
2**32 or so. Larger characters encode to longer sequences of bytes,
but again, this is hidden.
Use of the utf8 pragma has the following effects:
* Strings and patterns may contain characters that have an
ordinal value larger than 255. Presuming you use a Unicode
editor to edit your program, these will typically occur directly
within the literal strings as UTF-8 characters, but you can
also specify a particular character with an extension of the
`\x' notation. UTF-8 characters are specified by putting the
hexadecimal code within curlies after the `\x'. For instance,
a Unicode smiley face is `\x{263A}'. A character in the Latin-1
range (128..255) should be written `\x{ab}' rather than `\xab',
since the former will turn into a two-byte UTF-8 code, while the
latter will continue to be interpreted as generating a 8-bit
byte rather than a character. In fact, if -w is turned on, it
will produce a warning that you might be generating invalid UTF-8.
* Identifiers within the Perl script may contain Unicode
alphanumeric characters, including ideographs. (You are currently
on your own when it comes to using the canonical forms of
characters--Perl doesn't (yet) attempt to canonicalize variable
names for you.)
* Regular expressions match characters instead of bytes. For
instance, "." matches a character instead of a byte. (However,
the `\C' pattern is provided to force a match a single byte
("`char'" in C, hence `\C').)
* Character classes in regular expressions match characters
instead of bytes, and match against the character properties
specified in the Unicode properties database. So `\w' can be
used to match an ideograph, for instance.
* Named Unicode properties and block ranges make be used as
character classes via the new `\p{}' (matches property) and
`\P{}' (doesn't match property) constructs. For instance,
`\p{Lu}' matches any character with the Unicode uppercase
property, while `\p{M}' matches any mark character. Single letter
properties may omit the brackets, so that can be written `\pM'
also. Many predefined character classes are available, such as
`\p{IsMirrored}' and `\p{InTibetan}'.
* The special pattern `\X' match matches any extended Unicode
sequence (a "combining character sequence" in Standardese), where
the first character is a base character and subsequent characters
are mark characters that apply to the base character. It is
equivalent to `(?:\PM\pM*)'.
* The `tr///' operator translates characters instead of bytes. It
can also be forced to translate between 8-bit codes and UTF-8
regardless of the surrounding utf8 state. For instance, if you
know your input in Latin- 1, you can say:
use utf8;
while (<>) {
tr/\0-\xff//CU; # latin1 char to utf8
...
}
Similarly you could translate your output with
tr/\0-\x{ff}//UC; # utf8 to latin1 char
No, `s///' doesn't take /U or /C (yet?).
* Case translation operators use the Unicode case translation
tables. Note
that `uc()' translates to uppercase, while `ucfirst' translates
to titlecase (for languages that make the distinction). Naturally
the corresponding backslash sequences have the same semantics.
* Most operators that deal with positions or lengths in the
string will
automatically switch to using character positions, including
`chop()', `substr()', `pos()', `index()', `rindex()', `sprintf()',
`write()', and `length()'. Operators that specifically don't
switch include `vec()', `pack()', and `unpack()'. Operators
that really don't care include `chomp()', as well as any other
operator that treats a string as a bucket of bits, such as
`sort()', and the operators dealing with filenames.
* The `pack()'/`unpack()' letters "`c'" and "`C'" do *not*
change, since
they're often used for byte-oriented formats. (Again, think
"`char'" in the C language.) However, there is a new "`U'"
specifier that will convert between UTF-8 characters and
integers. (It works outside of the utf8 pragma too.)
* The `chr()' and `ord()' functions work on characters. This is like
`pack("U")' and `unpack("U")', not like `pack("C")' and
`unpack("C")'. In fact, the latter are how you now emulate
byte-oriented `chr()' and `ord()' under utf8.
* And finally, `scalar reverse()' reverses by character rather
than by byte.
CAVEATS
As of yet, there is no method for automatically coercing input and
output to some encoding other than UTF-8. This is planned in the
near future, however.
In any event, you'll need to keep track of whether interfaces to
other modules expect UTF-8 data or something else. The utf8 pragma
does not magically mark strings for you in order to remember their
encoding, nor will any automatic coercion happen (other than that
eventually planned for I/O). If you want such automatic coercion,
you can build yourself a set of pretty object-oriented modules. Expect
it to run considerably slower than than this low-level support.
Use of locales with utf8 may lead to odd results. Currently there
is some attempt to apply 8-bit locale info to characters in the
range 0..255, but this is demonstrably incorrect for locales that
use characters above that range (when mapped into Unicode). It will
also tend to run slower. Avoidance of locales is strongly encouraged.
--
"What is the sound of Perl? Is it not the sound of a wall that
people have stopped banging their heads against?"
--Larry Wall in <1992Aug26.184221.29627@netlabs.com>
------------------------------
Date: 20 May 1999 17:59:29 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <7i1ii1$c7s$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Christiansen
<tchrist@mox.perl.com>],
who wrote in article <37444c45@cs.colorado.edu>:
> Did you read this:
>
> NAME
> utf8 - Perl pragma to turn on UTF-8 and Unicode support
>
> SYNOPSIS
> use utf8;
> no utf8;
>
> DESCRIPTION
> The utf8 pragma tells Perl to use UTF-8 as its internal string
> representation for the rest of the enclosing block. (The "no utf8"
Keep in mind that apparently *nobody* did ever tried to use it
(judging by the obvious bugs I see in the implementation, and a
complete absense of bug reports).
Ilya
P.S. Finally I found out at least one way to try out and *see*
the UTF-8 strings on Solaris. See my posts to tcl group about UTF-8.
------------------------------
Date: Thu, 20 May 1999 13:56:31 -0400
From: Kevin Weinrich <kbw@negia.net>
Subject: perlcc prob:undefined reference to `boot_DynaLoader'
Message-Id: <37444CCE.DF25254E@negia.net>
(If there is a better group/mailinglist for perlcc, *please* let me
know)
I can't compile a Hello, World! script using perlcc. Any tips?
Perl: 5.005_56 (Devel) (which compiled, tested, installed fine)
CC: gcc 2.7.2.3 (as shipped on...)
OS: Redhat Linux 5.1.5
Hardware: Pentium 233MMX
> perlcc hw.p -log hw.log -verbose 63
======= hw.p ==============
#!/usr/bin/perl
print "Hello, world!\n";
======= end hw.p ===========
======= hw.log =============
--------------------------------------------------------------------------------
Compiling hw.p:
--------------------------------------------------------------------------------
Making C(hw.p.c) for hw.p!
perl -I/usr/lib/perl5/5.00556/i586-linux -I/usr/lib/perl5/5.00556
-I/usr/lib/perl5/site_perl/5.00556/i586-linux
-I/usr/lib/perl5/site_perl/5.00556 -I. -MO=CC,-ohw.p.c hw.p
hw.p syntax OK
Prescan
Saving methods
Compiling C(hw) for hw.p!
perl -I/usr/lib/perl5/5.00556/i586-linux -I/usr/lib/perl5/5.00556
-I/usr/lib/perl5/site_perl/5.00556/i586-linux
-I/usr/lib/perl5/site_perl/5.00556 -I. /tmp/hw.p.tst
cc -Dbool=char -DHAS_BOOL -O2 -I/usr/lib/perl5/5.00556/i586-linux/CORE
/usr/lib/perl5/5.00556/i586-linux/auto/Fcntl/Fcntl.so
/usr/lib/perl5/5.00556/i586-linux/auto/IO/IO.so -o hw hw.p.c
-L/usr/local/lib -L/usr/lib/perl5/5.00556/i586-linux/CORE -lperl -lnsl
-lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
hw.p.c: In function `perl_init':
hw.p.c:272: warning: assignment from incompatible pointer type
/tmp/cca116051.o: In function `xs_init':
/tmp/cca116051.o(.text+0x8d1): undefined reference to `boot_DynaLoader'
ERROR: In compiling code for hw.p.c !
======== end hw.log ===============
Thanks for any help.
Kevin Weinrich
------------------------------
Date: Thu, 20 May 1999 18:14:47 GMT
From: saaron@slip.net
Subject: problems compiling ePerl
Message-Id: <7i1jek$aah$1@nnrp1.deja.com>
Email replies, please.
I've been asked to compile ePerl for use with a web product.
perl Makefile.PL runs fine, but "make" results in the following error
message:
# make
r libeperl.a eperl_parse.so eperl_pp.so eperl_http.so
eperl_version.so
sh: r: not found
*** Error code 1
make: Fatal error: Command failed for target `libeperl.a'
Current working directory /var/tmp/eperl-2.2.14
*** Error code 1
make: Fatal error: Command failed for target `all'
Any ideas? I'm not sure what this command "r" is supposed to be.
I've written the author, but haven't heard anything yet and thought I'd
throw this out there.
Thanks,
SEAN
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 20 May 1999 18:24:56 GMT
From: Mitch <portboy@home.com>
Subject: This script is broken..Please help
Message-Id: <3743E3AE.163F7D2C@home.com>
Okay, what I'm trying to do is pass some parameters (old_line, new_line,
file, 1or0). to a subroutine I've created. the subroutine is called
replace_line and here's the code:
sub replace_line {
my($old_line,$new_line,$file,$del) = @_;
my($rep) = 0;
system("chmod +w $file");
open(OUT,">$file.bak") || &show("Can't open $file!");
open(FILE,"$file") || &show("Can't open $file!");
while(<FILE>)
{
next if (/$old_line/ && $del);
if (/$old_line/)
{
if ($_ eq "$new_line\n")
{
print OUT;
$rep = -1;
}
else
{
print OUT "$new_line\n";
$rep = 1;
}
next;
}
print OUT;
}
close(FILE);
close(OUT);
system("/bin/mv $file.bak $file");
$rep;
}
Now the file that it will be manipulating will look something like:
foo this;
bar that;
camel boy loves foo bar;
etc.
So, I'm trying to replace 'foo this' with 'foo that' by:
my ($state) = @_;
my $old_line = "foo"; #there can only be one occurrence of foo in
the file
if ($state eq "this" || $state eq "haha")
{
my $foo_update = "$old_line $state";
&replace_line($old_line, $foo_update, $SOME_FILE, 1);
}
else
{
&show("$state not recognized. Must be 'enable' or
'disable'\n");
}
Now when i run this little bad boy, it seems to wipe out my file and
leave nothing. What the heck is going on?
Thanks, Mitch.
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5735
**************************************