[22004] in Perl-Users-Digest
Perl-Users Digest, Issue: 4226 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 6 14:06:03 2002
Date: Fri, 6 Dec 2002 11:05:12 -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 Fri, 6 Dec 2002 Volume: 10 Number: 4226
Today's topics:
Re: Array problem. <spikey-wan@bigfoot.com>
Re: Building Packages - Override Package Functions - In <palladium@spinn.net>
Re: creating new linux user passwd using perl (Ben Morrow)
Re: creating new linux user passwd using perl (Mitchell Laks)
Re: Creating TCP Sockets -- Client Can't Find Server <hal@thresholddigital.com>
Re: Deleting from arrays <goldbb2@earthlink.net>
Re: first element of a hash <pilsl_use@goldfisch.at>
Re: first element of a hash <jurgenex@hotmail.com>
Re: Get Bloomberg data with Perl? BreadWithSpam@fractious.net
Re: Getting a URL Page <uri@stemsystems.com>
Re: Getting a URL Page <pkrupa@redwood.rsc.raytheon.com>
Re: Getting a URL Page <dave@dave.org.uk>
Help Im losing faith! AoH key as a HoH key! (LazyPerfectionist)
Re: Help Im losing faith! AoH key as a HoH key! <cpryce@pryce.net>
Re: Installing perl on removable media - is this feasib <zentara@highstream.net>
Re: Installing perl on removable media - is this feasib <wivey@us.itmasters.com>
Re: Is there a kind of sleep or wait function? <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: Is there a kind of sleep or wait function? <RobTM@fake.addr.ess>
Re: Is there a kind of sleep or wait function? <a@b.c>
Re: Is there a kind of sleep or wait function? <jurgenex@hotmail.com>
Re: read from a process <RobTM@fake.addr.ess>
Re: read from a process <goldbb2@earthlink.net>
Re: read from a process <RobTM@fake.addr.ess>
Re: read from a process <goldbb2@earthlink.net>
Re: read from standard-input within one command? news@roaima.freeserve.co.uk
Re: read from standard-input within one command? (Tad McClellan)
syntax for DBI Perl commands ? <paul@nohotmail..com>
Re: syntax for DBI Perl commands ? <bart.lateur@pandora.be>
Re: syntax for DBI Perl commands ? <jason@baugher.pike.il.us>
Re: syntax for DBI Perl commands ? (Tad McClellan)
Whee, a new JAPH <goldbb2@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 6 Dec 2002 14:59:44 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: Array problem.
Message-Id: <asqe2c$f2p$1@newshost.mot.com>
"Bart Lateur" <bart.lateur@pandora.be> wrote in message
news:kta1vu81gsj3u9jehb59939b7bt2ksj92b@4ax.com...
> These should all work equally well:
>
> foreach my $button ($button1, $button2, $button3) {
> $button->configure( -state => 'disable' );
> }
>
> @buttons = ($button1, $button2, $button3);
> foreach my $button (@buttons) {
> $button->configure( -state => 'disable' );
> }
>
> @buttons = (\$button1, \$button2, \$button3);
> foreach my $button (@buttons) {
> $$button->configure( -state => 'disable' );
> }
I was just about to reply, saying that the first one worked, but the others
didn't, when I spotted my mistake...
=====
...
MainLoop();
# ***** SUBROUTINES *****
@buttons = ($button1, $button2, $button3, $button4, $button5, $button6,
$button7, $button8,
$button9, $buttona, $buttonb, $buttonc, $buttond,
$buttone, $buttonf, $buttong)
sub enable_buttons {
foreach my $button (@buttons) {
$button -> configure (-state => 'normal');
}
}
sub disable_buttons {
foreach my $button (@buttons) {
$button -> configure (-state => 'disable');
}
}
...
=====
D'OH!!!!!!!!!
Now that's sorted out, how would you approach something like this, then?
sub get_values {
$value1 = $value1_entry -> get;
$value2 = $value2_entry -> get;
$value3 = $value3_entry -> get;
etc...
}
sub update_values {
$value1_entry -> delete (0, "end");
$value2_entry -> delete (0, "end");
$value3_entry -> delete (0, "end");
etc...
$value1_entry -> insert ("end", $value1);
$value2_entry -> insert ("end", $value2) ;
$value3_entry -> insert ("end", $value3) ;
etc...
}
Thanks.
R.
------------------------------
Date: Fri, 6 Dec 2002 08:02:59 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: Building Packages - Override Package Functions - Including Inheritance
Message-Id: <uv1gec7bime83f@corp.supernews.com>
> : I hope this makes sense and any thought or suggestions would be
appreciated.
>
> What happened when you tried it just like you wrote it?
>
> Odd use of the word "inheritance" in the subject line, though.
> That's normally used in an object-oriented context, and exporting symbols
> is something to avoid in an OO class/package.
>
AFAIK this works as designed, I am just concerned about how safe this is?
I have looked at many of the CPAN modules, but have not seen a good example.
If I am going about this all wrong I would appreciate any insight on better
way to contstruct this to be safe.
I have thought about building this where the sub is matched via version of
application, but this seemed to messy to manage (Possibility of 300 Subs in
around 20 Packages).
Sorry regarding the odd use of word inheritance..Pascal project still stuck
in my brain.
Thanks,
Rodney
This is how I am attempting :{Snip from Packages and Sample}
###### test.pl########
#!/path/to/perl
use strict;
use warnings;
use TestMe_1_2;
$var=" Dirty \n";
print "$var";
$var=clean($var);
print "$var";
#########TestMe_1_2.pm ##############
package TestMe_1_2;
our ($VERSION, @ISA, @EXPORT);
require 5.000;
require Exporter;
use strict;
use TestMe_1_1;
$VERSION = 1.02;
@ISA = qw(Exporter);
@EXPORT= qw(clean);
#Begin Subs
sub clean {
my $messy=shift;
chomp($messy);
$messy=~s/^\s*//;
$messy=~s/\s*$//;
return $messy;
};
1
#########TestMe_1_1.pm ##############
package TestMe_1_1;
our ($VERSION, @ISA, @EXPORT);
use strict;
require 5.000;
require Exporter;
$VERSION = 1.01;
@ISA = qw(Exporter);
@EXPORT= qw(clean);
#Begin Subs
sub clean {
my $messy=shift;
chomp($messy);
$messy=~s/^\s*/-/;
$messy=~s/\s*$/-/;
return $messy;
};
1
------------------------------
Date: Fri, 6 Dec 2002 14:21:16 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: creating new linux user passwd using perl
Message-Id: <asqbos$mm8$1@wisteria.csv.warwick.ac.uk>
mlaks2000@yahoo.com (Mitchell Laks) wrote:
Don't top-post. (This is getting tedious).
>In case this is important. I am using RedHat linux 7.3 - i read
>somewhere that solaris and sun os don't let you use pipes to change
>passwds,
Has it not occurred to you there might be a good reason for this, like
security?
>since i see from the output that the passwd was successfully changed,
>the question seems to be - TO WHAT?
Read the first reply.
> to debug this script, i wish i
>could check what the passwd was changed to, but i don't know how to
>decrypt the /etc/shadow result. any ideas oh wizards?
You can't. [1]
Ben
[1] FVO 'can't' equal to 'can't except by guessing every possible password'
------------------------------
Date: 6 Dec 2002 10:54:59 -0800
From: mlaks2000@yahoo.com (Mitchell Laks)
Subject: Re: creating new linux user passwd using perl
Message-Id: <ab3b13db.0212061054.2e99855d@posting.google.com>
Good Idea Jay, but I had already tried many combinations including
print PASS "$password\n";
and
print PASS "$password";
and none worked :(.
i am doing this on a redhat 7.3 linux box. Any more ideas oh Gurus?
Mitchell
tiltonj@erols.com (Jay Tilton) wrote in message news:<3df06491.118491352@news.erols.com>...
> mlaks2000@yahoo.com (Mitchell Laks) wrote:
>
> : Hi i am trying to use perl script to create a new user passwd. the
> : following script almost works
> :
> : #!/usr/bin/perl
> : my $password="bar";
> : print "we now change password for foo \n ";
> : open(PASS, "|passwd --stdin foo");
> : print PASS "$password \n";
> ^
> : print PASS "$password \n";
> ^
> : close(PASS);
>
> [...]
>
> : the password "bar" doesnt work.
>
> Does the space after the password really belong?
> Are you sure it's not being changed to "bar "?
------------------------------
Date: Fri, 06 Dec 2002 18:42:24 GMT
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Creating TCP Sockets -- Client Can't Find Server
Message-Id: <kc6I9.262840$WL3.88885@rwcrnsc54>
So you tried the script I put up?
Thanks! It's good to hear it's not just MY box that it won't work on. I've
had problems reading perldoc files lately. When I did an RPM upgrade from
Mandrake 8.2 to 9.0, it upgraded Perl from 5.6.1 to 5.8.0 and suddenly
perldoc doesn't work. (Anybody have a suggestion?)
I'll grab the script from a friends machine and test it and see what works.
Thank you for checking this out!
Hal
David Efflandt wrote:
> On Thu, 05 Dec 2002 01:12:19 GMT, Hal Vaughan <hal@thresholddigital.com>
> wrote:
>> I've posted earler a question about interprocess communication. This is
>> similar. I want to have different processes on the same machine, but run
>> by different users, communicate with each other. While I've been looking
>> at a lot of possibilities, it seems like creating a TCP socket would be
>> the best, since I could also use that to communicate with a process on
>> another box on the same LAN.
>>
>> I've copied examples out of the Blue Camel, and I'm running both the
>> client and server on the same box (I've also tried them on different
>> boxes -- same
>> result). The server process runs and waits. The client process is
>> always unable to connect to the server.
>
> Something is broken in your server script. When I run it, 'netstat -atn'
> does not show anything associated with that socket. I am not enough an
> expert to tell where you went wrong, but the "TCP Servers with IO::Socket"
> example in 'perldoc perlipc' works for me. That one is set for port 9000,
> which shows up in 'netstat -atn' (0.0.0.0:9000) and I can 'telnet
> localhost 9000' (or that port on any other IP on my box besides localhost)
> and it responds.
>
> So start with something that works, and work your way to your goal from
> there, testing after each change, so you can tell at what point it trips
> up.
>
------------------------------
Date: Fri, 06 Dec 2002 11:35:17 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Deleting from arrays
Message-Id: <3DF0D1C5.DE8CFCA4@earthlink.net>
Bart Lateur wrote:
>
> Bill Smith wrote:
>
> >It seems that "exists $list[4]" and
> >"defined $list[4]" should always give the same result.
>
> They needn't. The exists() function on arrays exist to be able to
> emulate hashes on top of an underlying array implementation, the
> so-called pseudo-hashes. There's no reason in the world why a normal
> person would ever use it on a normal array.
I once wrote a networking program which had an array of filehandles,
indexed by filedescriptor -- Whenever I needed to broadcast data from
one client to all the others, I had to iterate over the whole array;
when a client connection closed, I used delete() to clear that array
element; this had the effect of shortening the array if that item was
the last one and decreasing the number of elements I had to iterate
over.
> As you said: an array element ought to be thought of as existing as
> soon as it is within the index range for this array, which for common
> uses is from 0 to 1 less than the size of the array.
>
> I would think that people who want to delete() an array element,are
> actually looking for splice(). (Or grep().)
Given the association in my program between array indices and
filedescriptor, I wouldn't have wanted to use grep.
And it would have been rather innefficient to do:
undef $fd;
if( $fd == $#array ) {
pop @array while @array and not defined $array[-1];
}
Internally, delete $x[$i] will do something similar, but since it's in C
code, it's faster.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Fri, 6 Dec 2002 17:03:05 +0100
From: peter pilsl <pilsl_use@goldfisch.at>
Subject: Re: first element of a hash
Message-Id: <3df0caf2$1@e-post.inode.at>
stig wrote:
>
> i have a sorted hash
>
There is a module on CPAN that preserves a order (the order you inserted
the values) in hashes. (which is not true for usual perl-hashes)
I never tried it on my own.
Tie::IxHash
best,
peter
--
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: Fri, 06 Dec 2002 16:10:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: first element of a hash
Message-Id: <4_3I9.548$Ec.247@nwrddc01.gnilink.net>
stig wrote:
> i have a sorted hash
I doubt that. Hashes are not sorted.
> how can i get the first element out of the hash not knowing the key?
You can't because there is no order on hash elements(*). The term 'first
element' doesn't make sense in the context of a hash.
(*)at least no order that would be useful for an application programmer
> something like $array[0] to get the first element out of the array
> $array, only on a hash.
You can't. Or at least it wouldn't be meaningful, i.e. it would be a random
element.
I suggest you reconsider your data structure. If you need your data sorted
then you should use an array or at least you need to transform the hash into
an array and sort them first.
jue
------------------------------
Date: 06 Dec 2002 09:25:10 -0500
From: BreadWithSpam@fractious.net
Subject: Re: Get Bloomberg data with Perl?
Message-Id: <yobptsf6x89.fsf@panix2.panix.com>
Tzvi Oppenhimer <member@dbforums.com> writes:
> Originally posted by Michael Robbins
> > Has anyone been able to get Bloomberg data into Perl?
> > Bloomberg has an API, but only has examples for Java, VB, VBA, etc.
> Have you succeed in getting Bloomberg data into Perl?
I can't speak for Mr. Robbins, but I've been working
on it myself for a little while.
There are many ways to do it, though I've not personally
seen anyone write an XS wrapper around their C libraries
as was suggested elsewhere.
Frankly getting anything with their C libs to compile
on my windows box has been a major pain - bad enough
to get a standalone C app running.
Other ways to go -- Bloomberg offers a sample program
which compiled without too much trouble. Call it from
inside perl with either system or backticks.
Or use OLE to talk to Excel which talks to bbcomm via
DDE. That works very nicely for small datasets and
as long as you're in Excel, you have access to all of
Excel's power at the same time.
Finally, there's Win32::DDE itself and, while I've
gotten it to talk to bloomberg, I've not gotten any
useful data back out, since the dde calls don't seem
to have any delays and the bbcomm stuff always takes
a second or two before any data appears.
--
Plain Bread alone for e-mail, thanks. The rest gets trashed.
No MIME in E-Mail! -- http://www.expita.com/nomime.html
Are you posting responses that are easy for others to follow?
http://www.greenend.org.uk/rjk/2000/06/14/quoting
------------------------------
Date: Fri, 06 Dec 2002 16:07:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Getting a URL Page
Message-Id: <x7n0njp1vh.fsf@mail.sysarch.com>
>>>>> "CB" == Chris Boston <cboston@e-duct-tape.com> writes:
CB> I agree with the dont triple post. That was an accident. Had some network
CB> problems.
CB> And as to why I wrote what I did. It is just an example. As you well know
CB> there are about a million ways to do everything in perl. This is just one
CB> that was quick and dirty that I know will work.
as others have said and i say again, it will break on many common
urls. that is called quick and broken.
>> don't top post.
>>
and you didn't respond to that.
>> and running a process from perl when it is not needed is good in what
>> way?
>>
>> and that is better than LWP how?
>>
>> and how well does that handle & in the url?
>>
>> and why would you pipe the output to another process when you can read
>> it in perl directly?
>>
>> and why did you basically write a shell script in perl?
>>
>> if you can answer those questions, then you might be able to answer
>> others in this newsgroup.
try to answer any of those questions. if you don't then your quick and
broken answer has even less value.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 06 Dec 2002 16:21:03 +0000
From: "Peter A. Krupa" <pkrupa@redwood.rsc.raytheon.com>
Subject: Re: Getting a URL Page
Message-Id: <3DF0CE6F.997977F9@redwood.rsc.raytheon.com>
The LWP::Simple module should be included in the standard distribution of Perl. That makes me curious. What version of
Perl are you running (perl -v)? What operating system?
------------------------------
Date: Fri, 06 Dec 2002 18:51:44 +0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: Getting a URL Page
Message-Id: <pan.2002.12.06.18.51.44.387420@dave.org.uk>
On Fri, 06 Dec 2002 16:21:03 +0000, Peter A. Krupa wrote:
> The LWP::Simple module should be included in the standard distribution
> of Perl. That makes me curious. What version of Perl are you running
> (perl -v)? What operating system?
LWP::Simple isn't included in the standard Perl distribution. I believe
that it's among a set of extra modules that are included with ActivePerl.
Dave...
--
"Don't you boys know any _nice_ songs?"
------------------------------
Date: 6 Dec 2002 07:54:24 -0800
From: mod3@hotmail.com (LazyPerfectionist)
Subject: Help Im losing faith! AoH key as a HoH key!
Message-Id: <4379a3c8.0212060754.71aee1c2@posting.google.com>
Im sure Im bieng stupid!
Ive read perldoc perltot perllol..etc but no luck..
I know Im trying to put a ref of one arrayhash key as a key to another
hash and I know I should deref but is there a another solution...
my(@a_header) = (
{'a' => '\b[A-Z]+\b'},
{'b' => '\b\d{1,2}\b|\b100\b'}
);
this works but thats not what I want. I want to get rid of the
my(@test)..!
for (my($i)=0;$i<@a_header;$i++){
my(@test)= keys %{$a_header[$i]};#####
$h_data{$lineNo}->{$test[0]} =
defined $values[$i]?$values[$i]:'';
}#for
this doesnt1!
for (my($i)=0;$i<@a_header;$i++){
$h_data{$lineNo}->{%{$a_header[$i]}} =
defined $values[$i]?$values[$i]:'';
}#for
this doesnt2!
for (my($i)=0;$i<@a_header;$i++){
$h_data{$lineNo}->{$test(keys %{$a_header[$i]})} =
defined $values[$i]?$values[$i]:'';
}#for
this doesnt3!
for (my($i)=0;$i<@a_header;$i++){
$h_data{$lineNo}->{keys %{$a_header[$i]}} =
defined $values[$i]?$values[$i]:'';
}#for
this nearly works! and I think because Im taking out the scalar value
and I know that the each is spitting out the key and value..is there a
way to spit out the just the key but without the value within the
h_data..
for (my($i)=0;$i<@a_header;$i++){
$h_data{$lineNo}->{each %{$a_header[$i]}} =
defined $values[$i]?$values[$i]:'';
}#for
------------------------------
Date: Fri, 06 Dec 2002 10:43:15 -0600
From: cp <cpryce@pryce.net>
Subject: Re: Help Im losing faith! AoH key as a HoH key!
Message-Id: <BA162FC2.12E24%cpryce@pryce.net>
in article 4379a3c8.0212060754.71aee1c2@posting.google.com,
LazyPerfectionist at mod3@hotmail.com wrote on 12/6/02 9:54 AM:
> Ive read perldoc perltot perllol..etc but no luck..
> I know Im trying to put a ref of one arrayhash key as a key to another
> hash and I know I should deref but is there a another solution...
Perhaps read perldoc perldsc
>
> my(@a_header) = (
> {'a' => '\b[A-Z]+\b'},
> {'b' => '\b\d{1,2}\b|\b100\b'}
> );
>
> this works but thats not what I want. I want to get rid of the
> my(@test)..!
> for (my($i)=0;$i<@a_header;$i++){
> my(@test)= keys %{$a_header[$i]};#####
> $h_data{$lineNo}->{$test[0]} =
> defined $values[$i]?$values[$i]:'';
> }#for
I'm not sure that you've chosen the correct data structure. You got an array
@a_header, which is storing hash references, except that each hash reference
only has one entry, and that seems to be sequential a..b. And it seems that
you're not doing anything with the values, only the keys. So that in
$h_data{$lineNo} the first time through the loop you assign
$h_data{$lineNo}->{'a'}, the next time through , $h_data{$lineNo}->{'b'};
Not know what's in @values, I'm not sure why you'd do that.
However, you could say:
my $sub_key = 'a';
for (my($i)=0;$i<@a_header;$i++){
$h_data{$lineNo}->{$sub_key} = ( defined $values[$i]?$values[$i]:'');
$sub_key ++;
}
You also probably don't want to use defined. Use the Perl default value
operator as:
$h_data{$lineNo}->{$sub_key} = $values[$i] || '';
Which assigns $values[$i] if it is a true value, or '' if it is not.
More idiomatically, the loop can be written:
my $sub_key = 'a';
for (0..$#a_header ){
$h_data{$lineNo}->{$sub_key} = $values[$_] || '';
$sub_key ++;
}
But, unless you show more of the code, I'd question the AoH structure in the
first place.
cp
--
------------------------------
Date: Fri, 06 Dec 2002 09:39:03 -0500
From: zentara <zentara@highstream.net>
Subject: Re: Installing perl on removable media - is this feasible?
Message-Id: <20d1vuo149g8ii939e930d518b9e91sp1b@4ax.com>
On Thu, 5 Dec 2002 10:32:48 -0600, "William" <wivey@us.itmasters.com>
wrote:
>
>So, is it possible to "install" a working perl environment
>on a CD image, in an OS-specific subdirectory, that would
>work while the CD is mounted, and work on any machine with
>a reasonable environment? (We already do this with a few
>utilities - but they are single file executables that
>don't care where they are.) I can, of course, use a bourne
>shell script to set up environment variables before
>launching any perl scripts.
>
>Has anyone tried this, or knows of any showstoppers?
>(My perl experience is pretty much limited to writing
>scripts, I'm kinda vague about the requirements of the
>installation.)
Hi, I did this awhile back with a utility called mkcdrec.
It is a bash shell script which produces bootable cd's,
and lets you include as many programs as you want.
The trick is to know which .so libs are needed by the apps and
include them too, so it might cost you a few "coasters"
before you get a working model. Also you can manually
copy .so libs from the hard drive to the ram disk, if you
find you need a .so lib you forgot.
Here are the instructions I posted a few months ago,
you may need to fudge them abit. However, I have
used this method to create bootable cds, with all my
perl libs, and I even got dialup ppp support to run off the cd. :-)
#####################################################
Go to:
http://freshmeat.net/projects/mkcdrec/
and download mkCDrec_v0.6.0.tar.gz
then follow these additional instructions.
1. Untar the package and cd to the mkcdrec directory.
2. mkdir 'utilities'
3. copy the entire /usr/lib/perl5 directory to
mkcdrec/utilities/perl5
4. Edit the Config.sh at(or near) line 325 where
a section called 'Links=' is started.
Add a link like this:
/usr/lib=perl5=/cdrom/utilities/perl5
5. You can copy as many of your utilities as
you want to this utilities directory, and
make links. However, it is easier to do the
next step.
6. Goto Config.sh around line 224 where the section
called 'Binaries=' begins. Just add entries there,
like: (make sure they are in your path)
perl
perldoc
mycoolscript.pl
etc
etc.
This ends the perl part of the setup.
7. Goto the beginning of Config.sh and edit each
entry to suit your system.
For certain, specify LINUX_KERNEL that you wish to use.
Like:'/boot/vmlinuz.suse-2.4.4-4GB'
BURNCDR=y
SCSIDEVICE='0,1,0' ( or whatever you use for your system )
(cdrecord -scanbus will tell you)
etc, etc,etc
Don't ignore the line for DEVFS=0 , the cd won't boot
if you set this wrong. Set it to 1 only if your kernel
supports it.
8. Finally do a 'make test' to see how your Config.sh looks.
If all is well, do a 'make'; select option 1 (Rescue CD),
and your cd will be made.
9. Boot it, and start mc, I'm sure you can take it from there.
------------------------------
Date: Fri, 6 Dec 2002 10:21:26 -0600
From: "William" <wivey@us.itmasters.com>
Subject: Re: Installing perl on removable media - is this feasible?
Message-Id: <Ptadnd1vb4HgU22gXTWc3w@giganews.com>
"zentara" <zentara@highstream.net> wrote in message
news:20d1vuo149g8ii939e930d518b9e91sp1b@4ax.com...
>
> Hi, I did this awhile back with a utility called mkcdrec.
> It is a bash shell script which produces bootable cd's,
> and lets you include as many programs as you want.
That's pretty cool! Unfortunately, I don't think it will solve
my current problem since we can't ask our customers to boot
from the CD, though (we can't ask them to boot at all - took a
while to get the Windows version to stop asking for a reboot).
-Wm
------------------------------
Date: Fri, 6 Dec 2002 14:05:22 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Is there a kind of sleep or wait function?
Message-Id: <asqar2$586$9@korweta.task.gda.pl>
In article <asqabk$8kd$1@news1.wdf.sap-ag.de>, ZZT wrote:
> Hello,
>
> I would like to wait a while inside a script. Is this possible?
> If yes - how?
Why didn't you use perldoc to test 'sleep' and 'wait' (as in your
Subject)? You'd get the answer in 5 seconds without having to post and
waste our time and your own.
perldoc -f sleep
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: 6 Dec 2002 14:06:00 GMT
From: Robert Szczygiel <RobTM@fake.addr.ess>
Subject: Re: Is there a kind of sleep or wait function?
Message-Id: <slrn.pl.av1bm9.1hc.RobTM@pcmic25.cern.ch>
ZZT wrote:
> I would like to wait a while inside a script. Is this possible?
> If yes - how?
perldoc -f sleep
RS:)
--
** - Why a bike cannot stand up by itself?
** - Because it is two-tyred!
-- http://3226865153/~szczygie --
------------------------------
Date: Fri, 06 Dec 2002 15:10:06 +0100
From: ZZT <a@b.c>
Subject: Re: Is there a kind of sleep or wait function?
Message-Id: <asqb3u$95t$1@news1.wdf.sap-ag.de>
Bernard El-Hagin wrote:
> Why didn't you use perldoc to test 'sleep' and 'wait' (as in your
> Subject)? You'd get the answer in 5 seconds without having to post and
> waste our time and your own.
ups - sorry
thanks anyway
------------------------------
Date: Fri, 06 Dec 2002 16:16:02 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Is there a kind of sleep or wait function?
Message-Id: <634I9.589$Ec.166@nwrddc01.gnilink.net>
ZZT wrote:
> I would like to wait a while inside a script. Is this possible?
> If yes - how?
The second self-answering questions in two days.
Do we have September?
Anyway, RTFM:
- perldoc perlfunc
- perldoc -f sleep
- perldoc -f wait
jue
------------------------------
Date: 6 Dec 2002 13:38:13 GMT
From: Robert Szczygiel <RobTM@fake.addr.ess>
Subject: Re: read from a process
Message-Id: <slrn.pl.av1a25.1hc.RobTM@pcmic25.cern.ch>
Sunil wrote:
> I found the following post
> http://www.perlmonks.org/index.pl?node_id=150904
> will redirecting errors and output to a file solve the "filling up the
> pipe" issue?
I think it will convert it to "filling up the disk" issue. :)
RobTM:)
--
** - Why a bike cannot stand up by itself?
** - Because it is two-tyred!
-- http://3226865153/~szczygie --
------------------------------
Date: Fri, 06 Dec 2002 11:25:18 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: read from a process
Message-Id: <3DF0CF6E.BF350BE3@earthlink.net>
Robert Szczygiel wrote:
>
> Benjamin Goldberg wrote:
> >> open3( \*WRH, \*RDH, \*ERH, "perl",$pname,@args);
> >> close( WRH );
> >> my @stdout = <RDH>;
> >> my @stderr = <ERH>;
> >
> > What happens if the program prints so much to it's stderr that it
> > fills up the pipe? Writing will block, and the process will go to
> > sleep until something reads from the other end of the pipe. But,
> > since your parent process is first reading from the stdout, not the
> > stderr, of the child process, it will block, waiting for EOF, and go
> > to sleep. Since both processes are asleep, waiting for the other to
> > do IO, the result is deadlock. Oops.
>
> This was just an example to give an idea. The <RDH>,<ERH> can be
> treated as any file handles.
The handles *RDH and *ERH are opened as pipes by the open3 function.
What do you mean, "treated as any filehandles"?
> You can easily limit the number of lines, e.g:
>
> $i=0;
> $limit=<something>
>
> while(<ERH>){
> <do something with error line if you wish>
> $i++;
> last if $i>$limit;
> }
>
> The same with standard output.
This does not help any.
If you read ERH before reading RDH, then deadlock can occur if the
program fills up it's stdout before printing anything to stderr. Even
with a limit on the number of lines read.
If you read RDH before reading ERH, then deadlock can occur if the
program fills up it's stderr before printing anything to stdout. Even
with a limit on the number of lines read.
The *only* proper solution for avoiding deadlock (if one has no
knowledge of when the child process will produce stuff on it's stdout or
when it will produce stuff on it's stderr), is to redirect one handle or
the other to a file (possibly a temp file), or else use IO::Select to
read from both simultaneously.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: 6 Dec 2002 16:41:16 GMT
From: Robert Szczygiel <RobTM@fake.addr.ess>
Subject: Re: read from a process
Message-Id: <slrn.pl.av1kpd.1q4.RobTM@pcmic25.cern.ch>
Benjamin Goldberg wrote:
> The *only* proper solution for avoiding deadlock (if one has no
> knowledge of when the child process will produce stuff on it's stdout or
> when it will produce stuff on it's stderr), is to redirect one handle or
> the other to a file (possibly a temp file), or else use IO::Select to
> read from both simultaneously.
You are right.
What do you think about forking - one process reading stdout, another
stderr?
RobTM:)
--
** - Why a bike cannot stand up by itself?
** - Because it is two-tyred!
-- http://3226865153/~szczygie --
------------------------------
Date: Fri, 06 Dec 2002 13:56:58 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: read from a process
Message-Id: <3DF0F2FA.E10A36FF@earthlink.net>
Robert Szczygiel wrote:
>
> Benjamin Goldberg wrote:
> > The *only* proper solution for avoiding deadlock (if one has no
> > knowledge of when the child process will produce stuff on it's
> > stdout or when it will produce stuff on it's stderr), is to redirect
> > one handle or the other to a file (possibly a temp file), or else
> > use IO::Select to read from both simultaneously.
>
> You are right.
>
> What do you think about forking - one process reading stdout, another
> stderr?
That works, too, of course, but how do you put the data from the two
streams back together?
--
$..=q/(?:(?{local$^C=$^C|/.(1<<$_).q/})|)/for.0..4;
$..=q/(?(?{$^C<26.and$*.=substr"\n h!,$^C,1;1}).)/;
$.=~s/!/aktrsreltanPJ,r coeueh"/;BEGIN{$^H|=(1<<21
)}"" =~ $.;print $*;q(Just another Perl hacker,\n);
------------------------------
Date: Fri, 6 Dec 2002 14:17:09 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: read from standard-input within one command?
Message-Id: <5hbqsa.lng.ln@moldev.cmagroup.co.uk>
Helgi Briem <helgi@decode.is> wrote:
> Why on earth would anyone use "open" to read
> from the keyboard ?!?
Well, I guess someone might want to read from the terminal rather
than stdin,
open (my $tty, '/dev/tty') or die $horribly; # UNIX only
Regards,
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: Fri, 6 Dec 2002 08:51:03 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: read from standard-input within one command?
Message-Id: <slrnav1ean.3c7.tadmc@magna.augustmail.com>
Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
> I wonder what I'd look like in a Gestapo uniform.
>
>
> Actually, my wife might go for that.
Kinda puts a whole new spin on the phrase "use strict"...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 6 Dec 2002 22:48:58 -0800
From: "paul-new" <paul@nohotmail..com>
Subject: syntax for DBI Perl commands ?
Message-Id: <3df0b8e9_2@news.tm.net.my>
hi, i am a newbie to using DBI Perl.
whats the syntax for DBI Perl commands ?
for inserting into table ?
for select from table ?
for updating table ?
for deletin from table ?
can i use mysql or a text file ?
thanks
------------------------------
Date: Fri, 06 Dec 2002 15:25:24 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: syntax for DBI Perl commands ?
Message-Id: <39g1vucvf95g2qljum2alnq634ejg0nso7@4ax.com>
paul-new wrote:
>whats the syntax for DBI Perl commands ?
That's three times the same questions in a row.
*plonk*
--
Bart.
------------------------------
Date: Fri, 06 Dec 2002 15:27:35 GMT
From: Jason Baugher <jason@baugher.pike.il.us>
Subject: Re: syntax for DBI Perl commands ?
Message-Id: <Xns92DC6038DECBFjasonbaugherpikeilus@209.242.76.10>
"paul-new" <paul@nohotmail..com> wrote in comp.lang.perl.misc:
> hi, i am a newbie to using DBI Perl.
>
> whats the syntax for DBI Perl commands ?
>
> for inserting into table ?
>
> for select from table ?
>
> for updating table ?
>
> for deletin from table ?
>
> can i use mysql or a text file ?
>
> thanks
>
>
>
perldoc DBI
perldoc DBD::mysql
If you don't know the SQL syntax itself, read the mySql docs. Get a SQL
book.
--
Jason Baugher
Virtual Adept Professional Consulting Services
1406 Adams Street, Quincy, IL 62301 - (217) 221-5406
jason@baugher.pike.il.us - http://baugher.pike.il.us/virtualadept
------------------------------
Date: Fri, 6 Dec 2002 12:52:26 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: syntax for DBI Perl commands ?
Message-Id: <slrnav1sfa.1up.tadmc@magna.augustmail.com>
paul-new <paul@nohotmail..com> wrote:
> whats the syntax for DBI Perl commands ?
The documentation for the DBI module covers that:
perldoc DBI
> for inserting into table ?
Use SQL INSERT, no Perl in that question.
> for select from table ?
Use SQL SELECT, no Perl in that question.
> for updating table ?
Use SQL UPDATE, no Perl in that question.
>
> for deletin from table ?
Use SQL DELETE, no Perl in that question.
> can i use mysql or a text file ?
Yes.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 06 Dec 2002 13:31:46 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Whee, a new JAPH
Message-Id: <3DF0ED12.73BE28E0@earthlink.net>
The only thing that worries me in this is that I'm not sure
how bad it is to fiddle with $^H, instead of use re 'eval'.
Have the $^H flags ever changed between perl versions?
$..=q/(?:(?{local$^C=$^C|/.(1<<$_).q/})|)/for.0..4;
$..=q/(?(?{$^C<26.and$*.=substr"\n h!,$^C,1;1}).)/;
$.=~s/!/aktrsreltanPJ,r coeueh"/;BEGIN{$^H|=(1<<21
)}"" =~ $.;print $*;q(Just another Perl hacker,\n);
Oh, and can anyone see a way to get this on three lines?
Obviously the q(...) filler at the end can be discarded.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4226
***************************************