[22141] in Perl-Users-Digest
Perl-Users Digest, Issue: 4362 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 8 03:05:38 2003
Date: Wed, 8 Jan 2003 00:05:09 -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 Wed, 8 Jan 2003 Volume: 10 Number: 4362
Today's topics:
5.8.0 build problem on HPUX 10.26 (a variant of 10.20) (Joe Nall)
Re: autoresponse email <jurgenex@hotmail.com>
Re: autoresponse email <mouseslinger@hotmail.com>
Re: Detecting media change/closing of CD tray? <mouseslinger@hotmail.com>
Re: Detecting media change/closing of CD tray? (Sam Holden)
Re: File IO, append <goldbb2@earthlink.net>
Re: File IO, append (Jeff Mott)
Re: Find fixed drives in BATCH file or a PERL script (Jay Tilton)
Internet chat CGI script <calc83p@yahoo.com>
Re: Internet chat CGI script <calc83p@yahoo.com>
Re: Need help with split <Jodyman@hotmail.com>
Re: Need help with split <Jodyman@hotmail.com>
Re: Need help with split <uri@stemsystems.com>
Re: Need help with split <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Jan 2003 22:01:44 -0800
From: joe@nall.com (Joe Nall)
Subject: 5.8.0 build problem on HPUX 10.26 (a variant of 10.20)
Message-Id: <9d1ed006.0301072201.2fc9abef@posting.google.com>
Pointers as to what the testa are testing or why they might have
failed would be appreciated :)
joe
lib/ExtUtils/t/INST..................ok
lib/ExtUtils/t/Installed.............# Failed test
(../lib/ExtUtils/t/Installed.t at line 161)
# got: '0'
# expected: '1'
FAILED at test 29
lib/ExtUtils/t/INST_PREFIX...........ok
lib/ExtUtils/t/Manifest..............ok
lib/ExtUtils/t/Mkbootstrap...........# Failed test
(../lib/ExtUtils/t/Mkbootstrap.t at line 87)
# ''
# doesn't match '(?-xism:Unable to open dasboot\.bs)'
FAILED at test 8
lib/ExtUtils/t/MM_BeOS...............skipping test on this platform
lib/ExtUtils/t/MM_Cygwin.............skipping test on this platform
lib/ExtUtils/t/MM_NW5................skipping test on this platform
lib/ExtUtils/t/MM_OS2................skipping test on this platform
lib/ExtUtils/t/MM_Unix...............ok
lib/ExtUtils/t/MM_VMS................skipping test on this platform
lib/ExtUtils/t/MM_Win32..............skipping test on this platform
lib/ExtUtils/t/Packlist..............# Failed test
(../lib/ExtUtils/t/Packlist.t at line 98)
# ''
# doesn't match '(?-xism:Can't open file)'
FAILED at test 17
lib/ExtUtils/t/prefixify.............ok
...
t/x2p/s2p............................ok
Failed 3 test scripts out of 661, 99.55% okay.
------------------------------
Date: Wed, 08 Jan 2003 03:48:25 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: autoresponse email
Message-Id: <dcNS9.20235$1c.7650@nwrddc01.gnilink.net>
web tur wrote:
> How can I run a perl script after receiving an email. Where can I
> find some solution
Not that this would have anything to do with Perl but procmail is usually
the answer.
jue
------------------------------
Date: Wed, 08 Jan 2003 05:18:10 GMT
From: <mouseslinger@hotmail.com>
Subject: Re: autoresponse email
Message-Id: <mwOS9.676772$QZ.101520@sccrnsc02>
"web tur" <web_tur@yahoo.com> wrote in message
news:5e61b5b9.0301071141.1cbc2224@posting.google.com...
> How can I run a perl script after receiving an email. Where can I find
some solution
>
> Best Regards
1) Could you please tell me what your MTA (Mail Transfer Agent) is.
( Sendmail? qmail? Other? )
2) Could you please tell me what mail server you are using?
3) Is this your mail server? Or is this for an email account that is hosted
someplace else?
There are a number of different ways to provide an autoresponder for an
email.
- David
- http://www.cgiwebsite.com
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 1/6/03
------------------------------
Date: Wed, 08 Jan 2003 05:34:51 GMT
From: <mouseslinger@hotmail.com>
Subject: Re: Detecting media change/closing of CD tray?
Message-Id: <%LOS9.677352$NH2.48170@sccrnsc01>
"Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
news:slrnb1mvph.6jf.sholden@flexal.cs.usyd.edu.au...
> On Wed, 08 Jan 2003 00:55:45 GMT, mouseslinger@hotmail.com wrote:
> [snip]
> >
> > Geez. Sam. A little grumpy towards the Linux aren't you?
>
> No.
>
> >
> > Did you have a bad experience with a Penguin when you were a child or
> > something?
>
> No.
>
> >
> > All the person said was that his/her computer OS was Linux.
> >
> > It was mentioned earlier that the task was probably OS Specific.
> >
> > This IS a Perl newsgroup and the original question was about accessing
the
> > CD Rom via Perl.
> >
> > As for your telling the person to go elsewhere, do I detect that your
> > preference would be that Linux users go elsewhere? Perhaps you should
take
> > notice of the newsgroups name "comp.lang.perl.misc", I don't see ANY
> > specific OS mentioned at all actually.
>
> Since I'm a linux user, I obviously don't wish them to go elsewhere. Once
> the poster knows the question is OS specific, asking in a newsgroup
> appropriate to that OS makes far more sense. That way you might actually
> get a useful answer.
>
> >
> > In any event, here is some information regarding how to access the CD
rom
> > drive via Perl.
> >
> > Check out http://search.cpan.org
> >
> > POE::Component::CD::Detect
> > Detects CD insertions and provides TOC.
> >
> > You should be able to detect an insertion and/or media change using the
> > above module.
>
> Which is specifically *not* what was wanted. As indicates by the text
> in the original post 'it is not certain that a CD is placed in it'. Of
> course my interpretation that that includes the CD drive being
> opened while empty and then closed, might be wrong also...
> > And then if you want to eject the CD Rom, you can probably just use the
> > following to call "eject" from Linux.
> >
> > #eject the cdrom tray.
> > system('eject');
>
> Emphasis on the 'probably':
>
> ; ssh mrmph
> sholden@mrmph's password:
> Linux mrmph 2.4.19-686 #1 Mon Nov 18 23:59:03 EST 2002 i686 unknown [snip]
>
> Most of the programs included with the Debian GNU/Linux system are
> freely redistributable; the exact distribution terms for each program
> are described in the individual files in /usr/share/doc/*/copyright
>
> Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
> permitted by applicable law.
> Last login: Tue Jan 7 15:04:04 2003
> sholden@mrmph:~$ eject
> -bash: eject: command not found
>
> Though of course installing it wouldn't be a problem.
>
The author of eject's email address is on the website below.
http://www.zortec.ro/hilfe/pak_e/paket_eject.html
You can also find eject by doing a simple search on various search engines.
- David
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 1/6/03
------------------------------
Date: 8 Jan 2003 06:47:48 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Detecting media change/closing of CD tray?
Message-Id: <slrnb1nick.a34.sholden@flexal.cs.usyd.edu.au>
On Wed, 08 Jan 2003 05:34:51 GMT, mouseslinger@hotmail.com wrote:
>
> "Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
> news:slrnb1mvph.6jf.sholden@flexal.cs.usyd.edu.au...
>
>> > And then if you want to eject the CD Rom, you can probably just use the
>> > following to call "eject" from Linux.
>> >
>> > #eject the cdrom tray.
>> > system('eject');
>>
>> Emphasis on the 'probably':
>>
>> ; ssh mrmph
>> sholden@mrmph's password:
>> Linux mrmph 2.4.19-686 #1 Mon Nov 18 23:59:03 EST 2002 i686 unknown [snip]
>>
>> Most of the programs included with the Debian GNU/Linux system are
>> freely redistributable; the exact distribution terms for each program
>> are described in the individual files in /usr/share/doc/*/copyright
>>
>> Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
>> permitted by applicable law.
>> Last login: Tue Jan 7 15:04:04 2003
>> sholden@mrmph:~$ eject
>> -bash: eject: command not found
>>
>> Though of course installing it wouldn't be a problem.
>>
>
> The author of eject's email address is on the website below.
> http://www.zortec.ro/hilfe/pak_e/paket_eject.html
>
> You can also find eject by doing a simple search on various search engines.
If I wanted the damn program I'd simply type: 'sudo apt-get install eject'.
What makes you think I want it???
--
Sam Holden
------------------------------
Date: Tue, 07 Jan 2003 23:39:15 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: File IO, append
Message-Id: <3E1BAB73.8C514533@earthlink.net>
Jeff Mott wrote:
>
> open DAT, '>>test.txt' or die $!;
> seek DAT, 0, SEEK_SET or die $!;
> print DAT 'hello' or die $!;
> seek DAT, 0, SEEK_SET or die $!;
> print DAT 'foo' or die $!;
>
> The resulting file is hellofoo instead of foolo
> Is the append mode not supposed to allow you to overwrite previous
> data?
Yes -- every write to a file in append mode is rather like a combination
of seek-to-end then write.
> Is there a way around it?
No. Append mode always results in writes appending to the file.
> I need open a file for writing, creating it if necessary, without
> truncating the contents.
use Fcntl;
sysopen( DAT, "text.txt", O_CREAT|O_WRONLY) or die;
> Am I going to have to use sysopen?
If you want the file created in write-only mode, yes. If you don't mind
the filehandle being both readable and writable, you can do:
open( DAT, "+<", "text.txt" ) or die;
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: 7 Jan 2003 22:49:35 -0800
From: jeffmott@twcny.rr.com (Jeff Mott)
Subject: Re: File IO, append
Message-Id: <f9c0ce19.0301072249.5885c906@posting.google.com>
> What you want is read/write access, which is explained in the above
> perldoc. Key thing to look for in the doc is the + sign.
+>> is still append mode, +> will truncate the file's contents, +<
will not create the file if necessary, which is why I'm thinking I
need to use sysopen. Unless there's another method I overlooked.
------------------------------
Date: Wed, 08 Jan 2003 02:13:47 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Find fixed drives in BATCH file or a PERL script
Message-Id: <3e1b879d.207125973@news.erols.com>
mehul111@yahoo.com (Mehul) wrote:
: Hi all,
: Is there any way to determine the fix drives and network mapped
: drives on a computer from a batch file or a perl script?
#!perl
use warnings;
use strict;
use Win32::OLE 'in';
my @dtypes = (
'unknown disk type',
'Removable disk',
'Fixed disk',
'Remote volume',
'CD-ROM',
'RAM disk',
);
my $fso = Win32::OLE->new('Scripting.FileSystemObject');
for ( in $fso->Drives ) {
printf "Drive %s is a %s\n",
$_->{DriveLetter},
$dtypes[ $_->{DriveType} ] ;
}
------------------------------
Date: Wed, 08 Jan 2003 06:24:14 GMT
From: "Alan Hamlett" <calc83p@yahoo.com>
Subject: Internet chat CGI script
Message-Id: <iuPS9.32971$p_6.2775033@bgtnsc04-news.ops.worldnet.att.net>
I am taking on the task of making an internet chat room using perl at
http://83p.tigalaxy.com/anthem/nt/ so that i can talk to my programmer
friends and my chat room is rather bad. I am thinking this is because of the
limitations of perl because i cant think of any way to improve it but any
suggestions would be appreciated. You can login to the above link using
username: demo and password: demo and the source code for the script is in 9
different files, not including the database files. I wrote a quick little
script at http://83p.tigalaxy.com/anthem/nt/source.cgi to let everyone view
the source of each file used. Does anyone have any suggestions that would
help improve the chat? thanks
------------------------------
Date: Wed, 08 Jan 2003 06:37:55 GMT
From: "Alan Hamlett" <calc83p@yahoo.com>
Subject: Re: Internet chat CGI script
Message-Id: <7HPS9.32983$p_6.2776819@bgtnsc04-news.ops.worldnet.att.net>
i forgot to say that my handle in the chat is Devik
------------------------------
Date: Wed, 08 Jan 2003 05:08:20 GMT
From: "Jodyman" <Jodyman@hotmail.com>
Subject: Re: Need help with split
Message-Id: <8nOS9.19977$134.2109553@newsread1.prod.itd.earthlink.net>
"Joe Smith" <inwap@inwap.com> wrote in message
news:DTxS9.1778$io.80756@iad-read.news.verio.net...
> In article <kAtS9.20841$9N5.1871632@newsread2.prod.itd.earthlink.net>,
> Jodyman <Jodyman@hotmail.com> wrote:
> >I stand by my final answer for even the four\five filename in unix:
> >my $filename3 = '/home/test';
> >my $filename4 = '/four\five';
>
> Your sub fails for "$filename4 = 'four\five'";
Joe, what version of Perl are you using? Works fine for me. Check it
again.
Jody
PS - If it fails, what do you get?
------------------------------
Date: Wed, 08 Jan 2003 05:08:28 GMT
From: "Jodyman" <Jodyman@hotmail.com>
Subject: Re: Need help with split
Message-Id: <gnOS9.19978$134.2109553@newsread1.prod.itd.earthlink.net>
<news@roaima.freeserve.co.uk> wrote in message
> Jodyman <Jodyman@hotmail.com> wrote:
> > sub base {
> > [...]
> > ($rf) = $wf =~ /(^.+?)[\/]/;
>
> > PS - for windows: ($rf) = $wf =~ /(^.+?)[\\]/;
>
>
> There's the nub. You've written a script that appears to be intended
> for both UNIX and Windows filesystems, but you need a program change
> (or additional visible code complexity) to handle this differentiation.
Chris,
This is true. In my 28+ years programming, I've never used \ in a
filename.
I guess I'm just not that creative! :-) Your filename might even crash the
basename
module running under unix/linux. I haven't tried it.
Have Fun,
Jody
------------------------------
Date: Wed, 08 Jan 2003 05:56:57 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Need help with split
Message-Id: <x7y95wp4ky.fsf@mail.sysarch.com>
>>>>> "J" == Jodyman <Jodyman@hotmail.com> writes:
J> "Joe Smith" <inwap@inwap.com> wrote in message
J> news:DTxS9.1778$io.80756@iad-read.news.verio.net...
>> In article <kAtS9.20841$9N5.1871632@newsread2.prod.itd.earthlink.net>,
>> Jodyman <Jodyman@hotmail.com> wrote:
>> >I stand by my final answer for even the four\five filename in unix:
>> >my $filename3 = '/home/test';
>> >my $filename4 = '/four\five';
>>
>> Your sub fails for "$filename4 = 'four\five'";
J> Joe, what version of Perl are you using? Works fine for me. Check it
J> again.
you are missing the point. \ is NOT a valid unix file separator. so you
code splits on it and that is WRONG. simple. your code is broken since
it is using a poor specification.
this is why using a module is a good idea.
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
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Wed, 08 Jan 2003 05:59:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Need help with split
Message-Id: <x7u1gkp4fv.fsf@mail.sysarch.com>
>>>>> "J" == Jodyman <Jodyman@hotmail.com> writes:
J> <news@roaima.freeserve.co.uk> wrote in message
>> Jodyman <Jodyman@hotmail.com> wrote:
>> > sub base {
>> > [...]
>> > ($rf) = $wf =~ /(^.+?)[\/]/;
>>
>> > PS - for windows: ($rf) = $wf =~ /(^.+?)[\\]/;
>>
>>
>> There's the nub. You've written a script that appears to be intended
>> for both UNIX and Windows filesystems, but you need a program change
>> (or additional visible code complexity) to handle this differentiation.
J> This is true. In my 28+ years programming, I've never used
J> \ in a filename. I guess I'm just not that creative! :-) Your
J> filename might even crash the basename module running under
J> unix/linux. I haven't tried it.
does the fact that you never use it nor tried it make it a valid
filename separator on unix? requiring someone to change a program based
on the OS is not good programming. the module would work correctly on
ALL platforms and need no changes in the code. yours is broken on unix
and requires changing based on the platform. how would you handle macos?
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
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
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 4362
***************************************