[22581] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4802 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 1 18:10:45 2003

Date: Tue, 1 Apr 2003 15:10:13 -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           Tue, 1 Apr 2003     Volume: 10 Number: 4802

Today's topics:
    Re: search and replace long hex string <dougkite@yahoo.com>
        Sending quit <dbohl@sgi.com>
    Re: Sending quit <tony_curtis32@yahoo.com>
    Re: Sending quit <dbohl@sgi.com>
    Re: Sending quit <abigail@abigail.nl>
    Re: slow file access under windows <goldbb2@earthlink.net>
        Test / Performance benchmarking position available in G (ldap)
        That's just plain WRONG (Sara)
    Re: That's just plain WRONG <ethan@draupnir.gso.saic.com>
    Re: That's just plain WRONG <usenet@dwall.fastmail.fm>
        trouble with "Hello, World!" script (R. Bryant)
    Re: use encoding with print <<here; <goldbb2@earthlink.net>
        use modules with same namespace <pilsl_usenet@goldfisch.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 01 Apr 2003 11:38:22 -0500
From: Doug Kite <dougkite@yahoo.com>
Subject: Re: search and replace long hex string
Message-Id: <3E89C07E.1020108@yahoo.com>

John W. Krahn wrote:
>>I could not get any of these to work. Only the single byte hex replace
>>will work.  Any other ideas?
> 
> 
> It could be that you have an older version of Perl that doesn't
> understand (?<=) and (?=).
> 
> perl -i -pe 's{(\xb3\x01\x00\x16)\x24(\xf0)}{$1\x14$2}g' /foo/bar


I'm running 5.8.0. Unfortunately the above example wouldn't work either. 
I finally found some sample C code that did though, so I got it done 
that way.

Thanks for your time and help.
Doug



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

Date: Tue, 01 Apr 2003 11:45:51 -0600
From: Dale Bohl <dbohl@sgi.com>
Subject: Sending quit
Message-Id: <3E89D04F.7D0330D6@sgi.com>


I want to check the version of sendmail that's
running on a group of rwmote hosts with perl.

The command is "telnet $host 25" but this also
requires a "quit" to exit the telnet.

Anyone know how I can do this from within
a perl script?

Dale


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

Date: Tue, 01 Apr 2003 11:56:11 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Sending quit
Message-Id: <87k7eeje4k.fsf@limey.hpcc.uh.edu>

>> On Tue, 01 Apr 2003 11:45:51 -0600,
>> Dale Bohl <dbohl@sgi.com> said:

> I want to check the version of sendmail that's running
> on a group of rwmote hosts with perl.

Or whichever SMTP server that's listening (just to
generalise).

> The command is "telnet $host 25" but this also requires
> a "quit" to exit the telnet.
> Anyone know how I can do this from within a perl script?

Don't use telnet to do it, use something more specialised.

Net::SMTP should be just the ticket (see method banner() ).

  e.g.

    http://search.cpan.org/author/GBARR/libnet-1.13/Net/SMTP.pm

hth
t


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

Date: Tue, 01 Apr 2003 13:46:44 -0600
From: Dale Bohl <dbohl@sgi.com>
Subject: Re: Sending quit
Message-Id: <3E89ECA4.67715F97@sgi.com>

Tony Curtis wrote:
> 
> >> On Tue, 01 Apr 2003 11:45:51 -0600,
> >> Dale Bohl <dbohl@sgi.com> said:
> 
> > I want to check the version of sendmail that's running
> > on a group of rwmote hosts with perl.
> 
> Or whichever SMTP server that's listening (just to
> generalise).
> 
> > The command is "telnet $host 25" but this also requires
> > a "quit" to exit the telnet.
> > Anyone know how I can do this from within a perl script?
> 
> Don't use telnet to do it, use something more specialised.
> 
> Net::SMTP should be just the ticket (see method banner() ).
> 
>   e.g.
> 
>     http://search.cpan.org/author/GBARR/libnet-1.13/Net/SMTP.pm
> 
> hth
> t


I don't want to rely on a module.

-- 
Dale Bohl
dbohl@sgi.com
SGI WWSA
(715)-726-8406


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

Date: 01 Apr 2003 20:27:44 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Sending quit
Message-Id: <slrnb8jti0.t5l.abigail@alexandra.abigail.nl>

Dale Bohl (dbohl@sgi.com) wrote on MMMD September MCMXCIII in
<URL:news:3E89ECA4.67715F97@sgi.com>:
::  
::  I don't want to rely on a module.


So, you don't want to rely on a piece of software someone has put many
hours of labour in, is part of the main distribution, and is part of a
bundle that has a mailing list dedicated to it, yet you're willing to
use the advice, or even code, of someone on a Usenet group that gave it
all of 2 minutes of attention, with no or very minimal testing?

I'm baffled.

Why such an attitude?



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 01 Apr 2003 13:01:22 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: slow file access under windows
Message-Id: <3E89D3F2.4EC8FA3F@earthlink.net>



Michael Bickel wrote:
> 
> Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3E88FA4B.7C1784F6@earthlink.net>...
> > Michael Bickel wrote:
> > >
> > > Hi,
> > > I recognice, that a simple file access is much slower under Windows
> > > (W2K, Perl 5.6.1) than under Unix (AIX). I just check 5 directories if
> > > they exist or not  (with switch and opendir) and it took more than 10
> > > sec.
> > > Also using File::Find (see below) take much longer under Win than
> > > under AIX (Win: 25 sec., AIX <2 sec).
> > > Has anyone suggestions to increase the speed?
> >
> > Windows and Unix use different filesystems.  The filesystem which
> > Windows uses is slower than the filesystem which Unix uses.  This is not
> > perl's fault, and there is no perl solution.
> 
> But even the KShell from AT&T is faster:
> find with KSH:        2s
> File::Find with Perl: 20s
> (Directory contains 570 Files)
> 
> Isn't this difference to big?

The "find" program that you're running under ksh is a C executable,
specially designed for the purpose of doing directory traversal, so
of course it's faster than a perl version of the same.

(ksh is irrelevant, since it's "find" that's doing all the work.)

Do a test finding out the speeds of "find" on unix and on windows,
and the speeds of "File::Find" on unix on windows.

For File::Find, it will run X times faster on unix than windows.
For find, it will run Y times faster on unix than windows.

On unix, find will be Z times faster than File::Find.
On windows, find will be W times faster than File::Find.

If X and Y differ significantly, or if Z and W differ significantly,
*then* you might have a significant concern.

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}


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

Date: 1 Apr 2003 15:03:07 -0800
From: ldap1777@yahoo.com (ldap)
Subject: Test / Performance benchmarking position available in Germantown, MD
Message-Id: <1a3bf200.0304011503.40b31f58@posting.google.com>

We have an entry level position available:

We are looking for candidates with some exposure to UNIX/Solaris,
shell scripts, Perl, Tk who can help us in testing our equipment and
perform performance benchmarking. We are open to an
intern/junior-level/part-time position. The candidate must exhibit
great attitude and willingness to learn. Knowledge of C/C++
programming will be considered an added benefit for the position.

Timings are flexible, and we are willing to adjust the duration you
have to spend on the job based on your schedule. Its a great position
for a telecom career path and you will get a chance to work with some
of the most excellent people in the industry!

Location is Germantown, MD.

Please call Medhavi 240-912-1307.


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

Date: 1 Apr 2003 12:19:37 -0800
From: genericax@hotmail.com (Sara)
Subject: That's just plain WRONG
Message-Id: <776e0325.0304011219.52e357c6@posting.google.com>

To CPAN I ventured today,
where I found to my dismay,
the archives had all gone AWAY
and to my collegue I did say...

I'm sure it was just there,
and he said "to be fair",
try .com, .net- look ELSEWHERE!
I said, its ORG, I SWEAR!

Off to CLPM I hollered,
and on his linux box he follered,
where we searched at any cost,
for posting's of an archive lost...

and THERE it was, some jolly joker,
with a face seen oft' in poker, 
had the CPAN frontpage replaced,
and then was I mostly red-faced.

So BEWARE you Peristas of Spring,
for it is oft a perilious thing,
to venture into CPANs far,
for frontpages aren't what they seem they ARE..


Ya GOT me!

-Gx


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

Date: 01 Apr 2003 13:04:16 -0800
From: Ethan Brown <ethan@draupnir.gso.saic.com>
Subject: Re: That's just plain WRONG
Message-Id: <vrbrzqj5f3.fsf@draupnir.gso.saic.com>


Haiku

Perl knowledge I sought
At the font that is C'PAN.
Sadness.  It's Matt's Scripts.

--Ethan Brown
--Keyboards: "The Fabulous Pelicans" (www.pelicans.com)
--In a band?  Use http://www.WheresTheGig.com for free.



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

Date: Tue, 01 Apr 2003 21:25:12 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: That's just plain WRONG
Message-Id: <Xns9350A708B4D2dkwwashere@216.168.3.30>

Sara <genericax@hotmail.com> wrote:

> To CPAN I ventured today,
> where I found to my dismay,
> the archives had all gone AWAY
> and to my collegue I did say...

My Perl program needed a tool
A module from CPAN would be cool
    A usenetter said
    that CPAN was dead
But it's yet another April Day Fool.

-- 
David K. Wall - usenet@dwall.fastmail.fm
WWJD? JWRTFM.


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

Date: 1 Apr 2003 09:14:38 -0800
From: rob@3jar.com (R. Bryant)
Subject: trouble with "Hello, World!" script
Message-Id: <d691a3b6.0304010914.3a7f940f@posting.google.com>

I have a problem with my "Hello, World!" script. Here's what it looks like:

print "Hello, World!\n";

It outputs exactly what I expect it to output, but it doesn't seem like a
"real" Perl script:

    1.) it doesn't use map()
    2.) it doesn't sufficiently resemble line noise
    3.) if I leave my terminal for an hour and come back,
        I still understand what my script does

If this is answered in a FAQ or perldoc somewhere, just reply with the
relevant bits: I can't be bothered to read the actual documentation.

Thanks for your help, and by the way... April Fools!

-- 
rob

TMTOWTDIBTWWPRTIOTM: "There's More Than One Way To Do It, But
This Way Will Probably Raise The Ire Of Tad McClellan."


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

Date: Tue, 01 Apr 2003 13:35:57 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: use encoding with print <<here;
Message-Id: <3E89DC0D.A998AD92@earthlink.net>

James Kilfiger wrote:
> 
> I am using perl 5.8.0, and Windows XP.
> 
> Most of this post is vanilla ascii, but there are a few Japanese
> charaters in here, Google may have mangled them. Sorry if it has
> 
> I am writing a simple perl script in Japanese.
> 
> Most of the program is one big print <<here; However I ran into
> problems with the kanji for "hyougen-&#34920;&#29694;".
> 
> The first kanji (hyou) in shift jis encoding consists of two bytes.
> The first is an eight byte character, the second is \ (backslash).
> Inside the <<here string perl became confused when it reached this
> character, perl interpreted it as escaping the next byte, and became
> confused.
> 
> As I have perl 5.8 I tried the pragma   use encoding "cp932"; however
> the problem remains
>
> This is a short program to illustrate the problem
> 
> #!perl
> use encoding "cp932"; # the same as shift jis
> 
> print "&#34920;&#29694; \n";  # ("hyougen \n")   This seems to work.
> print <<here;
> &#34920;&#29694;
> here
> # the <<here quote interpolates improperly.
> 
> Is this behaviour documented anywhere (I've looked at the obvious
> places but can't find any reference)

Try sending email to Dan Kogai, the maintainer of the encoding pragma.

If it's not the fault of his module, then he'll probably forward it to
the perl5porters@perl.org mailing list.  This would probably happen if
the the problem is caused by "use overload 'qq' => ..." ignoring
here-docs (which I think it might be).

> Is there a workaround?

Use the filter option.

   use encoding "cp932", Filter => 1;

It'll be slightly slower, but it should work.

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}


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

Date: Tue, 1 Apr 2003 22:31:08 +0200
From: peter pilsl <pilsl_usenet@goldfisch.at>
Subject: use modules with same namespace
Message-Id: <3e89f73a$1@e-post.inode.at>


to split a big module into several smaller modules I use the following way.

package mymodule;

use submodule1;
use submodule2;

 ....

where submodule1 und submodule2 is only a collection of subs.
Cause many subs in submodule1 make calls to subs in the mainmodule and even 
in submodule2 I didnt give submodule1 and submodule2 a own namespace, but 
also use the same namespace.

So submodule1 reads like this:

package mymodule;

sub1{...}
sub2{...}

1;


It seems to work - even with mod_perl - but it doesnt seem very ok to me. 
Are there any drawbacks on this ?  (beside the fact that it isnt good style)

peter



-- 
peter pilsl
pilsl_usenet@goldfisch.at
http://www.goldfisch.at



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

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


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