[10283] in Perl-Users-Digest
Perl-Users Digest, Issue: 3877 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 2 16:07:27 1998
Date: Fri, 2 Oct 98 13:01:41 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 2 Oct 1998 Volume: 8 Number: 3877
Today's topics:
Re: per <Ian_Lowe@fanniemae.com>
Re: per <Ian_Lowe@fanniemae.com>
Re: per <eashton@bbnplanet.com>
Re: per <Ian_Lowe@fanniemae.com>
Re: per <eashton@bbnplanet.com>
Perl Install problems <Ian_Lowe@fanniemae.com>
problem with Perl modules made from stdcall C functions teds@intex.com
Re: Q: Speed Optimization <aqumsieh@tigre.matrox.com>
Reminder: Randal Schwartz in Dallas Saturday October 3r (Brand Hilton)
Sending email attachments with Mail::Mailer and sendmai dag@sonsorol.org
Re: Sending filehandle to a client before closing socke (Bart Lateur)
Re: string from array (David A. Black)
uppercase to lowercase etrim@my-dejanews.com
Re: uppercase to lowercase <eashton@bbnplanet.com>
Re: uppercase to lowercase <dwatanab@uci.edu>
Using PerlMenu.pm - DEL Key exits my application <Richmont.Sy@exchange.sms.siemens.com>
Re: Win32::AdminMisc UserChangePassword Quesiton <george.kuetemeyer@mail.tju.edu>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 02 Oct 1998 12:54:28 -0400
From: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Re: per
Message-Id: <36150544.9E0D327F@fanniemae.com>
The /code filesystem is not in my vfstab. I have never used such a
filesystem name. Also, the code works fine if I use my previous perl
binary location (which is on another system), so I know it isn't a
problem with the code.
Thanks,
Ian
Elaine -HappyFunBall- Ashton wrote:
>
> Ian Lowe wrote:
>
> > are using `df`. The scripts still operate properly, but they return the
> > error message : df: cannot statvfs /code: No such file or directory
> > When I ran make test everything test o.k., but this seems that it could
> > be a library or header issue? Any ideas?
>
> Well, from the surface of it, df is trying to go at a filesystem /code
> which doesn't seem to be there. df can't stat unmounted filesystems.
> Have a look at your /etc/vfstab and see if /code is in there. If so,
> remount it and i'll betcha it'll work. If not, post the bit of code that
> has the system call in it.
>
> e.
>
> Would I live my life over again?
> Make the same unforgivable mistakes?
> Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 13:38:58 -0400
From: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Re: per
Message-Id: <36150FB2.279378FD@fanniemae.com>
I'm afraid there is no directory called /code. I have even tried with a
very simple script as you will see below, and I still get the message
(df: cannot statvfs /code: No such file or directory) prior to the
output:
#!/usr/local/bin/perl -w
##################################
open(DF,"df -kl|");
while (<DF>) {
chop;
($size,$capacity) = (split(/\s+/))[1,4];
$FSSIZE{$size} = $capacity;
}
@temp = %FSSIZE;
print "@temp\n";
##################################
Ian
John Porter wrote:
>
> Ian Lowe wrote:
> >
> > I have just compiled perl 5.005_02 for the Solaris platform and
> > everything seems to be working o.k. except for one thing. I have a
> > couple of scripts that look for filesystem size and capacity, so they
> > are using `df`. The scripts still operate properly, but they return the
> > error message : df: cannot statvfs /code: No such file or directory
>
> Not a perl problem.
>
> If df can't statvfs /code, then that's because there is no /code.
> Sounds like you brought these scripts over from another machine
> where there was a /code. I would err on the side of safety and
> assume that because these scripts want to look at a directory
> named /code, then they should NOT be run on your current machine.
> Maybe you can tell by looking at the perl code; maybe there's
> another directory which might be appropriate; or maybe you can
> mount that /code from the machine where it lives.
>
> --
> John "Many Jars" Porter
> baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 02 Oct 1998 18:53:03 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: per
Message-Id: <36151E9B.5BD928C@bbnplanet.com>
Ian Lowe wrote:
>
> I'm afraid there is no directory called /code. I have even tried with a
> very simple script as you will see below, and I still get the message
> (df: cannot statvfs /code: No such file or directory) prior to the
> output:
This is the output I get with your code
eashton@st-croix /home/eashton> ./foo
0 0% 1947766 71% 53180 1% 1886190 1% kbytes capacity 308944 100%
So, look at that. No fs names? What about typing just 'df -k' on your
system. Do you still get the message? I couldn't reproduce the error.
But I did shove a few bits around. Why use an array at this point so I
made it really simple.
#!/usr/local/bin/perl -w
##################################
open(DF,"df -kl|");
while (<DF>) {
chop;
($size,$capacity,$fsname) = (split(/\s+/))[1,4,5];
print "$fsname, $size, $capacity\n";
}
exit;
and this was the output
/, 1947766, 71%
/proc, 0, 0%
/dev/fd, 0, 0%
/tmp, 53920, 1%
/cdrom/devpro_v5n1_sparc, 308944, 100%
/export/pkg, 1886190, 1%
It could use some formatting, but I'll leave that to you.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Fri, 02 Oct 1998 15:10:53 -0400
From: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Re: per
Message-Id: <3615253D.20D0EA36@fanniemae.com>
Let's get even simpler.
#/usr/local/bin/perl -w
$df = `df -k`
print "$df\n";
Even this reproduces the original error message. So, coding aside, I
still have the original problem.
Ian
Elaine -HappyFunBall- Ashton wrote:
>
> Ian Lowe wrote:
> >
> > I'm afraid there is no directory called /code. I have even tried with a
> > very simple script as you will see below, and I still get the message
> > (df: cannot statvfs /code: No such file or directory) prior to the
> > output:
>
> This is the output I get with your code
>
> eashton@st-croix /home/eashton> ./foo
> 0 0% 1947766 71% 53180 1% 1886190 1% kbytes capacity 308944 100%
>
> So, look at that. No fs names? What about typing just 'df -k' on your
> system. Do you still get the message? I couldn't reproduce the error.
>
> But I did shove a few bits around. Why use an array at this point so I
> made it really simple.
>
> #!/usr/local/bin/perl -w
>
> ##################################
> open(DF,"df -kl|");
> while (<DF>) {
> chop;
> ($size,$capacity,$fsname) = (split(/\s+/))[1,4,5];
> print "$fsname, $size, $capacity\n";
> }
> exit;
>
> and this was the output
>
> /, 1947766, 71%
> /proc, 0, 0%
> /dev/fd, 0, 0%
> /tmp, 53920, 1%
> /cdrom/devpro_v5n1_sparc, 308944, 100%
> /export/pkg, 1886190, 1%
>
> It could use some formatting, but I'll leave that to you.
>
> e.
>
> "All of us, all of us, all of us trying to save our immortal souls, some
> ways seemingly more round-about and mysterious than others. We're having
> a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Fri, 02 Oct 1998 19:48:21 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: per
Message-Id: <36152B91.36B4FF2F@bbnplanet.com>
Ian Lowe wrote:
> Even this reproduces the original error message. So, coding aside, I
> still have the original problem.
I use 5.005_02 on a Sparc as well. So the logic of this proof would
be...probably you need to recompile Perl. You might also have a look at
your env and see if anything in there is causing the problem.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Fri, 02 Oct 1998 12:06:35 -0400
From: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Perl Install problems
Message-Id: <3614FA0B.77AC89F6@fanniemae.com>
Please excuse this repost. I screwed up on the last subject line :)
I have just compiled perl 5.005_02 for the Solaris platform and
everything seems to be working o.k. except for one thing. I have a
couple of scripts that look for filesystem size and capacity, so they
are using `df`. The scripts still operate properly, but they return the
error message : df: cannot statvfs /code: No such file or directory
When I ran make test everything test o.k., but this seems that it could
be a library or header issue? Any ideas?
Thanks for the help.
Ian
------------------------------
Date: Fri, 02 Oct 1998 18:33:47 GMT
From: teds@intex.com
Subject: problem with Perl modules made from stdcall C functions
Message-Id: <6v36ab$vg6$1@nnrp1.dejanews.com>
Hi,
I am running on WinNT 4.0, SP3 using Activeware's perl. This question
pertains to whether I can make a perl module using C functions declared with
stdcall instead of cdecl.
I have been making a new Perl module using C. I create my test.dll
and then use SWIG to create my test.pm. My function looks like this:
int myfunc( char *var1 )
{
}
This works fine. But what I really needed was to declare my function
with _stdcall and _cdecl (which is the default). In other words, if
I declare my function as
int _stdcall myfunc( char *var1 )
{
}
I can no longer create my dll because of the stdcall (it expects _cdecl).
I don't think it is particular to SWIG. I was wondering if anyone has
written perl modules using stdcall or a mix of stdcall and cdecl.
Thanks,
Ted
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 02 Oct 1998 13:34:50 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Q: Speed Optimization
Message-Id: <x3yiui2eukl.fsf@tigre.matrox.com>
tilmanglotzner@my-dejanews.com writes:
>
> Hello everybody,
>
> I have a little perl script which needs some improvement in terms of speed.
> Right now it runs just to slow.
I would suggest that you use
if {}
elsif {}
elsif {}
constructs. In this case, if one of the conditions matches, the script
will not try to evaluate the other ones.
--
Ala Qumsieh | No .. not Just Another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: 2 Oct 1998 18:10:46 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Reminder: Randal Schwartz in Dallas Saturday October 3rd
Message-Id: <6v34v6$7p12@mercury.adc.com>
A final reminder. Randal will be giving his famous "Just Another
Convicted Perl Hacker" talk in Dallas tomorrow. Details:
Where: Doubletree Hotel at Lincoln Center
Washington-Jackson-Adams Room
5410 LBJ Freeway (635 & North Dallas Tollway)
Dallas, TX 75240
When: 2:00pm to 5:00pm Saturday, October 3rd
Cost: No charge
Contact: Brand Hilton <bhilton@adc.com>
See you there!
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: Fri, 02 Oct 1998 18:41:01 GMT
From: dag@sonsorol.org
Subject: Sending email attachments with Mail::Mailer and sendmail
Message-Id: <6v36nt$j8$1@nnrp1.dejanews.com>
Hey perl people...
I'm trying to use Mail::Mailer and MIME::Base64 to
send text files as email attachments on a system
running Digital Unix and sendmail.
Mail::mailer works fine and I have no trouble
encoding the text I want to send. The problem I
have is getting the encoded text recognized and
handled as an attachment instead of just being
included in the body of the mail messge :)
Looking for any and all pointers on info that will show
me how to get the encoded text recognized as
a MIME email attachment (am I missing required
headers or something?) The module pod info does
not seem to cover this area.
Thanks for the help!
Chris Dagdigian
cdagdigian@genetics.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 13:26:38 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Sending filehandle to a client before closing socket
Message-Id: <3615d193.20210752@news.ping.be>
user wrote:
>With a little help from "Effective Perl Programming" and Jay Rodger's
>Net::Telnet, I have been able to create a perl script which creates a
>socket on a specified port, connect to a router via Net::Telnet and then
>send the information back to the user on a remote system. The remote
>user can issue multiple commands but will not recieve information back
>from the open socket until they issue an exit command from their
>terminal. Is there a way for the filehandle (CLIENT) to return the data
>after each command is entered?
It sounds lke a block buffering problem (wild guess, I have virtualy no
experience in this field).
Include something like this somewhere in your code:
{
my $fh = select CLIENT;
$| = 1;
select $fh;
}
See $| in PERLVAR.POD; select in PERLFUNC.POD and PERLFAQ5.POD atarting
around line 61.
Bart.
------------------------------
Date: Fri, 2 Oct 1998 14:30:43 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: string from array
Message-Id: <6v364j$hut$1@earth.superlink.net>
Hi -
lr@hpl.hp.com (Larry Rosler) writes:
>[Posted to comp.lang.perl.misc and a copy mailed.]
>Gosh. The '-w' flag doesn't complain about the *declaration* of a
>variable with an undefined value (God forbid it should!). It complains
>only when you *use* such a variable. And '$string = "@ary"' uses $".
>As Larry Wall pointed out, '"@ary" is translated to join($", @ary)
>internally.'.
>Use of unitialized value at -e line 1.
Ugh. I'd managed to leave out the "" in testing it, then pared it down....
David Black
dblack@saturn.superlink.net
------------------------------
Date: Fri, 02 Oct 1998 18:34:57 GMT
From: etrim@my-dejanews.com
Subject: uppercase to lowercase
Message-Id: <6v36ch$vgq$1@nnrp1.dejanews.com>
Hey everyone,
I have a very simple question. I want to check if the user correctly entered
address of the image (gif or jpg) Using $image =~ /.gif/ i can find out if
$image contains .gif in it. But what if the users wrote .Gif, or .JPg and so
on....i don't want to check for earch one. Is there a quicker way of doing
this? I thought of converting $image to lowercase and then check for .gif or
.jpg but i don't even know the command to do that.
I appreciate any help,
Thanks,
erik
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 19:00:24 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: uppercase to lowercase
Message-Id: <36152054.958CB594@bbnplanet.com>
perldoc perlre should contain the answers to all your questions.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 12:09:02 -0700
From: dana watanabe <dwatanab@uci.edu>
Subject: Re: uppercase to lowercase
Message-Id: <3615248E.6B98835B@uci.edu>
one way to do that would be to do $image =~ /\.[Gg][Ii][Ff]/
or since you mentioned jpegs, $image =~ /\.( ?:[Gg][Ii][Ff] | [Jj][Pp][Gg]
)/
you definitely want to backslasht the period cuz otherwise someone
could enter 'foogif' and that would fly and that would stink
if you wanted it to be all in lower case for other uses,
you could translate the characters via y (y (A-Z) (a-z) ) (that's tr or y,
there)
of course, the perlre manpage if you have that installed might provide
some better tips
etrim@my-dejanews.com wrote:
> I have a very simple question. I want to check if the user correctly entered
> address of the image (gif or jpg) Using $image =~ /.gif/ i can find out if
> $image contains .gif in it. But what if the users wrote .Gif, or .JPg and so
> on....i don't want to check for earch one. Is there a quicker way of doing
> this? I thought of converting $image to lowercase and then check for .gif or
> .jpg but i don't even know the command to do that.
------------------------------
Date: 2 Oct 1998 17:49:35 GMT
From: "Rich Sy" <Richmont.Sy@exchange.sms.siemens.com>
Subject: Using PerlMenu.pm - DEL Key exits my application
Message-Id: <01bdee2c$83e2ea20$5a2ae2a5@rsy.sms.siemens.com>
We're using 'perlmenu.pm' module in our program. Whenever user presses DEL
or END key at &menu_display_template routine, the program exits (exit code
1). Can anyone tell me how I can control this. I don't want the program
to exit on these keys. Debugging shows me that it could be exiting within
the &wgetch call in &collect_seq routine.
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=svr4, osvers=, archname=RM600-svr4
uname='sinix-y sni 5.42 a1005 rm600 2127 r4000 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=n useperlio=undef d_sfio=undef
Thanks in advance.
Rich :)
Richmont.Sy@exchange.sms.siemens.com
------------------------------
Date: Fri, 02 Oct 1998 15:32:55 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: Win32::AdminMisc UserChangePassword Quesiton
Message-Id: <36152A67.D6747273@mail.tju.edu>
Brent Michalski wrote:
> if(Win32::AdminMisc::UserChangePassword("","username","oldpassword","newpassword")){
> print "Password Changed!\n";
> } else {
> print "Password NOT changed!\n";
> }
>
> The password NEVER gets changed. I have tried running this as the user
> whos password I want to change and as Administrator.
It works for me. Be sure to check the User Manager Policies:Account Policy section.
Maybe a setting there is throwing you off. I recall that this happened to me in the dim
and distant past. Can't remember what I changed - maybe 'minimum password length'? Or
was it 'minimum password age'?
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3877
**************************************