[24477] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6659 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 7 09:06:00 2004

Date: Mon, 7 Jun 2004 06:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 7 Jun 2004     Volume: 10 Number: 6659

Today's topics:
    Re: [Q] how to debug perl compiled with -g flag? <tassilo.parseval@rwth-aachen.de>
    Re: ActiveState Perl mangles text files <Joe.Smith@inwap.com>
        Convert unicode string to "basic characters" <ppagee@yahoo.com>
    Re: Convert unicode string to "basic characters" <jurgenex@hotmail.com>
    Re: Convert unicode string to "basic characters" <ppagee@yahoo.com>
    Re: Convert unicode string to "basic characters" <calle@cyberpomo.com>
    Re: Convert unicode string to "basic characters" <jurgenex@hotmail.com>
    Re: Convert unicode string to "basic characters" <ppagee@yahoo.com>
    Re: Cute bit of Perl to Assign $1,$2 to named variables <bik.mido@tiscalinet.it>
    Re: Cute bit of Perl to Assign $1,$2 to named variables <bik.mido@tiscalinet.it>
    Re: Delete a line out of a flat file database <Joe.Smith@inwap.com>
    Re: Delete a line out of a flat file database <Joe.Smith@inwap.com>
    Re: Delete a line out of a flat file database <ebohlman@omsdev.com>
    Re: Delete a line out of a flat file database (Anno Siegel)
        grab output shell (Andrea Spitaleri)
    Re: grab output shell <bernard.el-haginDODGE_THIS@lido-tech.net>
    Re: Memory problem with XML::DOM::Parser??? <usenet@morrow.me.uk>
        No-install Perl Interpretor <mick.lan@laposte.net>
    Re: No-install Perl Interpretor <jack_challen@ocsl.co.uk>
    Re: perl and assembly <bik.mido@tiscalinet.it>
    Re: perl and assembly <jurgenex@hotmail.com>
    Re: perl and serail port an win maschine <ebohlman@omsdev.com>
    Re: row to column conversion problem (Anno Siegel)
    Re: row to column conversion problem <noreply@gunnar.cc>
    Re: row to column conversion problem (Anno Siegel)
    Re: status of in/out board automatically change upon lo <ebohlman@omsdev.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 7 Jun 2004 08:28:26 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: [Q] how to debug perl compiled with -g flag?
Message-Id: <2iig8eFnnmi6U1@uni-berlin.de>

Also sprach kj:

> I know how to debug C programs, but I could use some advice on how
> to debug perl (as a C program, that is, not by using perl -d, so
> that I can go into subs coded in C).  Does anyone know of a tutorial
> showing how one does this?

You debug it the same way as any other C program:

ethan@ethan:~$ gdb Projects/installed-perls/perl/pAfY0xH/perl-5.8.0@22901/bin/perl
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) set args -e 'sub DESTROY { 1 for my @alarms } \
  $server->{foo} = bless []; \
  delete $server->{foo} for $server->{foo}, undef; \
'
(gdb) run
Starting program:
/home/ethan/Projects/installed-perls/perl/pAfY0xH/perl-5.8.0@22901/bin/perl
-e 'sub DESTROY { 1 for my @alarms } $server->{foo} = bless []; delete
$server->{foo} for $server->{foo}, undef;'

Program received signal SIGSEGV, Segmentation fault.
0x400f7755 in chunk_alloc () from /lib/libc.so.6
(gdb) bt
#0  0x400f7755 in chunk_alloc () from /lib/libc.so.6
#1  0x400f75ce in malloc () from /lib/libc.so.6
#2  0x080ba5fe in Perl_safesysmalloc (size=1008) at util.c:67
#3  0x080dbbf7 in S_more_sv () at sv.c:322
#4  0x080e61c6 in Perl_newSV (len=0) at sv.c:5293
#5  0x080ce03c in Perl_newAV () at av.c:355
#6  0x080a3c46 in Perl_pad_push (padlist=0x8197eb0, depth=9359, has_args=1) at pad.c:1565
#7  0x080da6b3 in Perl_pp_entersub () at pp_hot.c:2688
#8  0x08063ee1 in S_call_body (myop=0xbf800300, is_eval=0) at perl.c:2158
#9  0x08063b61 in Perl_call_sv (sv=0x8197ea4, flags=150) at perl.c:2079
#10 0x080e74a7 in Perl_sv_clear (sv=0x818a0c0) at sv.c:5880
#11 0x080e7e42 in Perl_sv_free2 (sv=0x818a0c0) at sv.c:6148
#12 0x080e79f4 in Perl_sv_clear (sv=0x8197e50) at sv.c:5978
#13 0x080e7e42 in Perl_sv_free2 (sv=0x8197e50) at sv.c:6148
#14 0x08108452 in Perl_leave_scope (base=168452) at scope.c:750
#15 0x0810641c in Perl_pop_scope () at scope.c:137
#16 0x08111277 in Perl_pp_leaveloop () at pp_ctl.c:1871
#17 0x080ba0fa in Perl_runops_debug () at dump.c:1564
#18 0x08063ef6 in S_call_body (myop=0xbf800680, is_eval=0) at perl.c:2161
#19 0x08063b61 in Perl_call_sv (sv=0x8197ea4, flags=150) at perl.c:2079
[...]
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) break Perl_call_sv
Breakpoint 1 at 0x806356c: file perl.c, line 1990.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
[...]
Breakpoint 1, Perl_call_sv (sv=0x8197ea4, flags=150) at perl.c:1990

1990        dSP;
(gdb) call Perl_sv_dump(sv)
SV = PVCV(0x8195ad0) at 0x8197ea4
  REFCNT = 2
  FLAGS = ()
  IV = 0
  NV = 0
  COMP_STASH = 0x8189fe8        "main"
  START = 0x818dea0 ===> 0
  ROOT = 0x818df80
  XSUB = 0x0
  XSUBANY = 0
  GVGV::GV = 0x8197ed4  "main" :: "DESTROY"
  FILE = "-e"
  DEPTH = 0
  FLAGS = 0x0
  OUTSIDE_SEQ = 0
  PADLIST = 0x8197eb0
  OUTSIDE = 0x818a1ec (MAIN)
(gdb) n
1994        volatile I32 retval = 0;
(gdb) etc...

So you fire up the debugger on the perl executables. After that you set
the execution arguments. For 'gdb' this is done with 'set args'. You
pass it any parameters that perl usually receives such as

(gdb) set args -MCGI=:all -e 'print header("text/html")'

or for running a script in a file

(gdb) set args script.pl

And then you can do the usual debugging stuff, like setting break
points, executing code in the current context, looking at nice
backtracks etc.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Mon, 07 Jun 2004 08:08:04 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: ActiveState Perl mangles text files
Message-Id: <EnVwc.63098$Ly.35917@attbi_s01>

Mothra wrote:

> Sorry I must have misunderstood your first response.  I was taught on a 
> training course a couple of years ago that using IO::File->new was the 
> best method for opening files.

With perl version 5.6.0 or later, the best method is to use the
three-argument open and lexical variables (or any variable whose value
is undef at the time of the open).

   open my $inputhandle,  '<', $filename or die "...";
   open my $outputhandle, '>', ' this file has leading and trailing spaces ';
   open my $loghandle,   '>>', $logname or warn "open($logname) $!";

No more prepending "./" or appending "\0" for file names with blanks.
	-Joe


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

Date: Mon, 07 Jun 2004 07:43:05 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Convert unicode string to "basic characters"
Message-Id: <ca0va1$o5l$1@planja.arnes.si>

Hi!

How can I convert characters in unicode string to their
"basic characters"? All those "a with ..." and "o with ...".

I tryed with Unicode::Normalize:

$string = NFD($string);
$string =~ s/\pM//og;

But the problem is for example with U+00D8 (O with stroke), D+0110 (D 
with stroke), U+0141 (L with stroke)...


Mike


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

Date: Mon, 07 Jun 2004 05:46:57 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Convert unicode string to "basic characters"
Message-Id: <ljTwc.6580$po3.5695@nwrddc03.gnilink.net>

Mike Mimic wrote:
> How can I convert characters in unicode string to their
> "basic characters"? All those "a with ..." and "o with ...".

And what would you use as the "basic character" for those Farsi, Korean,
Chinese, Arabic, Hebrew, Vietnamese and dozens and dozens of other
characters?
Unicode encompasses almost all of the commonly spoken languages on earth.

jue




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

Date: Mon, 07 Jun 2004 09:12:34 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Re: Convert unicode string to "basic characters"
Message-Id: <ca14hr$s89$1@planja.arnes.si>

Hi!

J=FCrgen Exner wrote:
> Mike Mimic wrote:
> And what would you use as the "basic character" for those Farsi, Korean=
,
> Chinese, Arabic, Hebrew, Vietnamese and dozens and dozens of other
> characters?

I would leave them as they are. I would like to convert only thoose
which are "combined".


Mike


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

Date: Mon, 07 Jun 2004 09:59:09 +0200
From: Calle Dybedahl <calle@cyberpomo.com>
Subject: Re: Convert unicode string to "basic characters"
Message-Id: <86y8mz4x4i.fsf@ulthar.bisexualmenace.org>

>>>>> "Mike" == Mike Mimic <ppagee@yahoo.com> writes:

> I would leave them as they are. I would like to convert only thoose
> which are "combined".

That just doesn't work. In Swedish (for example), ö is not an accented
o, it's a letter entirely of its own. Changing the first for the
second will have drastic semantic consequences, like for example
changing the word for "to hear" ("höra") into the word for "whore" ("hora").

If you really want to destroy information in your strings, I think
that the most honest way is to replace everything you can't (or don't
want to) handle by question marks or something else that makes it
really obvious that you've deleted stuff.
-- 
		     Calle Dybedahl <calle@cyberpomo.com>
		 http://www.livejournal.com/users/cdybedahl/
     "Last week was a nightmare, never to be repeated - until this week"
				-- Tom, a.s.r


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

Date: Mon, 07 Jun 2004 12:43:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Convert unicode string to "basic characters"
Message-Id: <_pZwc.13780$QI2.1490@nwrddc02.gnilink.net>

Mike Mimic wrote:
[Converting non-ASCII to ASCII characters]
> Jürgen Exner wrote:
>> Mike Mimic wrote:
>> And what would you use as the "basic character" for those Farsi,
>> Korean, Chinese, Arabic, Hebrew, Vietnamese and dozens and dozens of
>> other characters?
>
> I would leave them as they are. I would like to convert only thoose
> which are "combined".

What do you mean by "combined"? I can't tell how much you know about other
languages.
But if you are talking about "accented characters", are you aware that often
those are different characters, not just pronounciation marks (as e.g. in
Arabic)? Like are you sure, that you want to convert e.g. Österreich (=
Austria) into Osterreich (= Easter empire)?

jue




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

Date: Mon, 07 Jun 2004 14:59:25 +0200
From: Mike Mimic <ppagee@yahoo.com>
Subject: Re: Convert unicode string to "basic characters"
Message-Id: <ca1os6$eqh$1@planja.arnes.si>

Hi!

Calle Dybedahl wrote:
> That just doesn't work. In Swedish (for example), =F6 is not an accente=
d
> o, it's a letter entirely of its own. Changing the first for the
> second will have drastic semantic consequences, like for example
> changing the word for "to hear" ("h=F6ra") into the word for "whore" ("=
hora").
>=20
> If you really want to destroy information in your strings, I think
> that the most honest way is to replace everything you can't (or don't
> want to) handle by question marks or something else that makes it
> really obvious that you've deleted stuff.

OK, you have convinced me. I will replace them with '?'.

But I am still curious. Is it possible? And how?


Mike


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

Date: Mon, 07 Jun 2004 12:52:25 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Cute bit of Perl to Assign $1,$2 to named variables
Message-Id: <vng8c0llnq1gotrdaork171h13asqnvqr3@4ax.com>

On Sat, 5 Jun 2004 17:31:19 +0000 (UTC), J Krugman
<jkrugman345@yahbitoo.com> wrote:

>>Hey guys I surrender!!!
>
>I hear you, zzapper!  I love reading clpm, but one thing that has
>always puzzled me about it is all the gratuitous aggressiveness
>one comes accross here.  It's peculiar to clpm; I don't detect
>anything like it in other computer language newsgroups that I read.

Well, I can understand your feelings and I agree that occasionally
"bursts" of gratuitous aggressiveness with potentially negative
effects do arise.

But I didn't see much aggressiveness and I don't think that is the
case wrt this particular post/thread.

I must say that I was surprised myself to see the OP's publicizing his
supposedly amazing discovery that AFAICT is one that everybody having
to do with perl is likely to make say, in the very first few days of
coding... and I was tempted to write my own "So what?"-followup too!
(But then I found out that there were so many, already!)

BTW: I do not consider myself an expert coder by I can't even remember
those days when I didn't know "this kind of things"... so definitely
I'd say that it is indeed *strange*, what the OP wrote in the first
place.


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Mon, 07 Jun 2004 12:52:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Cute bit of Perl to Assign $1,$2 to named variables
Message-Id: <o7h8c0ln1anf6kh711r75juu7orn7302s8@4ax.com>

On 6 Jun 2004 11:08:30 -0700, david@tvis.co.uk (zzapper) wrote:

>> On Usenet, a certain level of aggressiveness seems to go with a healthy,
>> interesting group.  I can't say that I like it myself, but I have
>> never found it otherwise.
>
>I don't find taking a bit of flak, in any case a few more people know
>about this particular feature of Perl than did before. Someone with no
>posting rights emailed me to say  that though he thought himself
>experienced, he hadn't known about this feature.
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As of my other post, I'd consider *that* the astonishing bit of your
"discovery"... (no offense intended, sincerely!)

>Thanx to Gnari for explaining that is was only a special case for $_

Again, how is it possible that you had overlooked that for so many
years?!?

>How about some of the people in this thread posting a few of their
>Perl tit-bits

Huh?!? I'm not sure I understand what a tit-bit is, but if you mean
"cool feature of perl you were astonished to discover", then I'd list

(i) the possibility of putting perl code (hooks) directly into @INC;
(ii) the possibility of open()ing "in memory" and anonymous temporary
files;
(iii) err, well, I'm sure there was something else that eludes me for
the moment... ;-)


HTH,
Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Mon, 07 Jun 2004 08:30:08 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Delete a line out of a flat file database
Message-Id: <jIVwc.53811$3x.7585@attbi_s54>

Paul Lalli wrote:

> On Fri, 4 Jun 2004, Kevin Collins wrote:
> 
>>In article <c9q3p1$9cb$1@wisteria.csv.warwick.ac.uk>, Ben Morrow wrote:
>>>Don't put "\n" on the end of die messages.
>>
>>Why not? It isn't needed and I never do
> 
> Because putting "\n" suppresses useful information.  Without a "\n", the
> die function will output not only its argument string, but also the file
> and line number on which the die occurred.  Adding the "\n" in there makes
> you lose this information.

That additional information is completely useless to the end user.
   1) Leave out the trailing \n for messages that tell the programmer
      there is a bug in the program that needs to be fixed.
   2) Put in the \n for messages that tell the user that he/she entered
      something wrong and should try again.

	-Joe


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

Date: Mon, 07 Jun 2004 08:33:43 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Delete a line out of a flat file database
Message-Id: <GLVwc.53816$3x.7233@attbi_s54>

Joe Smith wrote:

> That additional information is completely useless to the end user.
>   1) Leave out the trailing \n for messages that tell the programmer
>      there is a bug in the program that needs to be fixed.
>   2) Put in the \n for messages that tell the user that he/she entered
>      something wrong and should try again.

I should have also stated my position on "\n" in die() and warn() is:
   Do include \n when you're working with tainted values.
	-Joe


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

Date: 7 Jun 2004 09:11:35 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Delete a line out of a flat file database
Message-Id: <Xns95012B5B7531Debohlmanomsdevcom@130.133.1.4>

Ben Morrow <usenet@morrow.me.uk> wrote in 
news:c9q3p1$9cb$1@wisteria.csv.warwick.ac.uk:

> You *must* use locking in a situation like this, or you will end up with
> a corrupted database. Something like:
> 
> use Fcntl qw/:flock/;
> 
> {
>     open my $OLD, '<', ...;
>     flock $OLD, LOCK_SH or die "can't acquire read lock: $!";
>     # read stuff
> }
> # $OLD closes here, lock is released

At which point someone else who runs the script can now read the file, and 
it will be identical to what you have...

> 
> if ($found) {
>     open my $NEW, '>', ...;
>     flock $NEW, LOCK_EX or die "can't acquire write lock: $!";
>     # write stuff
> }

But the two array contents won't be identical at this point (unless both 
users deleted the same item), so one of them will win and the other will 
lose.

> # ditto for $NEW
> 
> Alternatively, you could open the file '+<' and then lock it LOCK_EX,
> and truncate it rather than closing/reopening.

Which solves the problem.  In a "read and update" situation you can't 
afford to release the lock in between.


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

Date: 7 Jun 2004 09:21:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Delete a line out of a flat file database
Message-Id: <ca1c1u$npj$1@mamenchi.zrz.TU-Berlin.DE>

Joe Smith  <Joe.Smith@inwap.com> wrote in comp.lang.perl.misc:
> Paul Lalli wrote:
> 
> > On Fri, 4 Jun 2004, Kevin Collins wrote:
> > 
> >>In article <c9q3p1$9cb$1@wisteria.csv.warwick.ac.uk>, Ben Morrow wrote:
> >>>Don't put "\n" on the end of die messages.
> >>
> >>Why not? It isn't needed and I never do
> > 
> > Because putting "\n" suppresses useful information.  Without a "\n", the
> > die function will output not only its argument string, but also the file
> > and line number on which the die occurred.  Adding the "\n" in there makes
> > you lose this information.
> 
> That additional information is completely useless to the end user.
>    1) Leave out the trailing \n for messages that tell the programmer
>       there is a bug in the program that needs to be fixed.
>    2) Put in the \n for messages that tell the user that he/she entered
>       something wrong and should try again.

That takes care of errors by the end user and errors by the programmer.

A module also has an intermediate user, the author of a module or script
that uses the given module.  Errors on this level should normally be
treated by croak() from Carp.pm, which (tries to) report an error from
the caller's perspective.  croak() is never usefully called with a
trailing line feed, since the modified error location is the only
difference to die().

Together with the choice whether to die or just to warn this can make
the decision of how to treat a particular situation non-trivial.

Anno


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

Date: 7 Jun 2004 02:35:23 -0700
From: spiritelllo@interfree.it (Andrea Spitaleri)
Subject: grab output shell
Message-Id: <4de1519a.0406070135.f74871c@posting.google.com>

Hi
how do I grab the output from shell after system?
I have a program which print out some information on the shell before
give you the prompt, something like that:

bash>program
so far so good...
version 2.1
help file program -h
program>

I would like to grab these lines before I get the prompt "program>"
and check for the versione. I tought that the below script could work
but it doesn't (that's normal because I am reading the output after
the system call):

#!/usr/bin/perl 

use warnings;
use strict;


system "rasmol > out ";  
open (OUT,"out") or die " $! ";
while(<OUT>){
    chomp; 
    if (/^Version/) {
	my @version=split;
	if ($version[1]eq "2.7.2.1"){
	    exit;
	}
    }
}
I think that I need something more dynamic...:)
cheers

and


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

Date: Mon, 7 Jun 2004 12:05:27 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: grab output shell
Message-Id: <Xns95017B447A1elhber1lidotechnet@62.89.127.66>

spiritelllo@interfree.it (Andrea Spitaleri) wrote:

> Hi
> how do I grab the output from shell after system?


perldoc -q "Why can't I get the output of a command with system()?"


-- 
Cheers,
Bernard


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

Date: Mon, 7 Jun 2004 05:01:57 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Memory problem with XML::DOM::Parser???
Message-Id: <ca0ss5$sdp$1@wisteria.csv.warwick.ac.uk>


Quoth markus.mohr@mazimoi.de:
> On Sun, 6 Jun 2004 03:52:10 +0000 (UTC), Ben Morrow
> <usenet@morrow.me.uk> wrote:
> 
> >Quoth markus.mohr@mazimoi.de:
> >> 
> >> Now, here is the code, and that's prety all I have to master.
> >> 
> >> Do you think there is anything to do about rwriting this piece of code
> >> for XML::LibXML2?
> >
> >All of this stuff will be the same with XML::LibXML, once you have your
> >CXML object using the same DOM library.
> >
> >In theory, as the DOM provides a specification of the methods etc., you
> >should simply be able to switch 'XML::LibXML' for 'XML::DOM' throughout
> >and it'll all be fine... it won't, of course (life's never that simple),
> >but the changes required shouldn't be major.
> 
> Okay, Ben, thank you very much. Here is the complete code for
> "CXML.pm" for your interest. Of course, it contains XML::DOM
> statements.
> 
> Can you have a look at this file as well?

No, *you* look at it. AFAICS, there is very little in there that won't
work if you simply change 'XML::DOM' to 'XML::LibXML' throughout. When
you've done this, and fixed the obvious differences (e.g. LibXML takes
the xml version and encoding in the document constructor rather than in
a separate method call) *then* post back if you have any insurmountable
problems, with a *SMALL* complete example showing what it is you can't
figure out.

Ben

-- 
Musica Dei donum optimi, trahit homines, trahit deos.    |
Musica truces molit animos, tristesque mentes erigit.    |   ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras.        |


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

Date: Mon, 07 Jun 2004 13:45:42 +0200
From: Micla <mick.lan@laposte.net>
Subject: No-install Perl Interpretor
Message-Id: <ca1kh4$vkt$1@s1.read.news.oleane.net>


Would anybody know a Perl version usable without any prior installation?

One of the goals foreseen for it would be to have some "personal" 
scripts on a USB memory key, immediately usable on any computer that I 
have the opportunity to go on.

But there are also other reasons to try to use Perl scripts without 
installing Perl previously.

Thank's for any help.

Me.


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

Date: Mon, 07 Jun 2004 12:56:36 +0100
From: Jack Challen <jack_challen@ocsl.co.uk>
Subject: Re: No-install Perl Interpretor
Message-Id: <8KYwc.1$Y%1.167@psinet-eu-nl>

Micla wrote:
> 
> Would anybody know a Perl version usable without any prior installation?

You could look at tinyperl. I think it'll allow you to turn .pl files into 
  binaries executable by windows directly as well.


http://tinyperl.sourceforge.net/


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

Date: Mon, 07 Jun 2004 10:40:56 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl and assembly
Message-Id: <32r5c0d63uf1980cqpqqcd2asu4u8o2rto@4ax.com>

[followup crossposted to comp.lang.perl.misc]


On Sat, 5 Jun 2004 13:34:27 -0400, "Bill Cunningham"
<nospam@nspam.net> wrote:

>    How can one write an assembler in Perl? I know CPU address would have to
>be queried.

How can one ask such a question in comp.lang.perl.tk?!?
                                                  ^^
                                                  ^^

Michele
-- 
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


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

Date: Mon, 07 Jun 2004 12:49:32 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: perl and assembly
Message-Id: <wvZwc.13833$QI2.1773@nwrddc02.gnilink.net>

> On Sat, 5 Jun 2004 13:34:27 -0400, "Bill Cunningham"
> <nospam@nspam.net> wrote:
>
>>    How can one write an assembler in Perl? I know CPU address would
>> have to be queried.

You would write it just like any other compiler:
- define your source language, then write the syntax analysis, the context
analysis (luckily for assembler languages this is typically very simple),
and then the coding phase.

Do you have a Perl question, too?

jue




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

Date: 7 Jun 2004 08:44:31 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: perl and serail port an win maschine
Message-Id: <Xns950126C4D674Aebohlmanomsdevcom@130.133.1.4>

Xaver Biton <javier@t-online.de> wrote in news:c9n96f$nkh$01$1@news.t-
online.com:

> I'd like to use perl to comunicate via serial port with a ISDN telephon 
> switschboard, I'm running XP Professional and perl 5.8 activestate, but 
> the maschine on  which  the final progam should run is a win 2000 pro.
> 
> I searched the active state directory an I found a Device-SerialPort 
> modul, but when I try to install it I recieve a message error from the 
> ppm program which say :
> Error: PPD for "Device-SerialPort.pm" could not be found.

Device::SerialPort is Unix-only.  In fact, it's a Unix port of 
Win32::SerialPort, which is Win32-specific.  So you should be using the 
latter.


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

Date: 7 Jun 2004 08:47:58 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: row to column conversion problem
Message-Id: <ca1a3u$mfp$1@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> kuldeep wrote:
> > Problem statement
> > 
> > Input from a file
> > 
> >   010101
> >   110010    
> >   010101
> >   
> > 
> >    to
> > 
> >   010
> >   111
> >   000
> >   101
> >   010
> >   101
> > 
> >   i.e. Row to column conversion
> 
>      my @rows;
>      while (<FH>) {
>          my $i = 0;
>          $rows[$i++] .= $_ for split //;
>      }

You forgot to chomp the lines.

Anno


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

Date: Mon, 07 Jun 2004 12:23:43 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: row to column conversion problem
Message-Id: <2iiu1eFmntpcU1@uni-berlin.de>

Anno Siegel wrote:
> Gunnar Hjalmarsson wrote:
>> 
>>     my @rows;
>>     while (<FH>) {
>>         my $i = 0;
>>         $rows[$i++] .= $_ for split //;
>>     }
> 
> You forgot to chomp the lines.

Yes, I did. Thanks!

     my @rows;
     while (<FH>) {
         chomp;
         my $i = 0;
         $rows[$i++] .= $_ for split //;
     }

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: 7 Jun 2004 10:54:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: row to column conversion problem
Message-Id: <ca1hi3$rm3$1@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > Gunnar Hjalmarsson wrote:
> >> 
> >>     my @rows;
> >>     while (<FH>) {
> >>         my $i = 0;
> >>         $rows[$i++] .= $_ for split //;
> >>     }
> > 
> > You forgot to chomp the lines.
> 
> Yes, I did. Thanks!
> 
>      my @rows;
>      while (<FH>) {
>          chomp;
>          my $i = 0;
>          $rows[$i++] .= $_ for split //;
>      }

Speaking of chomp reminds me of chop:

    chomp( my @lines = <DATA>);
    my @cols;
    unshift @cols, join( '', map chop, @lines) while length $lines[ 0];

Anno


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

Date: 7 Jun 2004 08:57:54 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: status of in/out board automatically change upon login
Message-Id: <Xns95012909C6BFAebohlmanomsdevcom@130.133.1.4>

Ben Morrow <usenet@morrow.me.uk> wrote in 
news:c9q1ai$7ad$3@wisteria.csv.warwick.ac.uk:


> Not at all easily. To do so would require users to install a program to
> run at login/out which contacted your website... you would have to write
> this program,

Yes.

> probably in C(++) (or maybe VBS?) as I doubt your users
> would want to install Perl.

Which won't be necessary, now that PAR and pp exist.


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 6659
***************************************


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