[17403] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4823 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 6 14:05:33 2000

Date: Mon, 6 Nov 2000 11:05:14 -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: <973537513-v9-i4823@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 6 Nov 2000     Volume: 9 Number: 4823

Today's topics:
    Re: Converting ?!& etc. characters into unicode entitie <paul.groves@oucs.ox.ac.uk>
        CORBA::ORBit Client - Iona Orbix Server <heiko.redeker.sp@lhsystems.com>
    Re: Detecting socket closure <fulko@wecan.com>
    Re: Emailing formatted <james@NOSPAM.demon.co.uk>
    Re: Getting the Day of a Date <sb@muccpu1.muc.sdm.de>
    Re: Help - read from CSV (Clay Irving)
    Re: Help - read from CSV <james@NOSPAM.demon.co.uk>
    Re: Help - read from CSV <jeff@vpservices.com>
    Re: Help - read from CSV <ren.maddox@tivoli.com>
    Re: Help - read from CSV <jeff@yoak.com>
    Re: Help - read from CSV <ren.maddox@tivoli.com>
    Re: how to sort corresponding arrays? (Mark-Jason Dominus)
    Re: Is there a better way to get "the element before $x <tim@ipac.caltech.edu>
    Re: large file size (Clay Irving)
    Re: large file size <crowj@aol.com>
    Re: large file size <ren.maddox@tivoli.com>
    Re: large file size sridhasr@my-deja.com
    Re: Looking for idiom for getting value from @ARGV, or  (Abigail)
    Re: Looking for idiom for getting value from @ARGV, or  <nospam.newton@gmx.li>
    Re: Need suggestions on optimization <ren.maddox@tivoli.com>
    Re: network security (Richard J. Rauenzahn)
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Newbie question: Get date of 3rd Friday in a given  (Gary E. Ansok)
        Novice silly question: Delete a file <trioinfoQUITAESTO@trioinfografia.com>
    Re: Novice silly question: Delete a file <jeff@vpservices.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 6 Nov 2000 16:14:02 -0000
From: "Paul  Groves" <paul.groves@oucs.ox.ac.uk>
Subject: Re: Converting ?!& etc. characters into unicode entities?
Message-Id: <8u6lbk$dan$1@news.ox.ac.uk>


"問題" <answer@hotmail.com> wrote in message
news:8u6h57$49c4@rain.i-cable.com...
> http://easyto.heha.net/
> 本站提供Perl教學 自學資源,Perl 論壇 ,特別適合有意學Perl 的朋友.

I don't understand - is this in Chinese??

Paul

> Paul Groves <paul.groves@oucs.ox.ac.uk> wrote in message
> news:8u6eni$8b1$1@news.ox.ac.uk...
> > Does anyone know if there is an easy way (e.g. a function of some sort)
to
> > convert characters like "!", "?" "&" etc. into their respective
> > (unicode) entity values when these values occur in strings containing
> > paragraphs of text (they cause processing errors in my code otherwise,
> > don't ask...). i.e. is there something I can just use to convert the
> > whole string?
> >
> > cheers
> >
> > Paul
> >
> >
>
>




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

Date: Mon, 06 Nov 2000 16:48:05 +0100
From: hr <heiko.redeker.sp@lhsystems.com>
Subject: CORBA::ORBit Client - Iona Orbix Server
Message-Id: <3A06D2B5.2F747CB9@lhsystems.com>

I have a strange problem with a CORBA::ORBit Client
talking to a Iona Orbix Server:

--------------------------------------------------------------
used versions:

This is perl, version 5.005_03 built for sun4-solaris
CORBA-ORBit-0.4.3
ORBit-0.5.4
Exception-0.97_01B
Error-0.13
Iona Orbix C++ 3.0.2
Solaris 2.7
-------------------------------------------------------------------
The IDL:

interface IClientSession
{
   string getSomething();
}

interface ISessionManager
{
    IClientSession login(in string userid, in string pwd, 
			  in string custumer_name, out long sessID)
	raises ( XYException );

    string getVersion()        //returns actual versoin nb of the server
	raises ( XYException );
};

------------------------------------------------------------
The client:

#!/usr/bin/perl -w

use CORBA::ORBit idl => [ qw(myIDL.idl) ];

use Error qw(:try);

use strict;

my $orb = CORBA::ORB_init("orbit-local-orb");

open IOR, "ior.ref";
my $ior = <IOR>;
close IOR;

my $account = $orb->string_to_object($ior);



my $st = $account->getVersion();
print $st . "\n";

my $num = 0;
my $ret_cl;

try {
    ( $ret_cl, $num ) = $account->login( "", "", "" );
} catch CORBA::Exception with {
    my $e = shift;
    print STDERR "    Exception: $e\n";
};

$st = $ret_cl->getSomething();

------------------------------------------------------------
the output of the client:

perl> perl cli
v0999                            (this is correct)

ORBit-WARNING **: IOP_TAG_MULTIPLE_COMPONENTS decoding needs finishing

ORBit-WARNING **: ORBit_free_profile asked to free type 1
Can't call method "getSomething" on an undefined value at cli line 51.
perl> 
------------------------------------------------------------------

As you can see, the first interface-call (getVersion) succeded
and the second one (login) ends with warnings, leaving the
resulting reference untouched.

What do these warnings mean and where can i find some more doc
for this perl-module. (yes i read the docu which comes with this
package)

Heiko


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

Date: Mon, 06 Nov 2000 11:09:19 -0500
From: Fulko Hew <fulko@wecan.com>
Subject: Re: Detecting socket closure
Message-Id: <3A06D7AF.41C6@wecan.com>

> Just curious but with your signal handler installed, what 
>  do you now see with: 
>   
>    defined( send(...) ) || die "send $host: $!"; 
>   
>  Also, what does your handler look like?


send now unblocks and returns undef.

the handler:

use POSIX qw(:sys_wait_h);
sub closer {
    waitpid(-1, &WNOHANG);
    $SIG{PIPE} = \&closer;     # this enables send() to be interrupted
}                              # when the socket is closed

-----------------------------------------------------------------------
Fulko Hew,                           Voice:  905-333-6000  x 6010
Senior Engineering Designer,         Direct: 905-333-6010
Northrop Grumman-Canada, Ltd.        Fax:    905-333-6050
777 Walkers Line,                    Home:   fulko%fkhew@wecan.com
Burlington, Ontario, Canada, L7N 2G1 Work:   fulko@wecan.com


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

Date: Mon, 6 Nov 2000 17:12:30 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Emailing formatted
Message-Id: <ant06173006cfNdQ@oakseed.demon.co.uk>

In article <mUyN5.80123$hk2.158083@news6-win.server.ntlworld.com>, abaltd
<URL:mailto:abaltd@ntlworld.com> wrote:
> 
> I know I can get sendmail to interpret To: and CC: lines ok (using -t
> option) But how can I get it to process
> Content-type: multipart/alternative
> lines,> so that I can send formatted emails?

You don't need sendmail to understand the formatting of a MIME message
body, whether multipart or otherwise. As long as sendmail can read what
it needs from the standard headers, it does not need to concern itself
with the body of the message. You seem to already have it reading To:
and CC: lines (and I assume From:) so it should work.

If you are still having problems, then perhaps there is something else.
Are you using senmail's -oi option? Have you constructed the MIME message
correctly using the MIME::Tools perhaps? What are the symptoms of it
not working?

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: 6 Nov 2000 18:50:12 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Getting the Day of a Date
Message-Id: <8u6uh4$173$1@solti3.sdm.de>

In article <slrn90dh4o.ljt.clay@panix3.panix.com>, Clay Irving <clay@panix.com> wrote:

>>Can anyone tell me how to take a date (eg, 6 Nov 2000) and get the day
>>(eg, Monday)?

>   #!/usr/local/bin/perl -w
>   
>   use Date::Calc qw/Day_of_Week/; 

<Unnecessary>

>   my %day = (
>       '0' => 'Sunday',
>       '1' => 'Monday',
>       '2' => 'Tuesday',
>       '3' => 'Wednesday',
>       '4' => 'Thursday',
>       '5' => 'Friday',
>       '6' => 'Saturday'
>       );

</Unnecessary>

>   $date = "11/06/2000";
>   ($month, $day, $year) = split /\//, $date;
>   
>   $dow = Day_of_Week($year,$month,$day);
>   
>   print "$date is a $day{$dow}.\n";

Without additional hash:

    print "$date is a ", Day_of_Week_to_Text($dow), ".\n";

> Result:

>   11/06/2000 is a Monday.

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: 6 Nov 2000 16:40:24 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Help - read from CSV
Message-Id: <slrn90dnno.ctq.clay@panix3.panix.com>

On Mon, 06 Nov 2000 14:57:30 +0000 (GMT), Simon E. John 
<simon@suit-u-sir.com> wrote:

>I'm trying to write a poll in Perl, I've got most of it done, but would like
>to read in the results from a flat file e.g. CSV or pipe-delimited.
>
>The format would only consist of two fields with each record separated by a
>newline, e.g.
>
>Bush|1
>Gore|2
>Homer Simpson|100
>
>I'd like to be able to setup a loop so that the file is read into an array
>until EOF and the number of records counted and put into a variable,
>processed and then written back to the file.
>
>This way I could change the survey simply by changing the CSV file.
>
>Someone said use the DBD::CSV or Text::CSV modules, but I'd prefer not to -
>someone else mentionned grep....

Is there a question buried in here?

-- 
Clay Irving <clay@panix.com>
Rough work, iconoclasm, but the only way to get at truth. 
- Oliver Wendell Holmes 


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

Date: Mon, 6 Nov 2000 17:53:06 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Help - read from CSV
Message-Id: <ant06170672bfNdQ@oakseed.demon.co.uk>

In article <4a193f1725simon@suit-u-sir.com>, Simon E. John
<URL:mailto:simon@suit-u-sir.com> wrote:
> I'm trying to write a poll in Perl, I've got most of it done,
> but would like to read in the results from a flat file
> 
> The format would only consist of two fields with each record
> separated by a newline, e.g.
> 
> Bush|1
> Gore|2
> Homer Simpson|100
> 
> I'd like to be able to setup a loop so that the file is read into
> an array until EOF and the number of records counted and put into
> a variable, processed and then written back to the file.

It's not clear what your specific question is, but I'll assume that
your problem is not knowing what data structure to use, and that
you know how to open files for reading and writing, etc.

Assuming the first column of your data does not contain any
duplicates, and that you do not need to access number of votes by
candidate name, then I think I would use a simple array of arrays,
and read it in like this:

my @data;
while (my $line = <FILE>) {
    chomp $line;
    push @data, [ split '|', $line ];
}

 ...and write it out like this:

foreach my $row (@data) {
    print FILE join('|', @$row), "\n";
}

Of course, if you need to access the votes by candidate or need
to accumulate votes from duplicate candidate lines, and you don't
care about ordering, then a hash would be a better data structure.
Read in like this:

my %data;
while (my $line = <FILE>) {
    chomp $line;
    my ($candidate, $votes) = split '|', $line;
    if (defined $data{$candidate}) {
        $data{$candidate} += $votes;
    } else {
        $data{$candidate} = $votes;
    }
}

 ...and write it out like this:

foreach my $candidate (keys %data) {
    print FILE join('|', $candidate, $data{$candidate}), "\n";
}

Note that I am a beginner myself, and I have rashly typed the
above without testing it at all. So please take this advice
with a suitably large pinch of salt. :-)

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Mon, 06 Nov 2000 10:08:12 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help - read from CSV
Message-Id: <3A06F38C.35EC4DE2@vpservices.com>

James Taylor wrote:
>
>     push @data, [ split '|', $line ];

Bzzzzt. Wrong. That will turn 'foo|bar|baz' into an 11-element array of
characters rather than a 3-element array of words.

> Note that I am a beginner myself, and I have rashly typed the
> above without testing it at all.

PLEASE DO NOT DO THAT!

Whom do you imagine is helped by having untested code and guesses sent
to the newsgroup? 

-- 
Jeff


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

Date: 06 Nov 2000 10:24:35 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Help - read from CSV
Message-Id: <m3r94pukzg.fsf@dhcp11-177.support.tivoli.com>

Simon E. John <simon@suit-u-sir.com> writes:

> I'm trying to write a poll in Perl, I've got most of it done, but would like
> to read in the results from a flat file e.g. CSV or pipe-delimited.
> 
> The format would only consist of two fields with each record separated by a
> newline, e.g.
> 
> Bush|1
> Gore|2
> Homer Simpson|100

It sounds like you are probably willing to guarantee that the
separator ("|" or ",") will *never* appear in the data (even inside
quotes).  Is that true?  If so, then you can simply parse it with:

chomp, push @records, [ split /\|/ ] for <FILE>;

> I'd like to be able to setup a loop so that the file is read into an array
> until EOF and the number of records counted and put into a variable,
> processed and then written back to the file.

I'm not quite clear on exactly how you want to change the file, so
I'll hope that the above can get you going.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Mon, 06 Nov 2000 09:42:46 +0800
From: "Jeff Yoak" <jeff@yoak.com>
Subject: Re: Help - read from CSV
Message-Id: <8u6qkr01all@news1.newsguy.com>

[posted and emailed]

In article <4a193f1725simon@suit-u-sir.com>, simon@suit-u-sir.com wrote:

> Someone said use the DBD::CSV or Text::CSV modules, but I'd prefer not
> to - someone else mentionned grep....

Curiously, why?

Check out the documentation for split() in perlfunc for another approach.

Cheers,
Jeff


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

Date: 06 Nov 2000 12:00:10 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Help - read from CSV
Message-Id: <m3bsvtugk5.fsf@dhcp11-177.support.tivoli.com>

James Taylor <james@NOSPAM.demon.co.uk> writes:

>     push @data, [ split '|', $line ];
 ...
>     my ($candidate, $votes) = split '|', $line;

Watch out there... split takes a regex as its first argument, and | is
special there.  You need to escape it....

-- 
Ren Maddox
ren@tivoli.com


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

Date: Mon, 06 Nov 2000 17:01:58 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: how to sort corresponding arrays?
Message-Id: <3a06e406.2114$b7@news.op.net>
Keywords: Atlanta, Klein, armadillo, presumptuous

In article <v9qN5.193$Bf7.170932224@news.frii.net>,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>In article <3a04a234.5467$135@news.op.net>,
>Mark-Jason Dominus <mjd@plover.com> wrote:
>>
>>See
>>
>>        http://perl.plover.com/yak/hw2/slide003.html
>>
>
>404

You have the wrong IP address for perl.plover.com.  Try

      http://209.152.214.112/yak/hw2/slide003.html

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Mon, 06 Nov 2000 11:47:20 -0800
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Is there a better way to get "the element before $x" in an array?
Message-Id: <3A070AC8.C1D3DF6D@ipac.caltech.edu>

Gwyn Judd wrote:
> 
> I was shocked! How could LimboStar <dontspamme@awdang.com>
> say such a terrible thing:
> >In article <39F9EA65.6FDFA238@ipac.caltech.edu>,
> >  tim@ipac.caltech.edu wrote:
> >> my $prev_letter = $letters[
> >>        (grep $cur_letter eq $letters[$_], 0..$#letters)[0]
> >>                            - 1];
> >
> >I just wanted to say thanks for this - I didn't ask the original
> >question but it's damn near exactly what I was looking for.
> >
> >One question about this though - it creates a temporary array of size
> >$#letters, right?  For large arrays, this will eat memory.  Is there a
> >sleeker way of doing it, or is this the best in terms of a speed /
> >memory tradeoff?

How many letters can there be? :-)

Yes, for bigger arrays Gwynn's solution is safer.

> 
> Not quite. It creates an array with size equal to the number of letters
> found. Also the given solution accesses past the end of the array.

Picky mode: How does it do that? The resultant index to @letters has to be
between -1 and $#letters. $letters[-1] == $letters[$#letters]. No? OK, so maybe
it's an unexpected cyclical definition of "before", but still ... :-)

% perl -wle '@l="a".."z"; print $l[(grep "a" eq $l[$_], 0..$#l)[0] - 1]'
z
% perl -wle '@l="a".."z"; print $l[(grep "xxx" eq $l[$_], 0..$#l)[0] - 1]'
Use of uninitialized value in subtraction (-) at -e line 1.
z


--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: 6 Nov 2000 16:41:29 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: large file size
Message-Id: <slrn90dnpp.ctq.clay@panix3.panix.com>

On Mon, 06 Nov 2000 16:59:26 +0100, Josef Moellers 
o<josef.moellers@fujitsu-siemens.com> wrote:

>Dave's box wrote:
>> 
>> I have a 4 gb file that I can't open with   "open(LOG, "$log") || die
>> "Unable to open $log\n";
>> Does perl have a file size limitation?   When I split the file in 2 it
>> will work .  Thanks
>
>Perl may not, but the underlying OS may ...

Makes you wonder how the file got on the machine serviced by the OS?

-- 
Clay Irving <clay@panix.com>
To live outside the law you must be honest. 
- Bob Dylan 


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

Date: Mon, 06 Nov 2000 12:07:54 -0500
From: John Crowley <crowj@aol.com>
Subject: Re: large file size
Message-Id: <3A06E56A.61123EA2@aol.com>

Dave's box wrote:
> 
> I have a 4 gb file that I can't open with   "open(LOG, "$log") || die
> "Unable to open $log\n";
> Does perl have a file size limitation?   When I split the file in 2 it
> will work .  Thanks

You need to recompile Perl using the compiler-specific
large file size option(s).


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

Date: 06 Nov 2000 10:26:25 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: large file size
Message-Id: <m3n1fdukwe.fsf@dhcp11-177.support.tivoli.com>

Dave's box <dshaklee@dtic.mil> writes:

> I have a 4 gb file that I can't open with   "open(LOG, "$log") || die
> "Unable to open $log\n";

Including $! in the error message will probably give you a clue as to
the problem.

> Does perl have a file size limitation?   When I split the file in 2 it
> will work .  Thanks

It may be an OS limitation...

-- 
Ren Maddox
ren@tivoli.com


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

Date: Mon, 06 Nov 2000 18:21:50 GMT
From: sridhasr@my-deja.com
Subject: Re: large file size
Message-Id: <8u6srm$kru$1@nnrp1.deja.com>



If your OS utilities like cat, grep etc can read this file you can do
something like this

open (HANDLE, "cat '$file'|");

This will work only if cat works for > 2G files

-Srikanth



In article <3A06E56A.61123EA2@aol.com>,
  crowj@aol.com wrote:
> Dave's box wrote:
> >
> > I have a 4 gb file that I can't open with   "open(LOG, "$log") ||
die
> > "Unable to open $log\n";
> > Does perl have a file size limitation?   When I split the file in 2
it
> > will work .  Thanks
>
> You need to recompile Perl using the compiler-specific
> large file size option(s).
>


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


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

Date: 6 Nov 2000 16:15:19 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <slrn90dm8n.kg6.abigail@tsathoggua.rlyeh.net>

On 6 Nov 2000 15:53:33 -0000, Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote in comp.lang.perl.misc <URL: news:<8u6k5t$tg5$1@lublin.zrz.tu-berlin.de>>:
++ Abigail <abigail@foad.org> wrote in comp.lang.perl.misc:
++ >On Mon, 06 Nov 2000 05:49:33 GMT, Uri Guttman (uri@sysarch.com) wrote in comp.lang.perl.misc <URL: news:<x7g0l5hcpe.fsf@home.sysarch.com>>:
++ >++ >>>>> "MV" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:
++ >++ 
++ >++ 
++ >++   MV> If you really need to test for defined-ness, then you need to use two
++ >++   MV> statements:
++ >++ 
++ >++   MV> $s = shift @ARGV;
++ >++   MV> $s = 'default' unless defined $s;
++ >++ 
++ >++ $s = defined( $ARGV[0] ) ? shift : 'default' ;
++ >
++ >
++ >That is not quite the same. For instance, if @ARGV && !defined $ARGV [0].
++ 
++ True, but that cannot happen if @ARGV is fresh from one of the shells.
++ So in the standard situation @ARGV != 0 implies that $ARGV[ 0] is defined.


But then the test for definess isn't necessary, is it?



Abigail


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

Date: Mon, 06 Nov 2000 18:38:12 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <l1rd0tko882acd67gl5ogopmiiejbmp7m7@4ax.com>

On Mon, 06 Nov 2000 15:24:59 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:

> @ARGV is a special case, an array for which it's garanteed that no
> existing item can be undefined. If an element exists, it is defined.

Where do you read that from?

    @ARGV = (undef, undef);

works fine; Perl doesn't magically throw away the undef's or turn them
into "" or something like that.

Granted, you may not be able to get undef in there through the startup
code, but there's nothing magical about @ARGV in that respect.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate


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

Date: 06 Nov 2000 09:37:16 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Need suggestions on optimization
Message-Id: <m31ywpw1qr.fsf@dhcp11-177.support.tivoli.com>

David Coppit <newspost@coppit.org> writes:

> > Right here I start to get the feeling that you could define $/ as
> > "\nFrom " and process a message at a time.  The possibility of
> > included messages would still need to be handled (assuming that they
> > also start with "From "), but that shouldn't be a problem.  I expect
> > you would get an appreciable performance improvement from this change
> > alone.
> 
> Yeah, that dawned on me after I posted. I tried that, and got no
> appreciable improvement. :(

Mainly out of curiosity, what does the profiling show is taking the
bulk of the time when you change to using $/ instead of the regex?  Is
it the readline?

-- 
Ren Maddox
ren@tivoli.com


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

Date: 6 Nov 2000 18:41:48 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: network security
Message-Id: <973536106.136901@hpvablab.cup.hp.com>

James Taylor <james@NOSPAM.demon.co.uk> writes:
>If you try to pretend to have knowledge of their specialism they will
>undoubtedly question you on it, discover your limitations, and having
>established that you are trying to pretend to be something you're not,
>may also assume you're not anything else you claim to be.
[...]
>Of course, for me to preach that honesty is the best policy, may
>simply show my naivete. You should do what you think is right.

As someone who has been interviewing candidates a lot recently...

Bluffing is bad, 'cause you'll often get caught.  What IS good, though,
is studying up because it shows an interest in the area, allows you to
ask good questions, and helps you know what you don't know.

Depending on their experience expectations, you could even admit to the
prior research during the interview.

But anyway..  this isn't misc.how-to-interview..  Just don't bluff -- it
makes the final selection too easy!  =-)

Rich

-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Mon, 06 Nov 2000 17:36:36 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <t0dr142kv4c847@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 30 Oct 2000 17:35:35 GMT and ending at
06 Nov 2000 14:47:52 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) 2000 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  174 (40.5% of all posters)
Articles: 267 (19.2% of all articles)
Volume generated: 417.5 kb (16.7% of total volume)
    - headers:    199.7 kb (4,140 lines)
    - bodies:     214.5 kb (7,541 lines)
    - original:   144.4 kb (5,258 lines)
    - signatures: 3.1 kb (78 lines)

Original Content Rating: 0.673

Averages
========

Posts per poster: 1.5
    median: 1.0 post
    mode:   1 post - 125 posters
    s:      5.6 posts
Message size: 1601.3 bytes
    - header:     765.8 bytes (15.5 lines)
    - body:       822.7 bytes (28.2 lines)
    - original:   553.9 bytes (19.7 lines)
    - signature:  11.8 bytes (0.3 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   11    24.8 (  8.0/ 16.8/  6.0)  Ameen Dausha <ameen@dausha.net>
    9    15.2 (  6.5/  8.7/  6.0)  "mark" <markscott@barclays.net>
    7     8.9 (  3.8/  5.1/  5.0)  Anthony <apsaffer@hotmail.com>
    4     6.7 (  3.0/  3.7/  2.7)  zabor@my-deja.com
    4     5.0 (  2.6/  2.4/  1.5)  "Michael Guenther" <MiGuenther@lucent.com>
    4     5.8 (  3.4/  2.4/  1.7)  jesus X <jesusx@who.net>
    4    11.4 (  3.6/  7.9/  1.4)  Aaron Dancygier <adancygier@nyc.rr.com>
    4     9.7 (  3.3/  6.4/  1.9)  "Aidan" <Aidan.Finn@ucd.ie>
    4     4.1 (  3.2/  0.8/  0.7)  "James Boulter" <jbou@bunker79.fsnet.co.uk>
    3     4.9 (  2.6/  2.4/  1.1)  Willis Kwok <wkwok@uunet.com.au>

These posters accounted for 3.9% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  24.8 (  8.0/ 16.8/  6.0)     11  Ameen Dausha <ameen@dausha.net>
  15.2 (  6.5/  8.7/  6.0)      9  "mark" <markscott@barclays.net>
  11.4 (  3.6/  7.9/  1.4)      4  Aaron Dancygier <adancygier@nyc.rr.com>
   9.7 (  3.3/  6.4/  1.9)      4  "Aidan" <Aidan.Finn@ucd.ie>
   9.6 (  1.6/  7.8/  3.3)      2  Nick Pasich <npasich@sd.cts.com>
   9.1 (  1.5/  7.6/  1.5)      2  craber@my-deja.com
   8.9 (  3.8/  5.1/  5.0)      7  Anthony <apsaffer@hotmail.com>
   7.6 (  2.6/  5.0/  2.1)      3  "Maarten" <maartenh@usa.net>
   6.7 (  3.0/  3.7/  2.7)      4  zabor@my-deja.com
   6.2 (  3.0/  3.3/  1.3)      3  John Golubenko <java@dashmail.net>

These posters accounted for 4.4% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

1.000  (  3.2 /  3.2)      3  spcman@my-deja.com
0.980  (  5.0 /  5.1)      7  Anthony <apsaffer@hotmail.com>
0.941  (  1.6 /  1.7)      3  oarend@my-deja.com
0.874  (  2.9 /  3.3)      3  Dave E <dave_at_hm@hotmail.com>
0.813  (  0.7 /  0.8)      4  "James Boulter" <jbou@bunker79.fsnet.co.uk>
0.724  (  2.7 /  3.7)      4  zabor@my-deja.com
0.696  (  1.7 /  2.4)      4  jesus X <jesusx@who.net>
0.684  (  6.0 /  8.7)      9  "mark" <markscott@barclays.net>
0.624  (  1.5 /  2.4)      4  "Michael Guenther" <MiGuenther@lucent.com>
0.564  (  1.0 /  1.7)      3  Christer <chho65@hotmail.com>

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.479  (  1.0 /  2.1)      3  "Alan Mailer" <clarityassoc@earthlink.net>
0.463  (  0.3 /  0.6)      3  Shtirlitz <s_h=t-i_r@astelit.ru>
0.462  (  1.1 /  2.4)      3  Willis Kwok <wkwok@uunet.com.au>
0.459  (  0.6 /  1.4)      3  "Abhishek Roy" <fingerslip@yahoo.com>
0.410  (  2.1 /  5.0)      3  "Maarten" <maartenh@usa.net>
0.389  (  1.3 /  3.3)      3  John Golubenko <java@dashmail.net>
0.357  (  6.0 / 16.8)     11  Ameen Dausha <ameen@dausha.net>
0.290  (  1.9 /  6.4)      4  "Aidan" <Aidan.Finn@ucd.ie>
0.270  (  0.5 /  1.9)      3  John D Prokopek <jprokopek@snet.net>
0.172  (  1.4 /  7.9)      4  Aaron Dancygier <adancygier@nyc.rr.com>

20 posters (11%) had at least three posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      22  comp.lang.perl.modules
       9  comp.lang.perl
       7  comp.lang.perl.moderated
       6  alt.perl
       5  de.comp.lang.perl.cgi
       4  comp.lang.pascal.delphi.misc
       4  comp.lang.javascript
       4  comp.lang.pascal.borland
       4  comp.lang.lisp
       4  comp.lang.java.programmer

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  Markus Humm <mhumm@ba-mosbach.de>
       6  "Daniel J. Wojcik" <wojcik@genjerdan.com>
       6  "MIREBEAU.FAMILY" <MIREBEAU.FAMILY@wanadoo.fr>
       3  venez1@my-deja.com
       3  Flavius Vespasian <noone9999999@aol.com>
       3  mail@lboth.de
       2  Lisa Williams <lisa@acc.com>
       1  "kim kubik" <chaotrope@jps.net>
       1  "Serge V. Egerev" <esv@windoms.sitek.net>
       1  "Anthony Carbone" <anthonyc@mincom.com>


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

Date: 6 Nov 2000 17:37:11 GMT
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: Newbie question: Get date of 3rd Friday in a given year/month?
Message-Id: <8u6q87$k7f@gap.cco.caltech.edu>

In article <3A05B1CC.74779EBD@urbanrage.com>, eric  <eric@urbanrage.com> wrote:
>a cheesy way to do it on a system with cal
>
>@info = `cal $month $year`;
>$fri = (split(' ', $info[4]))[5];
>
>print "third friday of $month/$year is the $fri\n";

Doesn't work for January 2000.

-- Gary


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

Date: Mon, 6 Nov 2000 19:15:18 +0100
From: "Toni" <trioinfoQUITAESTO@trioinfografia.com>
Subject: Novice silly question: Delete a file
Message-Id: <8u6sa4$5pjf10@SGI3651ef0.iddeo.es>

Hello!
I know that rmdir delete a directory, but I can't find in my perl doc a way
to delete a file without using a system() or exec() call to the OS delete
file command.
I suppose there is a Perl function to do this easily, can somebody help me?

Thanks!!




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

Date: Mon, 06 Nov 2000 10:27:18 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Novice silly question: Delete a file
Message-Id: <3A06F806.AB4FE5CA@vpservices.com>

Toni wrote:
> 
> I know that rmdir delete a directory, but I can't find in my perl doc a way
> to delete a file 

Part of Perl's Unix heritage is that the "delete a file" function is
named after its Unix counterpart: unlink.

One way you can find out such things in the future is to make use of the
perlfunc page that comes with Perl -- it lists Perl functions by
category and you'd be able to find "unlink" listed under the category
"Functions for filehandles, files, or directories".

-- 
Jeff


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

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 4823
**************************************


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