[32809] in Perl-Users-Digest
Perl-Users Digest, Issue: 4073 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 9 05:17:38 2013
Date: Sat, 9 Nov 2013 02:17:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 9 Nov 2013 Volume: 11 Number: 4073
Today's topics:
Re: How can I pick a module depending if I have it or n <derykus@gmail.com>
Re: How can I pick a module depending if I have it or n <rweikusat@mobileactivedefense.com>
Re: PDF, Excel, LaTeX, and possibly R and sweave <nospam@lisse.NA>
Re: PDF, Excel, LaTeX, and possibly R and sweave <cartercc@gmail.com>
script to download CoastToCoastAM from iHeartRadio stre <sail0r@example.com>
Re: Several Perl Questions - Nov. 5, 2013 <edgrsprj@ix.netcom.com>
Re: Several Perl Questions - Nov. 5, 2013 <hjp-usenet3@hjp.at>
Re: Several Perl Questions - Nov. 5, 2013 <janek_schleicher@yahoo.de>
Re: Several Perl Questions - Nov. 5, 2013 <sbryce@scottbryce.com>
Re: Several Perl Questions - Nov. 5, 2013 <hjp-usenet3@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 7 Nov 2013 10:51:05 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: How can I pick a module depending if I have it or not?
Message-Id: <a9b9b19d-7732-4cbe-804d-c184cbb6860b@googlegroups.com>
On Wednesday, November 6, 2013 5:09:26 PM UTC-8, C.DeRykus wrote:
> On 11/6/2013 10:27 AM, jl_post@hotmail.com wrote:
>> ...
>
> Maybe a combination of 'use if' and Module::Load::Conditional ...
>
> use Module::Load::Condition qw/check_install/;
>
> our( $m1, $m2 );
> use if $m1=check_install(module=>Device::SerialPort),Device::SerialPort;
>
> use if $m2=check_install(module=>Win32::SerialPort), Win32::SerialPort;
>
> die "This script requires..." unless $m1 or $m2;
>
And to reduce the "yuck" look:
use Module::Load::Condition qw/check_install/;
my $mod1 = check_install(module=>..., ...);
my $mod2 = check_install(module=>..., ...);
die "This script requires..." unless $mod1 or $mod2;
use if $mod1, Device::SerialPort;
use if $mod2, Win32::SerialPort;
--
Charles DeRykus
------------------------------
Date: Fri, 08 Nov 2013 16:44:00 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: How can I pick a module depending if I have it or not?
Message-Id: <878uwyu9m7.fsf@sable.mobileactivedefense.com>
Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
>> "jl_post@hotmail.com" <jl_post@hotmail.com> writes:
[...]
>>> So my question is: How can I use a module if it is installed, or
>>> another if it is not installed?
>>
>> Someone else must have implemented this already but you could use this
>> small module:
>>
>> -------------
>> package Delegate;
[...]
> While this is a neat idea, it won't work with modules which don't define
> or inherit an import method, won't work with OO-modules at all and is
> restricted to a single set of delegations per program.
The last assertion is wrong because while a module will only be loaded
once, it's import method will be called for as many times as there are
use statements naming it. It is also surprisingly easy to make 'OO
modules' work, courtesy of the fact that Perl-OO doesn't work by special
magic but reuses existing language facilities.
This deals with 'bareword modules' only but it can do 'implicit imports'
as this really doesn't require any work minus using the import-mechanism
correctly. The code is open to abuse in many different ways but "in line
with the usual UNIX(*) tradition, it gives you enough rope to hang
yourself" (as opposed to hanging you proactively to make sure you don't
do something someone considers to be stupid for some reason).
package Delegate;
#
# Delegate something to the first module from a set of
# candidate modules which can be loaded.
#
# Usage
# -----
#
# use Delegate (['candidate0', 'candidiate1', ...], 'importsub0', 'importsub1', ...);
#
# Load the first candidate module which can be loaded and import the
# specified subroutines from it.
#
# use Delegate ({ Winner => ['candidate0', 'candidiate1', ...]}, 'importsub0', 'importsub1', ...);
#
# Same as above but additionally, create a package whose name is the
# single key of the anonymous hash passed as first argument
# functioning as class derived from the selected candidate module.
#
sub require_one
{
eval "require $_;" and return $_
for @_;
return;
}
sub import
{
my ($arg0, $candidates, $delegate, $x);
shift;
$arg0 = shift;
if (ref($arg0) eq 'HASH') {
$delegate = (keys(%$arg0))[0];
$candidates = $arg0->{$delegate};
} else {
$candidates = $arg0;
}
$x = require_one(@$candidates);
die("Need one of ".join(',', @$candidates)) unless $x;
eval "package $delegate; our \@ISA = qw($x); 1;"
if $delegate;
if ($x->can('import')) {
unshift(@_, $x);
$x .= '::import';
goto &$x;
}
}
# Because properties of existing things are discovered and not
# invented, this code is in the public domain. Whoever discovers
# a bug in it is entitled to keep it.
1;
------------------------------
Date: Thu, 07 Nov 2013 12:01:52 +0200
From: Dr Eberhard Lisse <nospam@lisse.NA>
Subject: Re: PDF, Excel, LaTeX, and possibly R and sweave
Message-Id: <527B6510.7080206@lisse.NA>
Generating SVG is easy by using the R svg device.
I find that rsvg-convert has a small footprint and produces excellent
results, much better than ImageMagick and as good as Inkscape.
el
on 2013-11-04 17:47 ccc31807 said the following:
> On Sunday, November 3, 2013 3:29:32 PM UTC-5, Mart van de Wege
> wrote:
>> At my previous employer I used to autogenerate reports for our
>> customers using LaTeX::Driver with great success.
>
> Mart,
>
> Thanks very much for your input. Part of my problem is that I
> haven't figured out what I'm supposed to be doing. The largest
> part of my job is to take input (almost always as CSV files) and
> munge them into some kind of output (mostly these days as Excel,
> CSV, or PDF). I /think/ that I will be producing a report with a
> mixture of file formats, including PDF and Excel, with dynamically
> generated graphical elements -- I'm not sure but it looks like
> it's headed this way.
>
> I'm very comfortable generating Excel files and PDF files (with
> PDF::API2). I also like using R and LaTex. I've been casting a
> covetous eye on Sweave but haven't actually used it. And of
> course, I use Perl for the heavy lifing.
>
>> I also used to generate the graphs for those reports using
>> SVG::TT::Graph. Not because SVG was easy to bind into LaTeX
>> (that sucked actually), but because SVG::TT::Graph had a nice API
>> to generate graphs IMO. I used the ImageMagick bindings to
>> convert the output into something that LaTeX would like, and
>> Template Toolkit to fill in the LaTeX documents and generate the
>> links to the graphs.
>
> I like using SVG when I can. Normally, when using LaTeX, I target
> my output images to EPS. EPS works well, but I would really like
> to try SVG. Unfortunately, R is limited in the kinds of graphical
> output formats it has, and I will definitely NOT be using JPEG,
> GIF, BMP, or PNG!
>
>> So, use your favourite graphing module to create your graphics,
>> use TT LaTeX templates to build your documents, and run the
>> output of the processed templates through LaTeX::Driver, that's
>> the way I would do it.
>
> I will give this a great deal of thought. I can auto generate
> graphics, and I can certainly embed them in a PDF module, but I
> think that will be a kludge. I like the idea of Sweave because I
> like the idea of embedding R code in LaTeX, and I really like
> LaTex. I just don't know how this will work with Perl, and the
> bottom line is that Perl is essential for the data munging that
> underlies all the output stuff.
>
> CC.
>
------------------------------
Date: Thu, 7 Nov 2013 09:33:02 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: PDF, Excel, LaTeX, and possibly R and sweave
Message-Id: <c05dae0e-4ab0-4877-a29d-6424d7dc6890@googlegroups.com>
On Thursday, November 7, 2013 5:01:52 AM UTC-5, Dr Eberhard Lisse wrote:
> Generating SVG is easy by using the R svg device.
> I find that rsvg-convert has a small footprint and produces excellent
> results, much better than ImageMagick and as good as Inkscape.
I got started with the project yesterday, and have decided to use Excel::Wr=
iter, PDF::API2, and Statistics::R. I have generally used EPS for my graphi=
cs, but I'll try SVG. I will need to embed the graphics in a PDF file, and =
use epstopdf to convert my EPS graphics to PDF. I guess I'll find out how w=
ell SVG works.
Thanks, CC.
------------------------------
Date: Thu, 07 Nov 2013 23:33:19 -0500
From: sail0r <sail0r@example.com>
Subject: script to download CoastToCoastAM from iHeartRadio streams
Message-Id: <b5655$527c6990$484a174a$23613@news.eurofeeds.com>
This post is to share a small perl script to download radio
shows streamed by radio station websites that use the iHeartRadio
player.
This is the sort of thing I might ordinarily put on github or post
to perlmonks.org, however, I think I'd rather do this more anonymously
via usenet. Hopefully Google's index of usenet groups will point
future interested parties to this post...
Some notes:
-This will work for any radio station if they use the iHeartRadio
player. All that is required is to change the call letters (here they
are whjj) in the RADIO_URL.
-Really, this will download whatever is currently being streamed
when it is run. I wrote this for CoastToCoast and run it via cron when
that show starts. So, if you'd like, run it based on the schedule of
some other show. Just be sure to rename the output file to something
that makes sense. Also, be sure to adjust the record time in the
rtmpdump arguments. Currently that is set to 14400 seconds, the length
of CoastToCoastAM. You may want this to be shorter or longer.
-This is what my current cron job looks like:
0 1 * * * /usr/pkg/bin/perl /home/sail0r/coast2coast.pl > /dev/null 2>&1
-There are lots of comments! Mainly to jog my memory if I want to
come back to this script later, after I have forgotten just what I
was doing. If you want to format the pod you'll need to install
Lip::Pod. Then do something like this:
lip2pod coast2coast.pl | pod2text
Ignore any pod errors. lip2pod is a little buggy and requires some
hacks to get it to work.
That will show you the "internal" pod (i.e. notes to self)
To see just the "external" pod (i.e. the stuff after __END__)
just run
pod2text coast2coast.pl
as usual. pod2text is just used here for example feel free to use
whatever pod formatter you might like better.
-This is just enough code to get something that works. There
is plenty of room to do a lot more with this...
IDEAS FOR FUTURE WORK
-if you prefer, use a config file or command line arguments instead
of constants
-if you can get the FFmpeg module on CPAN to work
(I couldn't) convert the .flv output file to .mp3.
-post-process the output file and remove commercials.
This might be straightforward for someone that has audio programming
experience (I don't).
-programmatically add the guest/topic info to the output file name.
=======
coast2coast.pl
=======
=begin lip
=head1 NAME
coast2coast.pl - A script to download the streamed broadcast of
CoastToCoastAM.
=cut
=head2 CODE
=cut
=head3 Includes
=cut
use v5.10;
use strict;
use warnings;
use Lip::Pod;
use Time::Piece;
use XML::Simple;
use WWW::Scripter;
=head3 Constants
Some notes on the constant values:
=cut
=over 4
=item RTMPDUMP
Generating the rtmpdump command was informed by the man(1) page which can be
found online at http://rtmpdump.mplayerhq.hu/rtmpdump.1.html.
=item USER_AGENT
I found that you do need to use some false user agent info. This script
would
fail otherwise. Presumably some mechanism on their server is checking this.
=back 4
=cut
use constant RTMPDUMP => "/usr/pkg/bin/rtmpdump --live --stop 14400
--rtmp \"URL\" --flv OUT_FILE";
use constant OUTPUT_FILE => "/tmp/coast2coast_DATE.flv";
use constant USER_AGENT => "Mozilla/5.0 (Windows; U; Windows NT 6.1; nl;
rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13";
use constant RADIO_URL =>
"http://p2.whjj-am.ccomrcdn.com/player/player_dispatcher.html?section=radio&action=listen_live";
=head3 Main
The main body of this small script is just two lines to the subroutines
that do
all the work.
=cut
my $rtmp_url=get_rtmp_url(RADIO_URL, USER_AGENT);
download_stream_to_file($rtmp_url, RTMPDUMP, OUTPUT_FILE);
=head3 sub get_rtmp_url
What get_rtmp_url() does:
=over 4
=item 1 Creates a new user agent.
=item 2 Gets the XML file pointed to by the station's URL.
=item 3 Parses out the rtmp:// URL and returns it.
=back 4
=cut
sub get_rtmp_url{
my ($url, $user_agent)=@_;
my $client=new WWW::Scripter;
$client->add_header("User-agent" => $user_agent);
$client->cookie_jar(HTTP::Cookies->new());
$client->get($url);
my $xml=$client->content;
my $h=XMLin($xml);
return
$h->{ListenLiveInitialize}->{StreamInfo}->{stream}->{primary_location};
}
=head3 download_stream_to_file
What download_stream_to_file() does:
=over 4
=item 1 Generates the rtmpdump command by specifying the rtmp:// URL and
output
file.
=item 2 Runs the rtmpdump command.
=back 4
=cut
sub download_stream_to_file{
my ($rtmp_url, $command, $output_file)=@_;
my $date = Time::Piece->new->strftime('%m_%d_%Y');
$output_file=~s#DATE#$date#;
$command=~s#URL#$rtmp_url#;
$command=~s#OUT_FILE#$output_file#;
`$command`;
}
=end lip
=cut
__END__
=head1 NAME
coast2coast.pl - A script to download the streamed broadcast of
CoastToCoastAM.
=head1 SYNOPSIS
perl coast2coast.pl
=head1 DESCRIPTION
This script was written to download the Coast To Coast radio broadcast
streamed by
radio stations' websites via the iHeartRadio player.
This script was based on the Windows batch file posted in
this forum:
http://stream-recorder.com/forum/record-clear-channel-radio-stations-iheartradio-com-t6306p2.html?s=219edb3c1d91b652cd418eb2f43b6dc1&
That forum thread has a good deal of information about capturing the
iHeartRadio
stream. Here are the key points:
=over 4
=item 1 The call letters in the station's URL (e.g. whjj) can be changed
to that
of any other station that uses the iHeartRadio player.
=item 2 The station's URL points to an XML file which contains, among
much other
data, the RTMP streaming URL.
=item 3 The stream is in .flv format. Once saved you may want to convert
that to
something else. I use ffmpeg to convert to .mp3. I happen to do this
manually
since I had difficulty getting the FFmpeg module to install.
=item 4 This will simply download whatever is being broadcast by that
station at
the time the script is run. The only thing that makes this a Coast To
Coast script
is that I run it starting at 1am and it stops downloading 4 hours later: the
start time and length of the Coast to Coast broadcast.
=back
=head1 AUTHOR
sail0r
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2013 by sail0r
This script is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.12.4 or,
at your option, any later version of Perl 5 you may have available.
=cut
------------------------------
Date: Thu, 7 Nov 2013 00:50:37 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Several Perl Questions - Nov. 5, 2013
Message-Id: <CKWdneJtr5yvpebPnZ2dnUVZ_g6dnZ2d@earthlink.com>
Thanks for the comments. They did answer all of my questions.
Questions were also asked in the Python Newsgroup. And at some time
in the next week I might post a note regarding current programming efforts
to both Newsgroups.
The programmers that I am working with are doing volunteer work. And
they are presently only willing to use their favorite languages. So I have
a Perl program that can serve as a central control program. It can watch to
see when a key is pressed and then send that information to the programs
that they developed and used to create exe programs, or to Windows itself.
Regarding a past Perl program discussion:
The newest version of the WWWBoard that I know of was finally
selected and developed for use. I incorporated security features based on
recommendations that people made here in response to my original post.
For just a few examples,
--- When the Submit button is pressed on the Web page data entry screen the
data are sent to a CGI program that largely consists of one line of code. It
sends the data etc. to the main program that is in a directory that cannot
be accessed through the public Web site.
--- A routine was built into the program that counts the number of
submissions during a given period of time. If more than that number are
submitted the program can just start ignoring them or simply delete that
single line of code in the public area if necessary. Further submissions
would then go nowhere. And the main program would remain unaffected.
--- People who have posting privileges could still submit posts by using a
form stored on their PC that sends the posts to a single line of code that
is not visible to the pubic. Then when the number of submissions gets back
to a reasonable level the program can regenerate that one main line of code.
Or it can be manually reset.
The WWWBoard program code is fairly simple and easy to modify. So
code can be developed by multiple parties on their own PCs by using it with
the Xampp program. And I am presently attempting to get the owner of an
active WWWBoard program to shift to that more advanced program if he intends
to keep using the WWWBoard program.
------------------------------
Date: Thu, 7 Nov 2013 11:20:42 +0100
From: "Peter J. Holzer" <hjp-usenet3@hjp.at>
Subject: Re: Several Perl Questions - Nov. 5, 2013
Message-Id: <slrnl7mqbq.s6j.hjp-usenet3@hrunkner.hjp.at>
On 2013-11-05 22:05, Ben Morrow <ben@morrow.me.uk> wrote:
>
> Quoth "Peter J. Holzer" <hjp-usenet3@hjp.at>:
>> On 2013-11-05 15:05, Ben Morrow <ben@morrow.me.uk> wrote:
>> >
>> > That's not actually true, though it is true that 32bit Windows won't run
>> > 64bit executables. 16bit Windows used to run 32bit executables just
>> > fine, and Mac OS X for quite a long time had a 32bit kernel that was
>> > capable of running 64bit user processes.
>>
>> There is always the question what "16 bit", "32 bit" and "64 bit" means.
>> On some architectures, there were just additional instructions to access
>> the longer registers. On others (like x86) there is no binary
>> compatibility: You could compile a program to access EAX in 16-bit mode
>> or in 32-bit mode, but the machine code would be different, and I think
>> the same is true for 32/64bit x86 code.
>
> That's not quite right: %eax is always a 32bit register, the 16bit
> version is called %ax and refers to the lower half of %eax.
That's not what I wrote. I wrote that you could access the 32 bit
register %eax in 16 bit (real or protected) mode as well as in 32 bit
(protected) mode, but the actual machine code to do that was different.
>> On MS-DOS that mattered little because there was no hardware
>> protection anyway, so any executable could just switch to 32-bit
>> protected mode (and back into real mode[1] before exit), but any real
>> OS (starting with Xenix-286 or protected mode Windows) needed to be
>> able to set up 32-bit segments to run "real" 32 bit executables, but
>> without that it could of course run programs which just accessed the
>> 32 bit integer registers (but only for computation, not as pointers).
>> I'd hesitate to call Win95 with the Win32 subsystem a "16 bit OS":
>> While large parts of it were (AIUI) still running in 16 bit protected
>> mode, some parts (especially those dealing with 32 bit processes)
>> were running in 32 bit mode (the segmented x86 architecture made
>> stuff like that almost natural).
>
> I was talking specifically about Win3.1, which would happily run 32bit
> processes (presumably they included the appropriate setup code to switch
> to 32bit mode).
3.1 was the first Windows version which ran exclusively in protected
mode. I don't think a user process could switch to 32 bit mode without
help from the OS. And as Wikipedia reminds me, Windows 3.1 had something
called "386 enhanced mode". So I'd say that it had at least some 32 bit
support. Probably not enough to call it a "32 bit OS", but it wasn't
pure 16 bit, either.
>> I don't know about MacOS, but I guess you are talking about x86 here,
>> too (AFAIK, Apple never sold machines with 64 bit POWER chips).
>
> 10.4 supported 64bit POSIX apps over a 32bit kernel, on amd64 or ppc
> (the G5 is 64bit). 10.5 also supported 64bit GUI apps, also amd64 or
> ppc.
Same here. There is of course first the question what a "64 bit app" is,
but assuming that it means an application compiled for the long mode
instruction set, the OS needs to be able to set up and manage processes
running in long mode, which means at least that the kernel must know how
to do that and probably also that some (small) parts of it run in the
same mode.
hp
--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | | Man feilt solange an seinen Text um, bis
| | | hjp@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
------------------------------
Date: Thu, 07 Nov 2013 14:20:33 +0100
From: Janek Schleicher <janek_schleicher@yahoo.de>
Subject: Re: Several Perl Questions - Nov. 5, 2013
Message-Id: <be1id7FemmjU1@mid.individual.net>
Am 07.11.2013 11:20, schrieb Peter J. Holzer:
> 3.1 was the first Windows version which ran exclusively in protected
> mode. I don't think a user process could switch to 32 bit mode without
> help from the OS. And as Wikipedia reminds me, Windows 3.1 had something
> called "386 enhanced mode". So I'd say that it had at least some 32 bit
> support. Probably not enough to call it a "32 bit OS", but it wasn't
> pure 16 bit, either.
IIRC there was a common hack to get access to more memory, involving
silently rebooting** (without clearing memory or processor registers or
so), switching to enhanced mode, copy some part of memory to an address
between 640k-1kk, silently rebooting again (still without clearing
memory and registers) and working on as nothing happened beside having
access to enhanced memory with enhanced mode. Took about 1ms, but was
often used by games or other application with need of much memory.
Wasn't really necessory, though in 3.1 windows, more for DOS
applications, but a user process could switch to 32 bit mode or down to
16 bit mode without help from OS, just using machine code (via
assembler) directly.
I think Win NT was the first windows, where win really controlled what
you did and not just helped you to operate, but didn't checked for
misuse. Indeed, in enhanced mode it was possible for an OS to check
secure for that and probit applications to do random stuff, but 3.1 did
not yet do that.
Maybe slightly OT,
so Greetings,
Janek
**rebooting was necessary as an 286 or 386 processor couldn't switch
while running between old and enhanced mode.
------------------------------
Date: Thu, 07 Nov 2013 07:27:53 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Several Perl Questions - Nov. 5, 2013
Message-Id: <l5g81b$rro$1@dont-email.me>
On 11/6/2013 11:50 PM, E.D.G. wrote:
> The newest version of the WWWBoard that I know of was finally
> selected and developed for use.
Hopefully, you got this from NMS, and not from Matt.
------------------------------
Date: Thu, 7 Nov 2013 21:32:56 +0100
From: "Peter J. Holzer" <hjp-usenet3@hjp.at>
Subject: Re: Several Perl Questions - Nov. 5, 2013
Message-Id: <slrnl7nu7o.mtr.hjp-usenet3@hrunkner.hjp.at>
On 2013-11-07 13:20, Janek Schleicher <janek_schleicher@yahoo.de> wrote:
> Am 07.11.2013 11:20, schrieb Peter J. Holzer:
>> 3.1 was the first Windows version which ran exclusively in protected
>> mode. I don't think a user process could switch to 32 bit mode without
>> help from the OS. And as Wikipedia reminds me, Windows 3.1 had something
>> called "386 enhanced mode". So I'd say that it had at least some 32 bit
>> support. Probably not enough to call it a "32 bit OS", but it wasn't
>> pure 16 bit, either.
>
> IIRC there was a common hack to get access to more memory, involving
> silently rebooting** (without clearing memory or processor registers or
> so), switching to enhanced mode,
[...]
>
> **rebooting was necessary as an 286 or 386 processor couldn't switch
> while running between old and enhanced mode.
Not quite. The 286 could only switch to protected mode by setting the PE
bit, but not back to real mode (earlier I wrote that the 386 had this
problem, but I was mistaken). But after a reset the processor always
started in real mode, so PCs had some circuitry (in the keyboard
controller, IIRC) to trigger a reset in software. The BIOS then checked
the reason for the reset, skipped the normal self test and boot
routines and jumped directly to an address supplied by the OS.
This was used by OS/2 for task switching between the "DOS box" and other
OS/2 processes (and the reason why there could be only one DOS box).
> copy some part of memory to an address between 640k-1kk, silently
> rebooting again (still without clearing memory and registers) and
> working on as nothing happened beside having access to enhanced memory
> with enhanced mode. Took about 1ms, but was often used by games or
> other application with need of much memory.
I think you are talking about extended memory here. Many DOS programs
did that (and there were even drivers for it), but since Windows 3.1 was
running in protected mode anyway there was no need for that.
> Wasn't really necessory, though in 3.1 windows, more for DOS
> applications, but a user process could switch to 32 bit mode or down to
> 16 bit mode without help from OS, just using machine code (via
> assembler) directly.
I very much doubt that. AFAIK a process in ring 3 simply can't do that.
> I think Win NT was the first windows, where win really controlled what
> you did and not just helped you to operate, but didn't checked for
> misuse.
Windows NT added lots of enhancements (or rather it was a completely
different OS with a compatible API), but some features are just inherent
in protected mode.
hp
--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | | Man feilt solange an seinen Text um, bis
| | | hjp@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 4073
***************************************