[30567] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1810 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 21 14:09:51 2008

Date: Thu, 21 Aug 2008 11:09:14 -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           Thu, 21 Aug 2008     Volume: 11 Number: 1810

Today's topics:
        better way to fetch and install packages than just a bu <edwardjameshartnett@gmail.com>
        Change subject (was: Re: Score files) <rvtol+news@isolution.nl>
    Re: CLPM - a help group? <john@castleamber.com>
    Re: Help: Characters with colors <usenet@larseighner.com>
    Re: Help: Debug perl codes <tzz@lifelogs.com>
    Re: Help: Filehandle problem <tadmc@seesig.invalid>
    Re: Help: Filehandle problem <jurgenex@hotmail.com>
    Re: Help: Filehandle problem <spamtrap@dot-app.org>
        how to report which specific variable is uninitialized <morfysster@gmail.com>
    Re: how to report which specific variable is uninitiali <spamtrap@dot-app.org>
    Re: how to report which specific variable is uninitiali <morfysster@gmail.com>
    Re: how to report which specific variable is uninitiali <ben@morrow.me.uk>
    Re: printing two consecutive lines <cartercc@gmail.com>
    Re: printing two consecutive lines <spamtrap@dot-app.org>
    Re: Score files (was Re: CLPM - a help group?) <tadmc@seesig.invalid>
        set default value for undefined variables <morfysster@gmail.com>
    Re: set default value for undefined variables <ben@morrow.me.uk>
    Re: The Importance of Terminology's Quality (Rob Warnock)
        Unable to debug Perl script <neokrish@gmail.com>
    Re: Unable to debug Perl script <Peter@PSDT.com>
    Re: Unable to debug Perl script <smallpond@juno.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 21 Aug 2008 07:12:44 -0700 (PDT)
From: Ed <edwardjameshartnett@gmail.com>
Subject: better way to fetch and install packages than just a bunch of system  calls?
Message-Id: <ba680124-f0bf-4e28-933c-af6cbe2651c9@y38g2000hsy.googlegroups.com>

Howdy all!

As part of a test script, I have to make sure my test machine (i.e.
the machine that is running the script) has libraries zlib and hdf5. I
do that with this code. Is there a better way?

        if ($opt{netcdf4} && ! -e $install_file) {
            copy("/upc/share/ed/downloads/zlib-$
{zlib_version}.tar.gz", $hdf5dir) || die;
            copy("/upc/share/ed/downloads/hdf5-$
{hdf5_version}.tar.gz", $hdf5dir) || die;
            chdir($hdf5dir) || die;
            system("gunzip -f zlib-${zlib_version}.tar.gz");
            system("tar xf zlib-${zlib_version}.tar");
            chdir("zlib-$zlib_version");
            system("./configure --prefix=$hdf5dir");
            system("make install");
            chdir($hdf5dir);
            system("rm -rf zlib-${zlib_version}*");
            system("gunzip -f hdf5-${hdf5_version}.tar.gz");
            system("tar xf hdf5-${hdf5_version}.tar");
            chdir("hdf5-$hdf5_version");
            system("./configure --prefix=$hdf5dir --with-zlib=$hdf5dir
--disable-shared");
            system("make install");
            chdir($hdf5dir);
            system("rm -rf hdf5-${hdf5_version}*");
            system("touch $install_file");
     }

Any comments appreciated!

Thanks,

Ed


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

Date: Thu, 21 Aug 2008 12:52:52 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Change subject (was: Re: Score files)
Message-Id: <g8joma.1is.1@news.isolution.nl>

Tad J McClellan schreef:

The best supported format to change the Subject line is

   New subject (was: old subject)

(see "RFC" 1036)

That format is picked up by many mail and news clients, because the tail
about the old subject is best removed at the next reply.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 21 Aug 2008 13:39:00 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: CLPM - a help group?
Message-Id: <Xns9B0157FCF6750castleamber@130.133.1.4>

Tad J McClellan <tadmc@seesig.invalid> wrote:

> John Bokma <john@castleamber.com> wrote:
>> "Stephan Bour" <sbour@niaid.nih.temp.gov> wrote:
> 
>> *ploink*
> 
> I did that 5 years ago.

I only recently (like 2-3 years ago) started to use a kill file. I should 
have done earlier, that's for sure.

-- 
John    http://johnbokma.com/ - Hacking & Hiking in Mexico

Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html


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

Date: Thu, 21 Aug 2008 11:17:16 +0000 (UTC)
From: Lars Eighner <usenet@larseighner.com>
Subject: Re: Help: Characters with colors
Message-Id: <slrngaqj9d.16lv.usenet@debranded.larseighner.com>

In our last episode, <pan.2008.08.20.14.53.18.781685@gmail.com>, the lovely
and talented Amy Lee broadcast on comp.lang.perl.misc:

> On Wed, 20 Aug 2008 14:40:19 +0000, Lars Eighner wrote:

>> In our last episode, <pan.2008.08.20.14.25.29.189243@gmail.com>, the lovely
>> and talented Amy Lee broadcast on comp.lang.perl.misc:
>> 
>>> open KER_VER, "<", "/root/version";
>>> while (<KER_VER>)
>>> {
>>>   unless (/\s+2.4.\d+/)
>>>   {
>>>     die BOLD RED "Your kernel version is not 2.4.x.\n"
>>>   }
>>> }
>> 
>> 
>>> I hope clean this internal output by perl, how could I do that?
>> 
>>> Thank you very much~
>> 
>> You can write ansi codes directly, but in spite of ansi being 
>> more or less a standard, there are serious portability problems.
>> Some terminals are not ansi capable and others may be quirky.

> Thank you, but it seems that it's for 'print', not for 'die'. How do I
> handle with color when I use 'die'?

Exactly the same.  Again I warn you, this is not at all portable and
may or may not work on your ANSI-enabled terminal and will not work
on your ANSI-ignorant terminal:

============ tear here ===============
#!/usr/bin/perl

unless ( 1 == 0 ) { die ("\e[1;41;37m Gosh numbers still work\e[0m\n") }

============ tear here ================


The point of the module is to determine the terminal capabilities
and alter the string accordingly.  In a non-ANSI terminal, the string
will be printed as you see it above.  The ANSI codes do not contribute
to clarity in a non-ANSI terminal.  I have no idea how or whether the
module can be made to work with die, but if your script is always going
to run in an environment you are certain of, that's how you get color.


Okay, okay, you made me read the man page.  Here is the real way
to do it:

============ tear here ==========================
#!/usr/bin/perl

use Term::ANSIColor;

$boldred = color('bold red');
$reset = color('reset');

unless ( 1 == 0 ) { die ("${boldred}Gosh numbers still work$reset") }

============= tear here ==========================

Evidently you cannot set attributes on the fly with die, but you
can save them as variables, for use as needed.

-- 
Lars Eighner <http://larseighner.com/> usenet@larseighner.com
            War on Terrorism:  The Difference Between Us and Them
         "We should invade their countries, kill their leaders and
                convert them to Christianity." -- Ann Coulter


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

Date: Thu, 21 Aug 2008 09:24:17 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Help: Debug perl codes
Message-Id: <86fxoy8mzy.fsf@lifelogs.com>

On Wed, 20 Aug 2008 20:58:34 -0400 "Thrill5" <nospam@somewhere.com> wrote: 

T> Isn't one of the great things about a newsgroup is that your CAN use
T> this newsgroup as a service to read the docs for you?  

If you don't seek knowledge on your own, no amount of external help will
make you a better programmer (or better at anything else).

Ted


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

Date: Thu, 21 Aug 2008 05:58:26 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Help: Filehandle problem
Message-Id: <slrngaqiii.jvm.tadmc@tadmc30.sbcglobal.net>

Amy Lee <openlinuxsource@gmail.com> wrote:

> I want to process the output of a program. Anyway, the output is showing
> on screen. 


How are you executing the process?

By using Perl's system() function perhaps?

If so, then let me read the docs to you yet again:

   perldoc -f system

      ... This is I<not> what you want to use to capture
      the output from a command, for that you should use...


> Is there any way to process it by using file handle? 


Yes, though there is an easier way, as above, without using a filehandle.

    perldoc -f external

        How can I capture STDERR from an external command?

        There are three basic ways of running external commands:

            system $cmd;                # using system()
            $output = `$cmd`;           # using backticks (``)
            open (PIPE, "cmd |");       # using open()


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Thu, 21 Aug 2008 11:32:02 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Help: Filehandle problem
Message-Id: <udkqa45c1rl1mo7gt3sakguba53hrtsiql@4ax.com>

Tad J McClellan <tadmc@seesig.invalid> wrote:

>    perldoc -f external

Tad, you are really getting old :-)

	No documentation for perl function 'external' found

>        How can I capture STDERR from an external command?

s/-f/-q/

jue


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

Date: Thu, 21 Aug 2008 12:12:31 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Help: Filehandle problem
Message-Id: <m1d4k2gxe8.fsf@dot-app.org>

Amy Lee <openlinuxsource@gmail.com> writes:

> I want to process the output of a program. Anyway, the output is
> showing on screen. Is there any way to process it by using file
> handle?

Have a look at the "Pipe Opens" section in "perldoc perlopentut" for a
much better explanation than I could write here.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 21 Aug 2008 09:37:55 -0700 (PDT)
From: Morfys <morfysster@gmail.com>
Subject: how to report which specific variable is uninitialized
Message-Id: <4d976bda-38af-426a-b1ac-ccfb6c890760@f36g2000hsa.googlegroups.com>

Hi,

When running perl with the -w option, and executing a "print'" with
about 30 variables, I get

Use of uninitialized value in print at at ./temp.pl line 9.

Is there any way to make perl report the exact variable name (out of
the 30) that is not initialized?

' use diagnostics;' doesn't help.

For various reasons, writings 30 statements of the form
defined ($var) or warn "var is undefined";
is difficult/a pain in my case.

Thanks.


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

Date: Thu, 21 Aug 2008 12:53:26 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: how to report which specific variable is uninitialized
Message-Id: <m1k5eaqph5.fsf@dot-app.org>

Morfys <morfysster@gmail.com> writes:

> When running perl with the -w option, and executing a "print'" with
> about 30 variables, I get
>
> Use of uninitialized value in print at at ./temp.pl line 9.
>
> Is there any way to make perl report the exact variable name (out of
> the 30) that is not initialized?
>
> ' use diagnostics;' doesn't help.

Are you using strict? That requires you to declare your variables
before using them, so it will tell you if the "unitialized"
variable is really a variable whose name you've misspelled in the
call to print().

> For various reasons, writings 30 statements of the form
> defined ($var) or warn "var is undefined";
> is difficult/a pain in my case.

Honestly, I don't see why. Sure, it would be a pain to write all that
boilerplate all the time, but doing it once for debugging purposes
shouldn't be too much of a chore. It's just pasting the same line 30
times and then editing the variable names. Unless you're using some
sort of assistive input technology that's very time-consuming, it
shouldn't take more than a few minutes to do that kind of edit.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 21 Aug 2008 10:00:46 -0700 (PDT)
From: Morfys <morfysster@gmail.com>
Subject: Re: how to report which specific variable is uninitialized
Message-Id: <22324669-9aa0-4b29-891c-fcdcf06d4dd4@k13g2000hse.googlegroups.com>

On Aug 21, 6:53=A0pm, Sherm Pendley <spamt...@dot-app.org> wrote:
> Morfys <morfyss...@gmail.com> writes:
> > When running perl with the -w option, and executing a "print'" with
> > about 30 variables, I get
>
> > Use of uninitialized value in print at at ./temp.pl line 9.
>
> > Is there any way to make perl report the exact variable name (out of
> > the 30) that is not initialized?
>
> > ' use diagnostics;' doesn't help.
>
> Are you using strict? That requires you to declare your variables
> before using them, so it will tell you if the "unitialized"
> variable is really a variable whose name you've misspelled in the
> call to print().

Yes, I am using strict.  The variables have all been declared.

> > For various reasons, writings 30 statements of the form
> > defined ($var) or warn "var is undefined";
> > is difficult/a pain in my case.
>
> Honestly, I don't see why. Sure, it would be a pain to write all that
> boilerplate all the time, but doing it once for debugging purposes
> shouldn't be too much of a chore.

Ok, I just thought there might some cool way to do it in perl with one
line. ;)


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

Date: Thu, 21 Aug 2008 17:52:14 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: how to report which specific variable is uninitialized
Message-Id: <u2j0o5-si2.ln1@osiris.mauzo.dyndns.org>


Quoth Morfys <morfysster@gmail.com>:
> Hi,
> 
> When running perl with the -w option, and executing a "print'" with
> about 30 variables, I get
> 
> Use of uninitialized value in print at at ./temp.pl line 9.
> 
> Is there any way to make perl report the exact variable name (out of
> the 30) that is not initialized?

    ~% perl5.8.8 -we'my $x; print $x'
    Use of uninitialized value in print at -e line 1.
    ~% perl5.10.0 -we'my $x; print $x'
    Use of uninitialized value $x in print at -e line 1.

See if you can upgrade to 5.10.0.

Ben

-- 
   If you put all the prophets,   |   You'd have so much more reason
   Mystics and saints             |   Than ever was born
   In one room together,          |   Out of all of the conflicts of time.
ben@morrow.me.uk                                    The Levellers, 'Believers'


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

Date: Thu, 21 Aug 2008 06:59:24 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: printing two consecutive lines
Message-Id: <717dcde5-e586-47dd-92f8-797bb5a81250@a1g2000hsb.googlegroups.com>

On Aug 20, 8:08=A0pm, icebrakers2...@gmail.com wrote:
> I need to print whole line which starts with 'Endpoint' =A0- But this
> line is spread in two lines as shown above, I want to print this in
> the same line. The whole file contains thousands of similar lines. =A0I
> could able to print the line by searching "Endpoint" - but it only
> gives half the line and other half is in next line, which I am not
> able to print.

Set a flag that by default is false, turns to true when it hits
'Endpoint:' and turns to false when it hits the next 'Beginpoint:' and
print if $flag

#!/usr/bin/perl
use strict;
my $flag =3D 0;

open INFILE, "<test.txt" or die "Can't open: $!";
while (<INFILE>)
{
   if ($_ =3D~ /^Endpoint:/ and $flag =3D=3D 0) {$flag =3D 1; }
   elsif ($_ =3D~ /Beginpoint:/ and $flag =3D=3D 1) {$flag =3D 0; }
   print if $flag;
}
close INFILE;
exit;


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

Date: Thu, 21 Aug 2008 12:19:02 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: printing two consecutive lines
Message-Id: <m18wuqgx3d.fsf@dot-app.org>

cartercc <cartercc@gmail.com> writes:

> Set a flag that by default is false, turns to true when it hits
> 'Endpoint:' and turns to false when it hits the next 'Beginpoint:' and
> print if $flag
>
> #!/usr/bin/perl
> use strict;
> my $flag = 0;
>
> open INFILE, "<test.txt" or die "Can't open: $!";
> while (<INFILE>)
> {
>    if ($_ =~ /^Endpoint:/ and $flag == 0) {$flag = 1; }
>    elsif ($_ =~ /Beginpoint:/ and $flag == 1) {$flag = 0; }
>    print if $flag;
> }

Why reinvent the wheel? Perl already has a built-in flip-flop operator
that does exactly what you describe:

    while (<INFILE>) {
        print if ( /^Endpoint:/ .. /^Beginpoint:/ );
    }

Details can be found in "perldoc perlop", under "Range Operators".

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 20 Aug 2008 20:19:28 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Score files (was Re: CLPM - a help group?)
Message-Id: <slrngapgl0.fhn.tadmc@tadmc30.sbcglobal.net>

sln@netherlands.com <sln@netherlands.com> wrote:
> On Wed, 20 Aug 2008 17:54:55 -0500, Tad J McClellan <tadmc@seesig.invalid> wrote:
>
>>Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>>>> "TJMcC" == Tad J McClellan <tadmc@seesig.invalid> writes:
>>>
>>>    TJMcC> John Bokma <john@castleamber.com> wrote:
>>>
>>>     >> *ploink*
>>>
>>>    TJMcC> I did that 5 years ago.
>>>
>>> In the case of people who change their From line, how do you handle it?
>>
>>
>>Once they've revealed their willingness to change identities,
>>I usually make multiple entries in slrn's scorefile in addition
>>to the literal one that was already in there:
>>
>>   % does not read docs for function being used
>>   %    eg: capture output from system()
>>   % or uses groups as a "read the docs to me" service
>>   Score:: -9998
>>           From: sbour@niaid.nih.gov
>>           From: sbour@
>>           From: Stephan Bour
>
> Please don't referece this as a continuation of "CLPM - a help group"


This _is_ a continuation of "CLPM - a help group".


> in which you actually intend to carry on the thread in a similar, not
> to removed fashion.


Why not?


> You appear to be starting a new thread on how you make a KILL scorefile
> strike right through the heart in a permanent way.


Not much gets past you, that's for sure!


> On the subject line, why do you lead people into thinking this has to do with
> the "Perl help group?" thread when it doesen't???


I don't lead people into thinking this has to do with
the "Perl help group?" thread when it doesen't.

I lead people into thinking that is has to do with scorefiles.

That is why I edited the Subject header.


> Please title your personal software "Kill" tactics appropriately!


I've already done that.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Thu, 21 Aug 2008 09:56:17 -0700 (PDT)
From: Morfys <morfysster@gmail.com>
Subject: set default value for undefined variables
Message-Id: <4c913d57-d315-4dbc-b8cb-71da53d3e61c@25g2000hsx.googlegroups.com>

Is there a way to set the default value for undefined variables?  For
example, in

my ($a, $b) = (split(/\s+/, $mytext))[0,1]

sometimes mytext will contain two (or more) words, and sometimes it
will contain only 1.  In the latter case, I would like $b to be
initialized to "" not undef.

I have many statements (>60) of the above form with different
variables, and initializing
each variable $a = ""; b = ""; is a pain.  Thanks.



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

Date: Thu, 21 Aug 2008 18:08:51 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: set default value for undefined variables
Message-Id: <32k0o5-ad3.ln1@osiris.mauzo.dyndns.org>


Quoth Morfys <morfysster@gmail.com>:
> Is there a way to set the default value for undefined variables?  For
> example, in

No, there isn't.

> my ($a, $b) = (split(/\s+/, $mytext))[0,1]
> 
> sometimes mytext will contain two (or more) words, and sometimes it
> will contain only 1.  In the latter case, I would like $b to be
> initialized to "" not undef.

In many cases you can get the effect you want with

    no warnings 'uninitialized';

which will cause Perl to stop shouting at you about undefs. It will
silently convert them into '' in string context and 0 in numeric.

> I have many statements (>60) of the above form with different
> variables, and initializing
> each variable $a = ""; b = ""; is a pain.  Thanks.

If you really have all that, consider writing a sub which provides your
desired defaults.

Ben

-- 
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~                   Jorge Luis Borges, 'The Babylon Lottery'


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

Date: Thu, 21 Aug 2008 09:11:48 -0500
From: rpw3@rpw3.org (Rob Warnock)
Subject: Re: The Importance of Terminology's Quality
Message-Id: <RpadnQoEdeU56jDVnZ2dnUVZ_oninZ2d@speakeasy.net>

sln@netherlands.com> wrote:
+---------------
| rpw3@rpw3.org (Rob Warnock) wrote:
| >In the LGP-30, they used hex addresses, sort of[1], but the opcodes
| >(all 16 of them) had single-letter mnemonics chosen so that the
| >low 4 bits of the character codes *were* the correct nibble for
| >the opcode!  ;-}
 ...
| >[1] The LGP-30 character code was defined before the industry had
| >    yet standardized on a common "hex" character set, so instead of
| >    "0123456789abcdef" they used "0123456789fgjkqw". [The "fgjkqw"
| >    were some random characters on the Flexowriter keyboard whose low
| >    4 bits just happened to be what we now call 0xa-0xf]. Even worse,
| >    the sector addresses of instructions were *not* right-justified
| >    in the machine word (off by one bit), plus because of the shift-
| >    register nature of the accumulator you lost the low bit of each
| >    machine word when you typed in instructions (or read them from
| >    tape), so the address values you used in coding went up by *4*!
| >    That is, machine locations were counted [*and* coded, in both
| >    absolute machine code & assembler] as "0", "4", "8", "j", "10",
| >    "14", "18", "1j" (pronounced "J-teen"!!), etc.
| 
| Whats os interresting about all this hullabaloo is that nobody has
| coded machine code here, and know's squat about it.
+---------------

Think again! *BOTH* of the two examples I gave -- for the LGP-30 & the
IBM 1410 -- *WERE* raw machine code, *NOT* assembler!!! Please read again
what I wrote about the character codes for the instruction mnemonics
*BEING* the machine instruction codes. For the IBM 1410, the bootstrap
code that ones types in:

    v         v
    L%B000012$N

*IS* raw machine code, *NOT* assembler!! [See my previous post for
the meaning of the fields of that instruction.] The IBM 1410 is a
*character* machine, not a binary machine, so each memory location is
a (6+1 bit) character. As a result, one can [and *must*, during bootup!]
type absolute machine code directly into memory using the console
typewriter [an only-slightly-modified IBM Selectric, as it happens].
The fact that -- for the sake of user convenience -- the hardware
supports manual entry of machine code into memory by the operator
in a form that closely *resembles* assembler (but *ISN'T*!) was a
deliberate design feature.

Similarly, the characters you type for the LGP-30's opcodes *ARE* the
opcodes, at least by the time they get into the machine, since when
typing in code (or reading it from paper tape) one sets the I/O system
to "4-bit input mode", in which the upper bits of the characters are
stripped off by the I/O hardware during input. Thus when you type a
"Bring" (load) instruction such as this ["Bring" (load) location 0xd7c
(track 0xd, sector 0x31)]:

    b0q7j

you're typing *RAW* machine code, *NOT* assembler!!  You see, the
lower 4 bits of character "b" -- the "mnemonic" for "Bring" -- were
binary 0001, the *same* as the lower 4 bits of the digit "1" (and two
other characters as well). So when you typed a "b" in that position
in "4-bit input mode" you were typing the same thing as the character "1"
which was the same thing as *binary* 0001 which was the absolute machine
opcode for the ""Bring" instruction!!  "No assembler required" (pardon
the pun).

+---------------
| I'm not talking assembly language.
+---------------

Neither was I. The fact that for the two machines I mentioned
absolute machine code was somewhat readable to humans seems to
have confused you, but that's the way some people liked to design
their hardware back in those days -- with clever punning of character
codes with absolute machine opcodes (for the convenience of the user).

+---------------
| Don't you know that there are routines that program machine code?
+---------------

What do you mean "routines"?!? For the above two machines, you can
enter machine code with *no* programs ("routines?") running; that is,
no boot ROM is required (or even available, as it happened).

+---------------
| Yes, burned in, bitwise encodings that enable machine instructions?
+---------------

The two machines mentioned above did not *HAVE* a "boot ROM"!!
You had to *manually* type raw, absolute machine code into
them by hand every time you wanted to boot them up [at least
a little bit, just enough to load a larger bootstrap program].

+---------------
| Nothing below that.
+---------------

You're assuming that all machines *have* some sort of "boot ROM".
Before the microprocessor days, that was certainly not always
the case. The "boot ROM", or other methods of booting a machine
without manually entering at least a small amount of "shoelace"
code [enough the *load* the real bootstrap], was a fairly late
invention.


-Rob

p.s. Similarly, the DEC PDP-8 & PDP-11 were also originally booted
by manually toggling the console switches in order to deposit a few
instructions into memory, and then the starting address was toggled
in and "Start" was pushed. It was only later that a boot ROM became
available for the PDP-11 (as an expensive option!) -and only much
later still for the PDP-8 series (e.g., the MI8E for the PDP-8/E).

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607



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

Date: Thu, 21 Aug 2008 04:08:47 -0700 (PDT)
From: Artemis Fowl <neokrish@gmail.com>
Subject: Unable to debug Perl script
Message-Id: <7223d4ef-1723-4b9a-ad0d-d2272764d821@m45g2000hsb.googlegroups.com>

Hello all,

I face a peculiar problem when I try to debug my perl script. This
script is used to fetch values from an excel sheet and print it into
different files. I needed to debug this script. When I do try to
debug, I get this error.

"Bizarre copy of HASH in leave at excel_extract.pl line 114.
 at excel_extract.pl line 114
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info."

I tried searching for help on the net. Couldn't find much information
about it. Seems like a peculiar error.
Does anyone know why this happens? It would be a lot of help if you
could shine some light on this :)

Warm Regards,
Artemis.



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

Date: Thu, 21 Aug 2008 12:14:36 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: Unable to debug Perl script
Message-Id: <pan.2008.08.21.12.14.35.723909@PSDT.com>

On Thu, 21 Aug 2008 04:08:47 -0700, Artemis Fowl wrote
> I face a peculiar problem when I try to debug my perl script. This
> script is used to fetch values from an excel sheet and print it into
> different files. I needed to debug this script. When I do try to
> debug, I get this error.
> 
> "Bizarre copy of HASH in leave at excel_extract.pl line 114.
>  at excel_extract.pl line 114
> I tried searching for help on the net. Couldn't find much information
> about it. Seems like a peculiar error.

This is due to a bug in some C or XS code somewhere, probably in a CPAN
module.  First upgrade to the latest version of everything, including
perl.  If you still get the error, reduce it to the shortest program you
can, preferably under 20 lines, and post it as a bug on rt.perl.org or
just email the author of the most excel-specific module your program uses.
It may not be their fault but you can't be expected to do more unless you
know how.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/



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

Date: Thu, 21 Aug 2008 11:15:00 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: Unable to debug Perl script
Message-Id: <9c664$48ad867e$24141@news.teranews.com>

Peter Scott wrote:
> On Thu, 21 Aug 2008 04:08:47 -0700, Artemis Fowl wrote
>> I face a peculiar problem when I try to debug my perl script. This
>> script is used to fetch values from an excel sheet and print it into
>> different files. I needed to debug this script. When I do try to
>> debug, I get this error.
>>
>> "Bizarre copy of HASH in leave at excel_extract.pl line 114.
>>  at excel_extract.pl line 114
>> I tried searching for help on the net. Couldn't find much information
>> about it. Seems like a peculiar error.
> 
> This is due to a bug in some C or XS code somewhere, probably in a CPAN
> module.  First upgrade to the latest version of everything, including
> perl.  If you still get the error, reduce it to the shortest program you
> can, preferably under 20 lines, and post it as a bug on rt.perl.org or
> just email the author of the most excel-specific module your program uses.
> It may not be their fault but you can't be expected to do more unless you
> know how.
> 

FWIW, google finds a short method of generating this error.

This is perl, v5.8.8 built for i386-linux-thread-multi

perl -Te '@{%h}{x}'
Bizarre copy of HASH in leave at -e line 1.

--S
** Posted from http://www.teranews.com **


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

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 V11 Issue 1810
***************************************


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