[17642] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5062 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 8 09:05:45 2000

Date: Fri, 8 Dec 2000 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976284311-v9-i5062@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 8 Dec 2000     Volume: 9 Number: 5062

Today's topics:
    Re: ActivePerl Problem <dsdf@sdfd.com>
    Re: ActivePerl Problem (Garry Williams)
    Re: ActivePerl Problem <latsharj@my-deja.com>
    Re: Can anybody help ??? <lincmad001@telecom-digest.zzn.com>
    Re: Can this script be done in a one-liner (Abigail)
    Re: Comparing two folders then writing difference to fi <stewart@webslave.dircon.co.uk>
    Re: CSS files in a cgi script (Abigail)
        file attachment <blnukem@hotmail.com>
    Re: file attachment (Lack Mr G M)
    Re: form-results on other page (Abigail)
    Re: Format (Abigail)
    Re: FTP question <olthoff@multiboard.com>
        Getting Form data <vivekvp@spliced.com>
    Re: Getting Form data (Rafael Garcia-Suarez)
    Re: Getting Form data <tward10@jaguar.com>
        help on regexp (Bill)
    Re: help on regexp (Abigail)
    Re: help on regexp (Bernard El-Hagin)
    Re: Help with HttpSniffer (Abigail)
    Re: How do I bring up the printer dialog via perl? (Csaba Raduly)
        How to get the filename??? <vidulats@yahoo.co.uk>
    Re: How to get the filename??? <rereidy@indra.com>
    Re: IPC::ShareLite; No space left on device errors <steven@ircnet.dk>
    Re: MIME::Lite message bounced by receiver server (Garry Williams)
        Multiple line regular expressions <qades@my-deja.com>
    Re: Multiple line regular expressions (Bernard El-Hagin)
    Re: my foreach loop stops halfway through the array <lincmad001@telecom-digest.zzn.com>
        Process_ID stuff??? <vidulats@yahoo.co.uk>
        Reading an MS Access Table from perl <hoehnm@bluewin.ch>
    Re: Reading an MS Access Table from perl <thf@cisunix.unh.edu>
    Re: Ugh! I hope I can explain this... <mjcarman@home.com>
    Re: Use PERL or Java? Which is faster? <bart.lateur@skynet.be>
    Re: Willing to review a 90 line Perl program? <mjcarman@home.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 8 Dec 2000 13:53:38 +0100
From: "matteo" <dsdf@sdfd.com>
Subject: Re: ActivePerl Problem
Message-Id: <3a30d383@post.usenet.com>

**** Post for FREE via your newsreader at post.usenet.com ****

install apache from apache.org
<alazarev1981@my-deja.com> ha scritto nel messaggio
news:90p262$6ae$1@nnrp1.deja.com...
> I've installed ActivePerl 5.6.0.620 on my windows NT. I can run my file
> (blah.cgi) from the command line and it works perfectly, spits out the
> html taged code with no errors. However, when I try to run that same
> script from an HTML form (action="blah.cgi") it doesn't work. All I get
> is the .cgi file literally printed into my browser.
>
> I have the exact same files running and working on a unix server, so I
> think the error is not in my code.
>
> I suspect the problem is in the first line of the .cgi file:
> #!/usr/local/bin/perl
>
> That line is needed for the unix server, but should it be changed for
> ActivePerl on a WinNT system?
>
> Any ideas?
>
> Thanks in advance,
>
> Alex Lazarevich
> alazarev@itg.uiuc.edu
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
                      http://www.usenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


------------------------------

Date: Fri, 08 Dec 2000 13:24:50 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: ActivePerl Problem
Message-Id: <Ci5Y5.122$uF3.10697@eagle.america.net>

On 8 Dec 2000 06:21:45 GMT, Homer Simpson <homer.simpson@springfield.nul> wrote:
>In article <90p262$6ae$1@nnrp1.deja.com>, alazarev1981@my-deja.com wrote:
>>
>>I suspect the problem is in the first line of the .cgi file:
>>#!/usr/local/bin/perl
>>
>>That line is needed for the unix server, but should it be changed for
>>ActivePerl on a WinNT system?
>>
>lines with a # sign are comments.
>On Unix file systems setting the execute attribute on the file causes the 
>shell to understand that the comment is the path to the interpreter.
 ^^^^^

See exec(2).  "The shell" is _not_ involved.  

-- 
Garry Williams


------------------------------

Date: Fri, 08 Dec 2000 13:19:43 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: ActivePerl Problem
Message-Id: <90qn5b$daf$1@nnrp1.deja.com>

In article <90q1rh$u47$1@nnrp1.deja.com>,
  CM <cmon_209@hotmail.com> wrote:
> > I suspect the problem is in the first line of the .cgi file:
> > #!/usr/local/bin/perl
> >
> > That line is needed for the unix server, but should it be changed
> > for ActivePerl on a WinNT system?
>
> You do not need the above lines for Perl on windows!

Unless of course you are part of that 60-70% of the universe that is
running Apache. In that case you need something like
#!d:/perl/bin/perl -Tw

--
Regards,
Dick


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Fri, 08 Dec 2000 05:08:21 -0800
From: Linc Madison <lincmad001@telecom-digest.zzn.com>
Subject: Re: Can anybody help ???
Message-Id: <081220000508216660%lincmad001@telecom-digest.zzn.com>

In article <dPVX5.473$KAv.15859926@news.xtra.co.nz>, Kelvin Sim
<kjs404@hotmail.com> wrote:

> Hi All
> 
> Sorry for being a pain, as I'm learning as I go along....
> 
> What is wrong with this statement
> 
> print ("Do you wish to continue ? y / n ");
> $an = <STDIN>;
> chop $an;
> if ($an eq "N") {
>  die ("OK Have a good one");
> } else { print ("Still running... ");
> }
> 
> when I answer "N" the die statement prints and then I get the
> following text added onto the end of the die statement..
> 
>      at D:\Perl\test.pl line 52, <STDIN> line 3.
> 
> ...what is causing this ?? and how do I stop this text appearing ??.

Check the documentation for "die" -- page 157 of the Camel book, or
online.


------------------------------

Date: 8 Dec 2000 12:36:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Can this script be done in a one-liner
Message-Id: <slrn931ldh.734.abigail@tsathoggua.rlyeh.net>

On 7 Dec 2000 21:00:56 GMT, Eli the Bearded (elijah@workspot.net) wrote in comp.lang.perl.misc <URL: news:<eli$0012071547@qz.little-neck.ny.us>>:
++ On Dec 1, Derek Ross said:
++ >All it does is read in two lists of integers from the files a.txt and
++ >b.txt, and prints out the sum of each pair.
++  
++ Jeff Pinyan came up with:
++ :   perl -lne 'BEGIN { @A=<>, @ARGV="b.txt" } print shift(@A)+$_' a.txt
++ 
++ Which reduces to:
++     perl -lne'BEGIN{@A=<>,@ARGV="b.txt"}print shift(@A)+$_' a.txt
++ 
++ Abigail gave us:
++ ++  perl -ple 'BEGIN {open B, "b.txt" or die} $_ += <B>' a.txt
++ 
++ Which reduces to:
++     perl -ple'BEGIN{open B,"b.txt"or die}$_+=<B>' a.txt

Which can be reduced to:
       perl -ple'INIT{open B,"b.txt"}$_+=<B>' a.txt

++ 
++ Today I thought of this:
++ 
++     paste a.txt b.txt|sed -e 's/$/+p/'|dc

Way too long!

       paste [ab].txt|tr "^I" +|bc

with ^I een tab character.


Abigail


------------------------------

Date: Fri, 08 Dec 2000 11:26:51 GMT
From: Stew Dean <stewart@webslave.dircon.co.uk>
Subject: Re: Comparing two folders then writing difference to file.
Message-Id: <90qgho$8pi$1@nnrp1.deja.com>

In article <3a2f995c@nexus.comcen.com.au>,
  "Kiel Stirling" <taboo@comcen.com.au> wrote:
>
> Stew Dean <stewart@webslave.dircon.co.uk> wrote:
> >Hi,
> >
> >My perl is rusty so the more help I can get the better here. I'm
> >looking for a application or script to compare two folders and then
> >write these to a new folder. Idealy this should have a web front end
to
> >allow files to be over written.
> >
> >This is so that files altered localy can be zipped up and sent to the
> >live server so I'd be very suprised if someone somewhere hasnt
created
> >such a tool.
> >
> >If you could email if you help I'd be very thankful.
> >
> >Cheers
> >--
> >Stewart Dean
> >http://www.webslave.dircon.co.uk
> Will you pay $$
>
Nope. I've actually found a non perl solution now but am still
interested if people are using freely available packedge.

--
Stewart Dean
http://www.webslave.dircon.co.uk


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 8 Dec 2000 12:37:59 GMT
From: abigail@foad.org (Abigail)
Subject: Re: CSS files in a cgi script
Message-Id: <slrn931lh7.734.abigail@tsathoggua.rlyeh.net>

On Fri, 8 Dec 2000 01:12:22 -0000, Virgin News (c.darlington@virgin.net) wrote in comp.lang.perl.misc <URL: news:<EAWX5.2387$tR1.44412@news2-win.server.ntlworld.com>>:
++ Is it possible to link a .css file in a cgi script to format the html output
++ of the script?


And your questions has what to do with Perl?



Abigail


------------------------------

Date: Fri, 8 Dec 2000 07:32:46 -0500
From: "K6" <blnukem@hotmail.com>
Subject: file attachment
Message-Id: <90qkuq$jn$1@news.monmouth.com>

Hi All

Does anyone know how to attach a file "*.exe" to email?

What I'm trying to accomplish is to get a users name and email from a form
on my website and then automatically send them a file. If you have an
example of this type of function please post.

Thanx in advance K6




------------------------------

Date: Fri, 08 Dec 2000 12:57:31 GMT
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: file attachment
Message-Id: <2000Dec8.125731@ukwit01>

In article <90qkuq$jn$1@news.monmouth.com>, "K6" <blnukem@hotmail.com> writes:
|> 
|> What I'm trying to accomplish is to get a users name and email from a form
|> on my website and then automatically send them a file. If you have an
|> example of this type of function please post.

   Get the MIME::Lite module.  It contains examples.


------------------------------

Date: 8 Dec 2000 12:45:18 GMT
From: abigail@foad.org (Abigail)
Subject: Re: form-results on other page
Message-Id: <slrn931luu.734.abigail@tsathoggua.rlyeh.net>

On Fri, 8 Dec 2000 00:10:16 +0100, Harald ter Haar (harald@wanadoo.nl) wrote in comp.lang.perl.misc <URL: news:<3a3018f2$0$614@reader5>>:
++ Hello,
++ 
++ My form leads to a cgi-script wich is on an other web-domain. This is
++ because my host doesn't support cgi-scripts. Now, I want the printing result
++ of the form , (for example "Thank you for using my form, klick here to go
++ back") not on de cgi-page itself, but back at the place where the form is.
++ Note: I want this to avoid the commercial-popups wich appear by giving
++ commands in de cgi to print something as html-document. I hope I made myself
++ clear enough that you can help me.


It's quite clear that your question has nothing to do with Perl.



Abigail


------------------------------

Date: 8 Dec 2000 11:51:01 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Format
Message-Id: <slrn931ip5.734.abigail@tsathoggua.rlyeh.net>

On Thu, 07 Dec 2000 15:42:09 -0500, jeffrey schwab (jeffrey.schwab@Sun.COM) wrote in comp.lang.perl.misc <URL: news:<3A2FF621.63FB5D91@Sun.COM>>:
++ Abigail,
++ 
++ I like the way you think. :)
++ 


And I don't like the way you answer Jeopardy style.

*plonk*


Abigail


------------------------------

Date: Fri, 8 Dec 2000 08:45:29 -0500
From: "Darryl Olthoff" <olthoff@multiboard.com>
Subject: Re: FTP question
Message-Id: <90qolq$78r$1@panther.uwo.ca>

"Lucas" <wstsoi@hongkong.com> wrote in message
news:90ondo$9p52@imsp212.netvigator.com...
> I got a large log file that holding over 500,000 records, and each
> record per line:
>
> Log>>>>>>>>>>>
> 123456789 1997/8/24 13:24 ...
> 123456790 1997/8/24 13:50 ...
> ...
> ......
> .........
>
> 145678902 2000/11/23 2:30 ...
> End of the log >>>>>>>>>>>

If the records are a consistent length then the following should work for
you.

use strict;
use Net::FTP;

my ($FTP, $File, $Size, $RecordLength);
$RecordLength = 95;
$File = 'this.log');

$FTP = Net::FTP->new('host') || die("Unable to connect to host\n");
$FTP->login('username', 'password') || die("Unable to login to server\n");
$FTP->cwd('/pathtofile/') || die("Unable to change to path\n");
$Size = $FTP->size($File);
$Size = $Size - (400 * $RecordLength);
if ($Size < 0) { $Size = 0; };
$FTP->get($File, '/localpath/' . $File, $Size) || die("Unable to get the
last 400 records of the file\n");
$FTP->quit;

This will obviously only get the last 400 records of the log (You may have
to change the size formula or the recordlength to compensate for new line
characters.)
You will have to process the local file for yourself...

Darryl




------------------------------

Date: Fri, 08 Dec 2000 11:32:51 GMT
From: vivekvp <vivekvp@spliced.com>
Subject: Getting Form data
Message-Id: <90qgt3$8se$1@nnrp1.deja.com>



 Hello,

 I need to take data from a form (data see below) I have below and send
it to a perl script that would write it to a mysql database.

 I am not sure how to separate the data sent in the form - and send it
to each table.  Basically I just want the data in the form to send the
data to the database.  Each field is a table.

 So how do I separate them?  I think I can handle writing and retrieving
the data.  I mean I hope I can!  I want to use the Post method as that
seems safer.  Can I ensure the data is only numbers text plus an '@',
'.','-' symbols?



 Thanks!

 V

 Data:


http://www.xxx.com/database/test/?=555&=444&=4444&=222&=555&=5555&first_

name=test%40test.com&first_name=x&last_name=x&street_1=x&city=x&select_s
tate=Louisiana&state=x&zip=12345&country=United+States&flags1=1&birth_da

te_mon=12&birth_date_day=19&birth_date_year=1981&Sex=0&Marital=S&Continu
e=Sign+Me+Up%21

--
He who fights and runs away, lives to run another day!


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Fri, 08 Dec 2000 13:30:51 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Getting Form data
Message-Id: <slrn931om4.j7c.rgarciasuarez@rafael.kazibao.net>

vivekvp wrote in comp.lang.perl.misc:
> 
>  I need to take data from a form (data see below) I have below and send
> it to a perl script that would write it to a mysql database.
> 
>  I am not sure how to separate the data sent in the form - and send it
> to each table.  Basically I just want the data in the form to send the
> data to the database.  Each field is a table.
> 
>  So how do I separate them?  I think I can handle writing and retrieving
> the data.  I mean I hope I can!  I want to use the Post method as that
> seems safer.  Can I ensure the data is only numbers text plus an '@',
> '.','-' symbols?

Use the CGI.pm standard module and do not try to parse the data by
yourself.

perldoc -f CGI

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


------------------------------

Date: Fri, 8 Dec 2000 12:52:50 -0000
From: "Trevor Ward" <tward10@jaguar.com>
Subject: Re: Getting Form data
Message-Id: <90qlj2$jnm6@eccws12.dearborn.ford.com>

Sounds like an ideal use of the CGI module

vivekvp <vivekvp@spliced.com> wrote in message
news:90qgt3$8se$1@nnrp1.deja.com...
>
>
>  Hello,
>
>  I need to take data from a form (data see below) I have below and send
> it to a perl script that would write it to a mysql database.
>
>  I am not sure how to separate the data sent in the form - and send it
> to each table.  Basically I just want the data in the form to send the
> data to the database.  Each field is a table.
>
>  So how do I separate them?  I think I can handle writing and retrieving
> the data.  I mean I hope I can!  I want to use the Post method as that
> seems safer.  Can I ensure the data is only numbers text plus an '@',
> '.','-' symbols?
>
>
>
>  Thanks!
>
>  V
>
>  Data:
>
>
> http://www.xxx.com/database/test/?=555&=444&=4444&=222&=555&=5555&first_
>
> name=test%40test.com&first_name=x&last_name=x&street_1=x&city=x&select_s
> tate=Louisiana&state=x&zip=12345&country=United+States&flags1=1&birth_da
>
> te_mon=12&birth_date_day=19&birth_date_year=1981&Sex=0&Marital=S&Continu
> e=Sign+Me+Up%21
>
> --
> He who fights and runs away, lives to run another day!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




------------------------------

Date: 8 Dec 2000 11:15:32 GMT
From: suweiyi@supanet.com (Bill)
Subject: help on regexp
Message-Id: <90qfsk$t9q$1@fennel.nnrp.netline.net.uk>

Hi,

If I have strings like:

My ISP's URL:<http://www.myisp.com> 

or

My ISP's URL:(http://www.myisp.com)

or

My ISP's URL:"http://www.myisp.com"

How can I use Perl regexp to separate http://www.myisp.com from the above 
strings?

Thank you very much in advance.

Bill


------------------------------

Date: 8 Dec 2000 12:50:07 GMT
From: abigail@foad.org (Abigail)
Subject: Re: help on regexp
Message-Id: <slrn931m7v.734.abigail@tsathoggua.rlyeh.net>

On 8 Dec 2000 11:15:32 GMT, Bill (suweiyi@supanet.com) wrote in comp.lang.perl.misc <URL: news:<90qfsk$t9q$1@fennel.nnrp.netline.net.uk>>:
++ Hi,
++ 
++ If I have strings like:
++ 
++ My ISP's URL:<http://www.myisp.com> 
++ 
++ or
++ 
++ My ISP's URL:(http://www.myisp.com)
++ 
++ or
++ 
++ My ISP's URL:"http://www.myisp.com"
++ 
++ How can I use Perl regexp to separate http://www.myisp.com from the above 
++ strings?


    my ($answer) = $string =~ m((http://www\.myisp\.com));



Abigail


------------------------------

Date: Fri, 8 Dec 2000 12:50:52 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: help on regexp
Message-Id: <slrn931m9b.9v.bernard.el-hagin@gdndev25.lido-tech>

On 8 Dec 2000 11:15:32 GMT, Bill <suweiyi@supanet.com> wrote:
>Hi,
>
>If I have strings like:
>
>My ISP's URL:<http://www.myisp.com> 
>
>or
>
>My ISP's URL:(http://www.myisp.com)
>
>or
>
>My ISP's URL:"http://www.myisp.com"
>
>How can I use Perl regexp to separate http://www.myisp.com from the above 
>strings?

print $1 if $input_string =~ /(?:<|\(|")(.*?)(?:>|\)|")/;

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


------------------------------

Date: 8 Dec 2000 12:10:14 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Help with HttpSniffer
Message-Id: <slrn931jt6.734.abigail@tsathoggua.rlyeh.net>

On 07 Dec 2000 11:59:55 -0600, John Hunter (jdhunter@nitace.bsd.uchicago.edu) wrote in comp.lang.perl.misc <URL: news:<1rpuj4cdt0.fsf@video.bsd.uchicago.edu>>:
++ >>>>> "Abigail" == Abigail  <abigail@foad.org> writes:
++ 
++     Abigail> And your HttpSniffer problems have what to do with Perl?
++     Abigail> (And in case your answer is: HttpSniffer is written in
++     Abigail> Perl, the reply is: perl is written in C, hence you
++     Abigail> should ask in comp.lang.c)
++ 
++ HttpSniffer is written in perl.  My guess is that people who know how
++ to use this program more are likely to read this group than, for
++ example, c.l.c.  Thus, I asked here because I thought I might find
++ people who know the answer and are willing to help.  I take it you
++ are not one of those people?

Many operating systems are written in C; most, if not all, people
using Usenet use an operating system. Perl is written in C too.
By your logic, you should indeed have more chance in comp.lang.c.



Abigail


------------------------------

Date: Fri, 8 Dec 2000 11:04:50 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: How do I bring up the printer dialog via perl?
Message-Id: <Xns900472362quuxi@194.203.134.135>

A million monkeys weren't enough! It took Daniel Berger <djberg96@my-
deja.com> on 06 Dec 2000 to produce <90lkvd$a52$1@nnrp1.deja.com>:

>Hi all,
>
>I'm using perl on an NT machine, and I would like to know how to bring
>up the 'standard' printer dialog box that comes up whenever a program,
>such as Word, selects the "Print" option.
>
>Thanks in advance.
>
>Dan
>

You may need to use Win32::API 
(get it at http://www.perl.com/CPAN/authors/Aldo_Calpini/ )

use Win32::API;
Win32::API( 'comdlg32', 'GetOpenFileName', [P],N );
die "cannot load function: $!" unless defined $GetOpenFileName;

$GetOpenFileName->call(...)

See the ActiveState docs.
-- 
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com      http://www.sophos.com/
US Support +1 888 SOPHOS 9      UK Support +44 1235 559933
 ... you'll be the first against the -pedantic -Wall -W


------------------------------

Date: Fri, 08 Dec 2000 11:30:05 -0000
From: <vidulats@yahoo.co.uk>
Subject: How to get the filename???
Message-Id: <t31hhtlbnm1n62@corp.supernews.com>

Hello,

Is there any way by which I can get the file name of the currently 
executing process. (I don’t want to use $0)

I have the process ID with me. 
How can I get the file name by using this process ID?

Will anyone help me on this topic.

Thanks in advance,

Regards,
Vidula

--
Posted via CNET Help.com
http://www.help.com/


------------------------------

Date: Fri, 08 Dec 2000 07:01:57 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: How to get the filename???
Message-Id: <3A30E9D5.6FAE30C6@indra.com>

vidulats@yahoo.co.uk wrote:
> 
> Hello,
> 
> Is there any way by which I can get the file name of the currently
> executing process. (I don?t want to use $0)
> 
> I have the process ID with me.
> How can I get the file name by using this process ID?
> 
> Will anyone help me on this topic.
> 
> Thanks in advance,
> 
> Regards,
> Vidula
> 
> --
> Posted via CNET Help.com
> http://www.help.com/
Use the Proc::ProcessTable module.
-- 

Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


------------------------------

Date: Fri, 08 Dec 2000 11:22:00 GMT
From: steven <steven@ircnet.dk>
Subject: Re: IPC::ShareLite; No space left on device errors
Message-Id: <90qg8m$8fs$1@nnrp1.deja.com>

In article <90o8go$emh$1@nnrp1.deja.com>,
  steven <steven@ircnet.dk> wrote:
> Hi,
>
> Environment: Solaris 7, Apache 1.3.12, Perl 5.6.0, mod_perl 1.24.
>
> I have an authentication handler that's caching usernames and
passwords
> in shared memory using IPC::ShareLite 0.08 and Storable 0.73. Under
some
> light load I'm getting a lot of "No space left on device" errors,
> although the shared segment isn't full (using the default of 64k).
After
> a little while (seemingly randomly) the errors aren't occuring, and
all
> is well, albeit for a very short while. Once I've had the segment
> "disappear". I'm wondering:

Not any more, problem solved.

--
steven


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Fri, 08 Dec 2000 13:12:16 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: MIME::Lite message bounced by receiver server
Message-Id: <Q65Y5.120$uF3.10389@eagle.america.net>

On Fri, 08 Dec 2000 10:18:22 GMT, Olivier Dupouy <olivier@aersoft.com> wrote:
>Peter Sundstrom wrote:
>
>> Olivier Dupouy <olivier@aersoft.com> wrote in message
>> news:3A2FC881.BD66C595@aersoft.com...
>> > I am using MIME::Lite to send messages. That wotks pretty well exept
>> > when I send it to special email addresses where the server is checking
>> > the sender id.
>> > In the mail I am sending, Lite fill the field Return-path by
>> > myusername@mymachine :   Return-path: olivier@mars  --> mars is my
>> > machine
>> > It should fill it by olivier@aersoft.ie, what can I do to do this??
>
>If I send the message to my hotmail account, here is what hotmail receive:
>
>From olivier@mars Fri Dec 08 01:58:42 2000
>Received: from [194.125.107.131] by hotmail.com (3.2) with ESMTP id
>MHotMailBBF9FB7400424004310BC27D6B8385840; Fri Dec 08 01:57:09 2000
>
>The probleme seems to be in the first line of the code: olivier@mars instead
>of olivier.dupouy@aersoft.ie
>
>Thinks to anybody who have a clue to the mysterious problem

This is off-topic.  

This is your sendmail configuration.  It has nothing to do with Perl
or MIME::Lite.  See the cf/README file in the sendmail distribution.
You might want to look at FEATURE(`masquerade_envelope') or ask in a
group about sendmail.  

-- 
Garry Williams


------------------------------

Date: Fri, 08 Dec 2000 11:24:02 GMT
From: qades <qades@my-deja.com>
Subject: Multiple line regular expressions
Message-Id: <90qgcf$8nb$1@nnrp1.deja.com>

I have to delete <script></script> tags from a bunch of html-files. What
I tried is read the file into a variable and do a

	s/<script.*<\/script>//ig;

you can imaging that this didn't work for multiple line scripts. I
thought [.\n]* would work but now i know better :) So anybody knows
the/one right syntax?

gtx
	Michael


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Fri, 8 Dec 2000 12:54:24 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Multiple line regular expressions
Message-Id: <slrn931mft.9v.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 08 Dec 2000 11:24:02 GMT, qades <qades@my-deja.com> wrote:
>I have to delete <script></script> tags from a bunch of html-files. What
>I tried is read the file into a variable and do a
>
>	s/<script.*<\/script>//ig;
>
>you can imaging that this didn't work for multiple line scripts. I
>thought [.\n]* would work but now i know better :) So anybody knows
>the/one right syntax?

perl -i.bak -ne 'print unless /<script>/i .. /<\/script>/i' <input_file>

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


------------------------------

Date: Fri, 08 Dec 2000 04:14:03 -0800
From: Linc Madison <lincmad001@telecom-digest.zzn.com>
Subject: Re: my foreach loop stops halfway through the array
Message-Id: <081220000414030719%lincmad001@telecom-digest.zzn.com>

In article <3a2ffc4e$0$164$3936f1fe@news-core.twtelecom.net>, David
Riskind <driskind@freemarkets.com> wrote:

> While trying to learn how to effectively use perl, I came across what
> I consider an oddment of either shift, foreach, or maybe windows2K
> environment for perl.
> I created an array to test/understand the map function, then I tried
> to print all elements of the array that was mapped using a foreach loop.

Your syntax is incorrect. You have a couple of errors, one
typographical and the other much deeper.

> my @words = map { split ' ' } @lines ;
> 
> # this snippet only gets halfway through the array then
> # bails out of the foreach loop
> my $c = 0 ;
> foreach ( @words )

You lost an open brace here. Also, your code will be clearer if you
follow common indenting practice.

> $c++ ;
> print "$words[0]\t\t-[$c]-\n";
> shift @words ;
> }

Deleting elements of the array (or hash) while you're in the middle of
a foreach loop on it, is a very bad idea.

Suppose your array had 100 elements in it. You print the 50th one. The
foreach loop knows that it is in its 50th iteration. You've also
eliminated 50 elements of the array, leaving 50 remaining. The foreach
loop completes its 50th iteration on an array that now has 50 elements,
so it calculates that it has finished its job.

To compare to your other code:

> #my $b = @words ;
> #for ( $c = 0; $c <=$b ; $c++ ) {    # again missing the opening brace
> 
> # print "\$word[$c]\t = $words[$c]\n";
> # }

your foreach loop is somewhat analogous to doing this:

   for ($c = 0; $c < scalar @words; $c++) {
      print "$words[0]\t\t-[$c]-\n";
      my $junk = shift @words;
   }

(I don't guarantee that the analogy holds in all respects, much less
that it bears any relation to how the code actually executes, but it
does illuminate why the loop would terminate at the halfway point.)

You can modify individual elements of an array inside a foreach loop --
for instance, replace each word with its rot-13 self -- but adding or
deleting elements can cause problems.


------------------------------

Date: Fri, 08 Dec 2000 11:30:05 -0000
From: <vidulats@yahoo.co.uk>
Subject: Process_ID stuff???
Message-Id: <t31hht6htol361@corp.supernews.com>

Hello,

I have one pm file “ABC.pm”, where I wrote some function.
# Say the function name is Send ()
# In which I'm printing the name of the file that calls this Send () 
function

I have another file “XYZ.pl”, whose structure is like this:

    # Some Code
    Send ()

    #Some Code
    do “TT.pl”

The Structure of the TT.pl is:

    #Some Code
    Send ()

I want my output to be:
XYZ.pl
TT.pl

In Send () I gave $0 but for both the cases he prints XYZ.pl

Will anyone guide me.

Thanks in advance,

Regards,
Vidula


--
Posted via CNET Help.com
http://www.help.com/


------------------------------

Date: Fri, 8 Dec 2000 14:44:56 +0100
From: "Miriam H" <hoehnm@bluewin.ch>
Subject: Reading an MS Access Table from perl
Message-Id: <90qokd$q94$1@mail.pl.unisys.com>

Hello Newsgroup,

Is it possible to read an MS Access Table
from perl ?
If yes: Where can I find a description / examples
of how to do it?
Thanks!

Miriam




------------------------------

Date: Fri, 8 Dec 2000 09:00:23 -0500
From: "Timothy Frye" <thf@cisunix.unh.edu>
Subject: Re: Reading an MS Access Table from perl
Message-Id: <90qpmv$fsk$1@tabloid.unh.edu>

Definately!  I'm working on something like that right now.   Look at the DBI
module or the Win32::ODBC module and there are some good websites out there
offering this type of info.  Try this site for some really basic stuff:
http://wdvl.com/
Also look at the book: "Programming the Perl DBI" by Alligator Descartes and
Tim Bunce.  A must have book if you are going to do anything intensive with
databases.  It's from O'Reily Press.

-Tim

"Miriam H" <hoehnm@bluewin.ch> wrote in message
news:90qokd$q94$1@mail.pl.unisys.com...
> Hello Newsgroup,
>
> Is it possible to read an MS Access Table
> from perl ?
> If yes: Where can I find a description / examples
> of how to do it?
> Thanks!
>
> Miriam
>
>




------------------------------

Date: Wed, 06 Dec 2000 08:09:38 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Ugh! I hope I can explain this...
Message-Id: <3A2E48A2.95C56149@home.com>

cputek1@my-deja.com wrote:
> 
> I'm calling a subroutine in a perl script from other perscripts
> (using "required"). How do I tell which script called the subroutine
> from within the subroutine?

With the caller() function.

-mjc


------------------------------

Date: Fri, 08 Dec 2000 12:29:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <l0l13t860tan0as3fahn8us7hb0ivi07bv@4ax.com>

Ray Pendergraph wrote:

>I was parsing and this is
>what PERL does best. That is what it was designed for. But don't
>underestimate its speed because it's a scripting language.

Perl is pretty darn fast, because Perl gets compiled (into "bytecode")
when the script starts up. The script itself runs at high speed.

-- 
	Bart.


------------------------------

Date: Wed, 06 Dec 2000 08:18:31 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Willing to review a 90 line Perl program?
Message-Id: <3A2E4AB7.886CC0DA@home.com>

Philip Garrett wrote:
> 
> From: Ted <ted_graham@my-deja.com>
> 
> > while( $line = <IN> )
> 
> This will work as long as you don't run across an empty line.  
> You may want something more like this:
> 
> while( defined($line = <IN>) ) {

FUD. Perl will put a defined() there for you if you didn't do it
yourself. Either way is fine; explicitly adding the defined() just makes
things clearer for Perl novices.

-mjc


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 5062
**************************************


home help back first fref pref prev next nref lref last post