[22498] in Perl-Users-Digest
Perl-Users Digest, Issue: 4719 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 17 11:05:49 2003
Date: Mon, 17 Mar 2003 08:05:07 -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 Mon, 17 Mar 2003 Volume: 10 Number: 4719
Today's topics:
Can I use session Variables in Perl <ynykon@lvivmedia.lviv.net>
Re: CGI: how to clear form? <peakpeek@purethought.com>
Re: DES 64 bit encryption in Perl <zentara@highstream.net>
Re: Embedding Perl in C/C++... pointer assignment probl <Thomas.Kratz@lrp.de.nospam>
Re: Embedding Perl in C/C++... pointer assignment probl <im_not_giving_it_here@i_hate_spam.com>
Re: How to execute find -exec in perl? <jurgenex@hotmail.com>
Re: How to execute find -exec in perl? (Randal L. Schwartz)
OLE Clipboard DisplayAlerts CLSID ProgID <wallus@results-hannover.de>
OLE Clipboard DisplayAlerts CLSID ProgID <wallus@results-hannover.de>
Re: OLE Clipboard DisplayAlerts CLSID ProgID <please@no.spam>
reading every other byte (Zach Jones)
Re: regexp and grouping (Tad McClellan)
Re: regexp and grouping (Anno Siegel)
Re: return value of 'accept' in PF_UNIX sockets <mzawadzk@man.poznan.pl>
Run perl script under Mac OS X <sbour@niaid.nih.gov>
Re: Run perl script under Mac OS X (Randal L. Schwartz)
Re: Run perl script under Mac OS X <sbour@niaid.nih.gov>
Re: Run perl script under Mac OS X <ian@WINDOZEdigiserv.net>
Re: Send files from FORM to Mail in Outlook <timgbp@tims.ericsson.se>
Re: Send files from FORM to Mail in Outlook <timgbp@tims.ericsson.se>
SOAP::Lite <pkornmod@hotmail.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Strange problem with tied hashes (long) (Miko O'Sullivan)
Wanted, Ideas to capture live stream (Joe)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 Mar 2003 17:56:47 +0200
From: Yurij Nykon <ynykon@lvivmedia.lviv.net>
Subject: Can I use session Variables in Perl
Message-Id: <3E75F03F.3080805@lvivmedia.lviv.net>
Hi,
what I need is to use some Session variables on my web-Project. I have
to initialize a session-Variable on one web-page and check it on another.
is it possible?
If yes, how?
Please send me some code example,
Any help will be appreciated
Thank you in advance
Yurij
------------------------------
Date: Mon, 17 Mar 2003 11:46:34 +0000
From: Sharon Grant <peakpeek@purethought.com>
Subject: Re: CGI: how to clear form?
Message-Id: <4obb7v0755ao5hrige9trrkpqgjor7lsn4@4ax.com>
On Mon, 17 Mar 2003 10:57:19 +0100, in comp.lang.perl.misc, Josef Möllers <josef.moellers@fujitsu-siemens.com>
wrote:
>Josef Möllers wrote:
>>
>> Shroan (haha can't spell her own name) Grant wrote:
>> >
>> > On Mon, 17 Mar 2003 09:00:52 +0100, in comp.lang.perl.misc, Josef Möllers <josef.moellers@fujitsu-siemens.com>
>> > wrote:
>> > >
>> > >How do I generate a blank form?
>> >
>> > The CGI.pm documentation has answers to this:
>> > http://stein.cshl.org/WWW/software/CGI/
>> >
>> > See "Deleting all Parameters". I think this will work according
>> > to the requirement you described
>>
>> Unfortunately it doesn't seem to work. I just tried using the "Simple
>> Script" example (the "eenie meenie minie moe" form) from the CGI manpage
>> and inserted
>>
>> my $query = new CGI;
>> $query->delete_all();
>>
>> right at the top but the reply page generated (the one with the response
>> below the ruler) still has the name in the entry field.
>>
>> Even if I change the
>> textfield('name')
>> to any of
>> textfield('name', "XXX")
>> or
>> textfield(-name=>'name', -default=>'XXX',)
>>
>> it is still initialized with the value I inserted before.
That's because you are mixing the function-oriented style of using
CGI.pm with the object-oriented style
# object style
$query->delete_all(); # will only delete the parameters in $query
$query->textfield(-name=>'name', -default=>'XXX',);
# function style
Delete_all();
textfield(-name=>'name', -default=>'XXX',);
Note that the function style requires you to use Delete_all, not
delete_all() This is not documented in the CGI.pm Web page. I
just found it in the POD documentation in the module
>A quick look into CGI.pm revealed that I should use
> textfield(-name => 'name', -override => 1, -value => "XXX")
>and it worked as you suggested:
OK, but delete_all() or Delete_all() is more convenient if you
want to clear the entire form
--
Sharon
------------------------------
Date: Mon, 17 Mar 2003 10:28:06 -0500
From: zentara <zentara@highstream.net>
Subject: Re: DES 64 bit encryption in Perl
Message-Id: <78qb7vg071rclqiu76qsp02orn0qijhq27@4ax.com>
On 16 Mar 2003 22:25:49 -0800, permata@cryptonics.com.my (Permata)
wrote:
>I've tried but doesn't seams to work properly.
Your script works for me on linux with perl5.8.
Are you using windows?
I don't see what your problem is other than you
didn't test to compare your decrypted value before
and after BASE64 encoding. I did that below, works fine.
#!/usr/bin/perl
use MIME::Base64;
use Crypt::CBC;
use vars '$CIPHER';
my $secret = "cryp1234";
$CIPHER = Crypt::CBC->new( {'key' => $secret,'cipher' =>
'DES','regenerate_key' => 0, 'prepend_iv' => 0});
my $value = $CIPHER->encrypt("cryptonics");
print "CBC-encrypt ->",$value,"\n";
$value64e = encode_base64($value);
print "Base64-encoded-> $value64e \n";
$value64d = decode_base64($value64e);
print "Base64-decoded -> $value64d \n\n";
$value = $CIPHER->decrypt($value);
print "CBC-decrypt -> $value\n";
$valuetest = $CIPHER->decrypt($value64d);
print "CBC-decrypt -> $valuetest\n";
------------------------------
Date: Mon, 17 Mar 2003 13:32:06 +0100
From: "Thomas Kratz" <Thomas.Kratz@lrp.de.nospam>
Subject: Re: Embedding Perl in C/C++... pointer assignment problems (OT)
Message-Id: <3e75c7fb.0@juno.wiesbaden.netsurf.de>
DQoiQXNmYW5kIFlhciBRYXppIiB3cm90ZS4uLg0KPiANCj4gTm90IHRvIHdvcnJ5LCAiSSBoYXZl
IGEgY3VubmluZyBwbGFuIiAoMjAgbWlsbGlvbiBiYXJyZWxzIG9mIG9pbCB0byANCj4gd2hvZXZl
ciBjYW4gdGVsbCBtZSB3aGVyZSB0aGF0IGxpbmUgY29tZXMgZnJvbS4pDQoNClRoZSBxdW90ZSBp
c24ndCB0aGF0IHVuaXF1ZS4gQnV0IGJlZm9yZSBteSBtaW5kcyBleWUgSSBzZWUgQmFsZHJpY2sg
dXR0ZXJpbmcgdGhhdCBwaHJhc2Ugd2l0aCBhIHZlcnkgYm9yZWQgbG9va2luZyBCbGFjayBBZGRl
ciBieSBoaXMgc2lkZS4gT25lIG9mIHRoZSBmdW5uaWVzdCBjb21lZHkgc2VyaWVzIG9mIGFsbCB0
aW1lLg0KDQpUaG9tYXM=
------------------------------
Date: Mon, 17 Mar 2003 11:41:03 +0000
From: Asfand Yar Qazi <im_not_giving_it_here@i_hate_spam.com>
Subject: Re: Embedding Perl in C/C++... pointer assignment problems
Message-Id: <b54c67$fnc$1@news7.svr.pol.co.uk>
>
> Your type-checking plan will not work out, however. At run time, type
> information is unknown in C.
>
Not in C++, though, which I indicated I would be using 'for real'.
Not to worry, "I have a cunning plan" (20 million barrels of oil to
whoever can tell me where that line comes from.)
I will implement an intermediate class that does perform type checking
on copying void* 's, which will be accessible thru Perl and C++.
Although I could use the SWIG approach, i.e. store the type name and
also a pointer in a string: "__mangled_type_name_4DLKJ4__:0xdeadbeef"
------------------------------
Date: Mon, 17 Mar 2003 15:37:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to execute find -exec in perl?
Message-Id: <UYlda.42868$iq1.23299@nwrddc02.gnilink.net>
Bernd Fischer wrote:
> I want to recursively change the permissions mode
> of a directory and files of that selected directory.
>
> foreach( @dir_list ){
> @args = ( "find", "$_ -type f -exec chmod 464 {} \\\;" );
> system( @args );
Is there any reason not to
use File::Find;
and
chmod()
> Is there an elegant way to do this complete in Perl rather than
> calling the UNIX find command?
Indeed, there is. Just use the proper Perl functions listed above.
jue
------------------------------
Date: Mon, 17 Mar 2003 15:39:23 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Bernd Fischer <bernd.fischer@xignal.de>
Subject: Re: How to execute find -exec in perl?
Message-Id: <3137c016266c68b185ae6cbb781f5348@news.teranews.com>
>>>>> "Bernd" == Bernd Fischer <bernd.fischer@xignal.de> writes:
Bernd> Hi,
Bernd> I want to recursively change the permissions mode
Bernd> of a directory and files of that selected directory.
Bernd> In UNIX I can do a
Bernd> find . -type f -exec chmod 664 {} \;
Bernd> and a
Bernd> find . -type d -exec chmod 775 {} \;
No need to invoke find... do it within Perl:
use File::Find;
find sub {
if (-f) {
chmod 0664, $_ or warn "Cannot chmod $File::Find::name: $!";
} elsif (-d _) {
chmod 0775, $_ or warn "Cannot chmod $File::Find::name: $!";
}
}, ".";
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Mon, 17 Mar 2003 14:21:33 +0100
From: Harald wallus <wallus@results-hannover.de>
Subject: OLE Clipboard DisplayAlerts CLSID ProgID
Message-Id: <i0i45b.bco.ln@mail.results-hannover.de>
Dears,
since two month I working with the OLE Module and Excel. And it works
fine. But there is one problem and I have one more question.
Cut out from program:
$Win32::OLE::Warn = 3; # die on errors...
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
$Allset = $Excel->Workbooks->Open($tplf); # open Excel file
$AllSheetset = $Allset->Worksheets($usesheet);
$Bookset = $Excel->Workbooks->Open($fullname); # open Excel file
$Sheetset = $Bookset->Worksheets($usesheet);
$Sheetset->Activate(); #Rows("4:4").Select ;Selection.Copy
$Sheetset->Rows("10:10")->Select();
$Sheetset->Rows("10:10")->Copy(); $AllSheetset->Activate();
$AllSheetset->Range("$outline")->Select();#outline is +=1 for each
Sheetset.
$AllSheetset->Paste();
$Sheetset->Activate();
##Excel->Workbooks(2)->Application->DisplayAlerts=>"False";
$Bookset->Close;
undef $Bookset;
Yes, it copies lines from one workbook (Sheetset) to another one
(AllSheetset).
The problem:
After I close the the Sheetset to open the next one, I got a Alert
message from clippboard: If I want save the content of the clipboard.
When I look at VBA,it is possible to switch off this alert:
Application.DisplayAlerts="False"
But this is not an Excel-method, isn't it?
The commented line in my program above does not work.
How can I set this DisplayAlert?
Now my question:
I think above I have to call the method Win32::OLE->GetActiveObject
with the clipboard to use it.
When I use OLE-Browser I see some more Object, which I like to use.
How could I retrieve the prog ID for the GetActiveObject-method
or how I can determine the classID.
I read that to register an Application is to do with
regedt32 /i <dll-name of application>.
Is there somewhere a more detial explanation of this stuff?
Thanx.
------------------------------
Date: Mon, 17 Mar 2003 09:10:09 +0100
From: Harald wallus <wallus@results-hannover.de>
Subject: OLE Clipboard DisplayAlerts CLSID ProgID
Message-Id: <8pv35b.bin.ln@mail.results-hannover.de>
Dears,
( ask this question in modules but get no answer till now.)
since two month I working with the OLE Module and Excel. And it works
fine. But there is one problem and I have one more question.
Cut out from program:
$Win32::OLE::Warn = 3; # die on errors...
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
$Allset = $Excel->Workbooks->Open($tplf); # open Excel file
$AllSheetset = $Allset->Worksheets($usesheet);
$Bookset = $Excel->Workbooks->Open($fullname); # open Excel file
$Sheetset = $Bookset->Worksheets($usesheet);
$Sheetset->Activate(); #Rows("4:4").Select ;Selection.Copy
$Sheetset->Rows("10:10")->Select();
$Sheetset->Rows("10:10")->Copy(); $AllSheetset->Activate();
$AllSheetset->Range("$outline")->Select();#outline is +=1 for each
Sheetset.
$AllSheetset->Paste();
$Sheetset->Activate();
##Excel->Workbooks(2)->Application->DisplayAlerts=>"False";
$Bookset->Close;
undef $Bookset;
Yes, it copies lines from one workbook (Sheetset) to another one
(AllSheetset).
The problem:
After I close the the Sheetset to open the next one, I got a Alert
message from clippboard: If I want save the content of the clipboard.
When I look at VBA,it is possible to switch off this alert:
Application.DisplayAlerts="False"
But this is not an Excel-method, isn't it?
The commented line in my program above does not work.
How can I set this DisplayAlert?
Now my question:
I think above I have to call the method Win32::OLE->GetActiveObject
with the clipboard to use it.
When I use OLE-Browser I see some more Object, which I like to use.
How could I retrieve the prog ID for the GetActiveObject-method
or how I can determine the classID.
I read that to register an Application is to do with
regedt32 /i <dll-name of application>.
Is there somewhere a more detial explanation of this stuff?
Thanx.
------------------------------
Date: Mon, 17 Mar 2003 15:21:27 +0000
From: Chris Lowth <please@no.spam>
Subject: Re: OLE Clipboard DisplayAlerts CLSID ProgID
Message-Id: <aMlda.17235$EA6.2414098@newsfep2-win.server.ntli.net>
Harald wallus wrote:
> Dears,
>
> since two month I working with the OLE Module and Excel. And it works
> fine. But there is one problem and I have one more question.
> Cut out from program:
> $Win32::OLE::Warn = 3; # die on errors...
> my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
> || Win32::OLE->new('Excel.Application', 'Quit');
> $Allset = $Excel->Workbooks->Open($tplf); # open Excel file
> $AllSheetset = $Allset->Worksheets($usesheet);
>
> $Bookset = $Excel->Workbooks->Open($fullname); # open Excel file
> $Sheetset = $Bookset->Worksheets($usesheet);
> $Sheetset->Activate(); #Rows("4:4").Select ;Selection.Copy
> $Sheetset->Rows("10:10")->Select();
> $Sheetset->Rows("10:10")->Copy(); $AllSheetset->Activate();
> $AllSheetset->Range("$outline")->Select();#outline is +=1 for each
> Sheetset.
> $AllSheetset->Paste();
> $Sheetset->Activate();
> ##Excel->Workbooks(2)->Application->DisplayAlerts=>"False";
> $Bookset->Close;
> undef $Bookset;
> Yes, it copies lines from one workbook (Sheetset) to another one
> (AllSheetset).
> The problem:
> After I close the the Sheetset to open the next one, I got a Alert
> message from clippboard: If I want save the content of the clipboard.
> When I look at VBA,it is possible to switch off this alert:
> Application.DisplayAlerts="False"
> But this is not an Excel-method, isn't it?
> The commented line in my program above does not work.
> How can I set this DisplayAlert?
> Now my question:
> I think above I have to call the method Win32::OLE->GetActiveObject
> with the clipboard to use it.
> When I use OLE-Browser I see some more Object, which I like to use.
> How could I retrieve the prog ID for the GetActiveObject-method
> or how I can determine the classID.
> I read that to register an Application is to do with
> regedt32 /i <dll-name of application>.
> Is there somewhere a more detial explanation of this stuff?
>
> Thanx.
Not sure about quenching the warning, but I suspect your logic is flawed.
The windows clipboard is a global resource, and your code could be broken
by the user interacting with another program while your script is running,
thus replacing the clipboard contents at the crucial moment. You have built
a "race condition" exploit into your software.
I would suggest finding another way to do it without the clipboard.
Chris
--
My real address is: chris at lowth dot sea oh em
Author of "protector" (http://protector.sourceforge.net)
-- OpenSource (free) e-mail virus protection
------------------------------
Date: 17 Mar 2003 07:48:55 -0800
From: Zachary_E_Jones@raytheon.com (Zach Jones)
Subject: reading every other byte
Message-Id: <ec2b60df.0303170748.23074d3@posting.google.com>
I have a problem. I need every other byte out of this binary file
that I have, and this file is huge. The only way I can think of to do
it is as follows:
open DATAFILE, "thing.data";
for $z (0 .. $bin_file_size)
{
read(DATAFILE,$data,1);
if($z%2 == 0)
{
$data_out = $data_out . $data;
}
}
return $data_out;
This is the slow dirty way to do it and I want a fast way because time
in processing is an issue. Can anyone think of a faster way to do
this?
Thanks in advance.
------------------------------
Date: Mon, 17 Mar 2003 07:12:05 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: regexp and grouping
Message-Id: <slrnb7bid5.3ca.tadmc@magna.augustmail.com>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Bjørnar Libæk <bjoernal@ifi.uio.no> wrote in comp.lang.perl.misc:
>> Given the string "what is wrong with my brain", I want to get every
>> two-letter composition that starts with an 'r' into the grouping-variables,
>> that is, $1='ro' and $2='ra' in this example. How do I do this?
>
> my @hits = 'what is wrong with my brain' =~ /(r.)/g;
my @hits = 'what is wrong with my brain' =~ /(r[a-z])/gi;
is probably better.
What does the OP want when the string is 'mirrored' ?
'rr', 'ro', 're'
or
'rr', 're'
he didn't specify what to do with overlaps...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Mar 2003 13:25:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regexp and grouping
Message-Id: <b54ibe$8qn$1@mamenchi.zrz.TU-Berlin.DE>
Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> > Bjørnar Libæk <bjoernal@ifi.uio.no> wrote in comp.lang.perl.misc:
> >> Given the string "what is wrong with my brain", I want to get every
> >> two-letter composition that starts with an 'r' into the grouping-variables,
> >> that is, $1='ro' and $2='ra' in this example. How do I do this?
> >
> > my @hits = 'what is wrong with my brain' =~ /(r.)/g;
>
>
> my @hits = 'what is wrong with my brain' =~ /(r[a-z])/gi;
>
>
> is probably better.
True. He said "two-letter composition...".
> What does the OP want when the string is 'mirrored' ?
>
> 'rr', 'ro', 're'
> or
> 'rr', 're'
>
> he didn't specify what to do with overlaps...
Well, /g makes a choice and prefers the latter. Otherwise,
@hits = map "r$_", 'mirrored' =~ /((?<=r).)/g;
Anno
------------------------------
Date: Mon, 17 Mar 2003 15:51:16 +0100
From: Marek Zawadzki <mzawadzk@man.poznan.pl>
Subject: Re: return value of 'accept' in PF_UNIX sockets
Message-Id: <Pine.GSO.4.44.0303171542210.4924-100000@rose.man.poznan.pl>
On Thu, 13 Mar 2003, Benjamin Goldberg wrote:
/ ...
> > I'm trying to make something like "username based" authentication with
> > PF_UNIX, so only clients owned by certain users are allowed to connect
> > (ownership of a socket won't help this time)...
>
> Consider using the sendmsg()/recvmsg() functions with an SCM_CREDENTIALS
> message. (You may need to consult an additional manpage ("cmsg") for
> the various types of "struct msghdr" manipulation macros/functions).
Thanks, this would suit my needs. The problem is sendmsg/recvmsg aren't
implemented in Perl. Can anybody provide me with more help on how to send
'out-of-bound' data via Unix-domain sockets in Perl?
I'd like to send credentials of a process or a file descriptor (see FAQ
reference below) from one process to another via Unix-domain socket.
In another post, Ilja Tabachnik directed me to this resource:
Secure UNIX Programming FAQ
(http://www.whitefang.com/sup/secure-faq.html),
section "4.4) How do I authenticate a non-parent process?"
This is exactly what I want, however, I'm having troubles implementing it
in Perl (possibly under IRIX).
Thanks,
-marek
------------------------------
Date: Mon, 17 Mar 2003 10:00:50 -0500
From: Stephan Bour <sbour@niaid.nih.gov>
Subject: Run perl script under Mac OS X
Message-Id: <BA9B4D52.6270%sbour@niaid.nih.gov>
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3130740050_15525688
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
I need to setup a cron job to run a perl script at regular intervals.
However, on my OS X system the command somescript.pl does not run the
somescript.pl script. I need to type perl somescript.pl for it to work.
Question 1: is this the way it works under OS X, period or can I add the
path to Perl somewhere to map any .pl file to Perl? Question 2: does the
command field in the crontab file need to include the path to Perl like so:
usr/bin/perl /Users/steph/somescript.pl
Or will this suffice:
/Users/steph/somescript.pl
Thanks,
Stephan.
--B_3130740050_15525688
Content-type: text/html; charset="US-ASCII"
Content-transfer-encoding: quoted-printable
<HTML>
<HEAD>
<TITLE>Run perl script under Mac OS X</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana">I need to setup a cron job to run a perl script at reg=
ular intervals. However, on my OS X system the command somescript.pl does no=
t run the somescript.pl script. I need to type perl somescript.pl for it to =
work. Question 1: is this the way it works under OS X, period or can I add t=
he path to Perl somewhere to map any .pl file to Perl? Question 2: does the =
command field in the crontab file need to include the path to Perl like so:<=
BR>
usr/bin/perl /Users/steph/somescript.pl<BR>
Or will this suffice:<BR>
/Users/steph/somescript.pl<BR>
<BR>
Thanks,<BR>
<BR>
Stephan.</FONT>
</BODY>
</HTML>
--B_3130740050_15525688--
------------------------------
Date: Mon, 17 Mar 2003 15:39:22 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Run perl script under Mac OS X
Message-Id: <73e19f332cb551d1a96caaa4ffb3fa6e@news.teranews.com>
>>>>> "Stephan" == Stephan Bour <sbour@niaid.nih.gov> writes:
Stephan> I need to setup a cron job to run a perl script at regular intervals.
Stephan> However, on my OS X system the command somescript.pl does not run the
Stephan> somescript.pl script.
It does if you make it executable (chmod +x script)
and ensure that the first line of the script is exactly
#!/usr/bin/perl
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Mon, 17 Mar 2003 10:53:15 -0500
From: Stephan Bour <sbour@niaid.nih.gov>
Subject: Re: Run perl script under Mac OS X
Message-Id: <BA9B599B.627D%sbour@niaid.nih.gov>
in article 73e19f332cb551d1a96caaa4ffb3fa6e@news.teranews.com, Randal L.
Schwartz at merlyn@stonehenge.com wrote on 3/17/03 10:39:
>>>>>> "Stephan" == Stephan Bour <sbour@niaid.nih.gov> writes:
>
> Stephan> I need to setup a cron job to run a perl script at regular intervals.
> Stephan> However, on my OS X system the command somescript.pl does not run the
> Stephan> somescript.pl script.
>
> It does if you make it executable (chmod +x script)
> and ensure that the first line of the script is exactly
>
> #!/usr/bin/perl
>
> print "Just another Perl hacker,"
All the execute bits are turned on for the script and the script does start
with the #!/usr/bin/perl -w line. However, it does not execute without the
perl command. This is unlikely to be a problem with the script since even
the lesson scripts from my Perl book behave like that when downloaded strait
from the O'Reilly web site and chmod 755.
------------------------------
Date: Mon, 17 Mar 2003 15:59:16 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: Run perl script under Mac OS X
Message-Id: <h3sb7vo0hkcef1g9pnf1vie887nm1jij8t@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Mon, 17 Mar 2003 10:53:15 -0500, Stephan
Bour <sbour@niaid.nih.gov> managed to scribble:
> in article 73e19f332cb551d1a96caaa4ffb3fa6e@news.teranews.com,
> Randal L. Schwartz at merlyn@stonehenge.com wrote on 3/17/03 10:39:
>
> >>>>>> "Stephan" == Stephan Bour <sbour@niaid.nih.gov> writes:
> > Stephan> I need to setup a cron job to run a perl script at
> > regular intervals. Stephan> However, on my OS X system the
> > command somescript.pl does not run the Stephan> somescript.pl
> > script.
> > > >
> > It does if you make it executable (chmod +x script)
> > and ensure that the first line of the script is exactly
> >
> > #!/usr/bin/perl
> >
> > print "Just another Perl hacker,"
>
> All the execute bits are turned on for the script and the script
> does start with the #!/usr/bin/perl -w line. However, it does not
> execute without the perl command. This is unlikely to be a problem
> with the script since even the lesson scripts from my Perl book
> behave like that when downloaded strait from the O'Reilly web site
> and chmod 755.
Are you 100% sure the shebang line points to the correct path on your
box?
What did your "strict" and "warnings" code throw out?
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP 8.0
iQA/AwUBPnXwwmfqtj251CDhEQIwOACgyVDjXo1AOgktg/e1oYzsW86HxHAAoPFK
AO9yNR/V4wtNwkeUkVj7Ldbg
=4884
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Mon, 17 Mar 2003 09:56:16 -0600
From: timgbp <timgbp@tims.ericsson.se>
Subject: Re: Send files from FORM to Mail in Outlook
Message-Id: <3E75F020.20304@tims.ericsson.se>
Thanks for your help.
Tintin escribió:
> "timgbp" <timgbp@tims.ericsson.se> wrote in message
> news:3E726659.1010501@tims.ericsson.se...
>
>>Hi;
>>
>>How I can send archives by means of a Form in attachment, for example
>>documents of Word, Excel, pdf.
>>
>>With a cgi.
>
>
> http://search.cpan.org/author/ERYQ/MIME-Lite-2.117/lib/MIME/Lite.pm
>
>
------------------------------
Date: Mon, 17 Mar 2003 09:56:35 -0600
From: timgbp <timgbp@tims.ericsson.se>
Subject: Re: Send files from FORM to Mail in Outlook
Message-Id: <3E75F033.3070409@tims.ericsson.se>
Thanks David.
David Dorward escribió:
> timgbp wrote:
>
>>How I can send archives by means of a Form in attachment, for example
>>documents of Word, Excel, pdf.
>
>
> http://www.akadia.com/services/email_attachments_using_perl.html
>
------------------------------
Date: Mon, 17 Mar 2003 15:38:06 +0100
From: "Poul Kornmod" <pkornmod@hotmail.com>
Subject: SOAP::Lite
Message-Id: <3e75ddd2$0$134$edfadb0f@dread15.news.tele.dk>
Hi,
I know that it's possible to nest my parameters in SOAP::Data->name like:
my @params = ( SOAP::Data->name(submit =>
{par1 => "1234",
par2 => "Test Test"
}
)
);
Which then produce the following
..
<submit xsi:type="namesp1:SOAPStruct">
<par2 xsi:type="xsd:string">Test Test</par2>
<par1 xsi:type="xsd:int">1234</par1>
</submit>
..
But how do I do assign my nested SOAP elements (name, value, etc.)
dynamically? Something like:
@par1 = SOAP::Data->name(par1 => "1234");
@par2 = SOAP::Data->name(par2 => "Test Test");
my @params = ( SOAP::Data->name(submit =>
{@par1, @par2}
)
);
which of cause doesn't work. Looking very much forward to be hearing from
you!
Best regards
Poul Kornmod
------------------------------
Date: Mon, 17 Mar 2003 15:29:27 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <v7bqeni7b5kn48@corp.supernews.com>
Following is a summary of articles spanning a 7 day period,
beginning at 10 Mar 2003 15:36:08 GMT and ending at
17 Mar 2003 15:28:06 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2003 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com
Totals
======
Posters: 251
Articles: 720 (272 with cutlined signatures)
Threads: 173
Volume generated: 1405.9 kb
- headers: 626.1 kb (11,988 lines)
- bodies: 746.2 kb (24,047 lines)
- original: 455.0 kb (15,674 lines)
- signatures: 32.8 kb (873 lines)
Original Content Rating: 0.610
Averages
========
Posts per poster: 2.9
median: 2 posts
mode: 1 post - 125 posters
s: 4.6 posts
Posts per thread: 4.2
median: 3 posts
mode: 1 post - 43 threads
s: 5.1 posts
Message size: 1999.5 bytes
- header: 890.5 bytes (16.6 lines)
- body: 1061.3 bytes (33.4 lines)
- original: 647.1 bytes (21.8 lines)
- signature: 46.7 bytes (1.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
34 73.1 ( 25.9/ 47.1/ 19.5) Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
25 44.0 ( 23.3/ 19.1/ 9.6) Gunnar Hjalmarsson <noreply@gunnar.cc>
23 49.5 ( 21.0/ 23.8/ 22.4) abigail@abigail.nl
23 62.0 ( 23.6/ 34.7/ 20.0) mgjv@tradingpost.com.au
22 43.6 ( 18.8/ 21.0/ 11.5) Benjamin Goldberg <goldbb2@earthlink.net>
19 31.2 ( 16.3/ 14.3/ 10.6) "Tore Aursand" <tore@aursand.no>
16 24.7 ( 11.2/ 13.4/ 6.7) Jay Tilton <tiltonj@erols.com>
15 31.2 ( 16.5/ 14.7/ 9.4) "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
14 36.3 ( 12.8/ 20.3/ 12.5) tassilo.parseval@post.rwth-aachen.de
13 20.0 ( 11.6/ 8.4/ 5.7) "Jürgen Exner" <jurgenex@hotmail.com>
These posters accounted for 28.3% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
73.1 ( 25.9/ 47.1/ 19.5) 34 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
62.0 ( 23.6/ 34.7/ 20.0) 23 mgjv@tradingpost.com.au
49.5 ( 21.0/ 23.8/ 22.4) 23 abigail@abigail.nl
44.0 ( 23.3/ 19.1/ 9.6) 25 Gunnar Hjalmarsson <noreply@gunnar.cc>
43.6 ( 18.8/ 21.0/ 11.5) 22 Benjamin Goldberg <goldbb2@earthlink.net>
39.2 ( 5.2/ 33.6/ 32.8) 5 tadmc@augustmail.com
36.3 ( 12.8/ 20.3/ 12.5) 14 tassilo.parseval@post.rwth-aachen.de
31.2 ( 16.3/ 14.3/ 10.6) 19 "Tore Aursand" <tore@aursand.no>
31.2 ( 16.5/ 14.7/ 9.4) 15 "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
24.7 ( 11.2/ 13.4/ 6.7) 16 Jay Tilton <tiltonj@erols.com>
These posters accounted for 30.9% of the total volume.
Top 10 Posters by Volume of Original Content (min. five posts)
==============================================================
(kb)
Posts orig Address
----- ----- -------
5 32.8 tadmc@augustmail.com
23 22.4 abigail@abigail.nl
23 20.0 mgjv@tradingpost.com.au
34 19.5 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
14 12.5 tassilo.parseval@post.rwth-aachen.de
22 11.5 Benjamin Goldberg <goldbb2@earthlink.net>
19 10.6 "Tore Aursand" <tore@aursand.no>
25 9.6 Gunnar Hjalmarsson <noreply@gunnar.cc>
15 9.4 "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
16 6.7 Jay Tilton <tiltonj@erols.com>
These posters accounted for 34.1% of the original volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.979 ( 32.8 / 33.6) 5 tadmc@augustmail.com
0.941 ( 22.4 / 23.8) 23 abigail@abigail.nl
0.741 ( 10.6 / 14.3) 19 "Tore Aursand" <tore@aursand.no>
0.733 ( 1.0 / 1.4) 5 Joe Creaney <mail@annuna.com>
0.725 ( 4.8 / 6.6) 6 Steph <sbour@niaid.nih.gov>
0.707 ( 5.7 / 8.1) 8 "Peter Shankey" <oxmard.Rules@ab.ab>
0.697 ( 4.5 / 6.5) 5 "William Alexander Segraves" <wsegrave@mindspring.com>
0.678 ( 5.7 / 8.4) 13 "Jürgen Exner" <jurgenex@hotmail.com>
0.665 ( 2.4 / 3.5) 5 bwalton@rochester.rr.com
0.653 ( 2.4 / 3.7) 6 Pynex <pynex@gmx.de>
Bottom 10 Posters by OCR (minimum of five posts)
================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.488 ( 2.7 / 5.6) 8 "David K. Wall" <usenet@dwall.fastmail.fm>
0.485 ( 1.0 / 2.1) 5 qin jiang wei <qin@freebsd.lzu.edu.cn>
0.483 ( 2.6 / 5.4) 5 Ilya Zakharevich <nospam-abuse@ilyaz.org>
0.476 ( 4.0 / 8.5) 5 Bryan Castillo <rook_5150@yahoo.com>
0.422 ( 6.2 / 14.6) 5 david <dwlepage@yahoo.com>
0.415 ( 19.5 / 47.1) 34 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.385 ( 2.8 / 7.1) 8 Uri Guttman <uri@stemsystems.com>
0.380 ( 1.6 / 4.3) 6 Steve Grazzini <grazz@nyc.rr.com>
0.335 ( 3.5 / 10.4) 5 Bryan Krone <cbk047@email.mot.com>
0.313 ( 3.2 / 10.2) 10 "John W. Krahn" <krahnj@acm.org>
32 posters (12%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
25 What's wrong with the Perl docs
25 it's true but can I say so ?
25 my $x = 100 for 1..3 why is $x undef
17 How to find a word which is palindromica using REGEXP
15 new Perl feature request: call into shared libs
13 Merging log files using hash - good idea/possible?
12 Re to all
12 Stupid Perl Questions
11 [Probably] a stupid question about REGEX
11 FILEHANDLE and search and replace question
These threads accounted for 23.1% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
60.8 ( 23.7/ 35.3/ 20.5) 25 my $x = 100 for 1..3 why is $x undef
56.9 ( 22.0/ 32.8/ 21.5) 25 What's wrong with the Perl docs
47.1 ( 23.6/ 21.3/ 12.8) 25 it's true but can I say so ?
46.9 ( 20.3/ 26.2/ 12.2) 15 new Perl feature request: call into shared libs
33.8 ( 1.9/ 32.0/ 32.0) 2 Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
28.0 ( 6.0/ 21.8/ 9.2) 7 file parse into hash and writing output with certain format to new file
26.0 ( 9.3/ 16.5/ 11.0) 11 FILEHANDLE and search and replace question
25.2 ( 14.1/ 10.6/ 5.4) 17 How to find a word which is palindromica using REGEXP
24.2 ( 11.9/ 11.9/ 8.7) 13 Merging log files using hash - good idea/possible?
23.4 ( 11.6/ 11.5/ 7.1) 12 Re to all
These threads accounted for 26.5% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
=============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.828 ( 4.2/ 5.0) 6 Using filehandles with compare
0.824 ( 5.1/ 6.2) 8 Letting users change their password via web form...
0.751 ( 3.7/ 4.9) 5 derive methods with OO
0.730 ( 8.7/ 11.9) 13 Merging log files using hash - good idea/possible?
0.720 ( 3.9/ 5.5) 7 pass multiple lines in ?
0.710 ( 1.2/ 1.8) 5 how to create own perl module
0.703 ( 5.4/ 7.7) 10 select ip-adress out of pipe delimited file
0.685 ( 2.1/ 3.1) 5 Posting more than 1 string from a file
0.674 ( 1.8/ 2.7) 5 Perl Vs C,C++
0.668 ( 11.0/ 16.5) 11 FILEHANDLE and search and replace question
Bottom 10 Threads by OCR (minimum of five posts)
================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.434 ( 4.3 / 9.9) 11 [Probably] a stupid question about REGEX
0.430 ( 2.5 / 5.8) 8 remove anything from string except two words
0.425 ( 3.9 / 9.2) 6 map - sort - lc in one statement
0.425 ( 9.2 / 21.8) 7 file parse into hash and writing output with certain format to new file
0.416 ( 3.6 / 8.6) 8 Perl Script or Bourne Shell for a Cisco router, Please Help??
0.411 ( 2.9 / 6.9) 6 Creating a variable with a file path/name in it
0.378 ( 3.3 / 8.6) 6 Creating a dynamic list of filehandles
0.377 ( 3.3 / 8.8) 5 CGI: how to clear form?
0.375 ( 3.2 / 8.5) 9 Interpolation problem?
0.324 ( 0.9 / 2.7) 5 where's $1?
57 threads (32%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
11 comp.lang.asm.x86
9 comp.lang.perl.modules
9 comp.lang.perl
8 comp.dcom.sys.cisco
7 alt.certification.cisco
5 comp.os.linux.misc
3 comp.lang.c
2 alt.perl
2 pl.comp.lang.perl
1 comp.protocols.snmp
Top 10 Crossposters
===================
Articles Address
-------- -------
4 "Johnny" <johnthompson1@hotmail.com>
4 Ilya Zakharevich <nospam-abuse@ilyaz.org>
4 joe dekk <no_email@none.abc>
3 "Matt Taylor" <para@tampabay.rr.com>
2 "Tintin" <me@privacy.net>
2 "KP" <kunal.patel@motorola.com>
2 "Shay Hugi" <systemunix@mpthrill.com>
2 ccnp <ccnp@mail.pt>
2 Bill Reynolds <bill_reynolds@hotmail.com>
2 Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
------------------------------
Date: 17 Mar 2003 06:04:30 -0800
From: miko@idocs.com (Miko O'Sullivan)
Subject: Re: Strange problem with tied hashes (long)
Message-Id: <db27ea77.0303170604.19aceadf@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
> PS: Another workaround would be:
>
> if( my $t = tied %{$$self{source}} ) {
> $raw = $t->FETCH($key);
> } else {
> $raw = $$self{source}{$key};
> }
Very nice. Much cleaner than an eval. Thanks!
-Miko
------------------------------
Date: 17 Mar 2003 05:45:24 -0800
From: joemercury@gmx.net (Joe)
Subject: Wanted, Ideas to capture live stream
Message-Id: <d6c57a14.0303170545.1a798f24@posting.google.com>
Hi,
I want to write a Perl program to receive live audio stream. Also play
it and save it, of course :)
I can already start the stream and I know how to request and get the
next audio buffer. This is a proprietery stream, nothing standard. My
question is on ideas how to manage the buffers pool.
When first starting, the program should buffer x number of audio
buffers, say x = 20, then start to play, removing buffers as needed,
at the same time keeping the buffer pool full by getting more data
from the server.
I would love to have examples or snippets of code to get me started on
managing this buffers pool.
Thanks.
------------------------------
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 4719
***************************************